src/private/PZGNetworkIOSession.cpp
static MessageRef CreateBeaconDataMessage(const ConstPZGBeaconDataRef & beaconData, bool serializeBeaconData, const PZGMulticastMessageTag & sourceTag)
{
   MessageRef msg = GetMessageFromPool(PZG_NETWORK_COMMAND_SET_BEACON_DATA);
   if (msg() == NULL) return MessageRef();

   if (beaconData())
   {
      if (serializeBeaconData)
      {
         FlatCountableRef fcRef(CastAwayConstFromRef(beaconData));
         if (msg()->AddFlat(PZG_NETWORK_NAME_BEACON_DATA, fcRef).IsError()) return MessageRef();
      }
      else if (msg()->AddFlat(PZG_NETWORK_NAME_BEACON_DATA, *beaconData()).IsError()) return MessageRef();
   }

   if ((sourceTag.IsValid())&&(msg()->AddFlat(PZG_NETWORK_NAME_MULTICAST_TAG, sourceTag).IsError())) return MessageRef();

   return msg;
}
// serializeBeaconData controls whether we add the beaconData to the Message in flattened-to-bytes form
// or just add the PZGBeaconData object to the Message.  Logically it's the same but efficiency can be
// better one way or the other, depending on what we are going to do with the Message next.
serializeBeaconData controls whether we add the beaconData to the Message in flattened-to-bytes form
or just add the PZGBeaconData object to the Message.  Logically it's the same but efficiency can be
better one way or the other, depending on what we are going to do with the Message next.
serializeBeaconData controls whether we add the beaconData to the Message in flattened - to - bytes form or just add the PZGBeaconData object to the Message . Logically it ' s the same but efficiency can be better one way or the other depending on what we are going to do with the Message next .
static MessageRef CreateBeaconDataMessage(const ConstPZGBeaconDataRef & beaconData, bool serializeBeaconData, const PZGMulticastMessageTag & sourceTag)
{
   MessageRef msg = GetMessageFromPool(PZG_NETWORK_COMMAND_SET_BEACON_DATA);
   if (msg() == NULL) return MessageRef();
   if (beaconData())
   {
      if (serializeBeaconData)
      {
         FlatCountableRef fcRef(CastAwayConstFromRef(beaconData));
         if (msg()->AddFlat(PZG_NETWORK_NAME_BEACON_DATA, fcRef).IsError()) return MessageRef();
      }
      else if (msg()->AddFlat(PZG_NETWORK_NAME_BEACON_DATA, *beaconData()).IsError()) return MessageRef();
   }
   if ((sourceTag.IsValid())&&(msg()->AddFlat(PZG_NETWORK_NAME_MULTICAST_TAG, sourceTag).IsError())) return MessageRef();
   return msg;
}
static MessageRef CreateBeaconDataMessage ( const ConstPZGBeaconDataRef & beaconData , bool serializeBeaconData , const PZGMulticastMessageTag & sourceTag ) { MessageRef msg = GetMessageFromPool ( PZG_NETWORK_COMMAND_SET_BEACON_DATA ) ; if ( msg ( ) == NULL ) return MessageRef ( ) ; if ( beaconData ( ) ) { if ( serializeBeaconData ) { FlatCountableRef fcRef ( CastAwayConstFromRef ( beaconData ) ) ; if ( msg ( ) -> AddFlat ( PZG_NETWORK_NAME_BEACON_DATA , fcRef ) . IsError ( ) ) return MessageRef ( ) ; } else if ( msg ( ) -> AddFlat ( PZG_NETWORK_NAME_BEACON_DATA , * beaconData ( ) ) . IsError ( ) ) return MessageRef ( ) ; } if ( ( sourceTag . IsValid ( ) ) && ( msg ( ) -> AddFlat ( PZG_NETWORK_NAME_MULTICAST_TAG , sourceTag ) . IsError ( ) ) ) return MessageRef ( ) ; return msg ; }
serializeBeaconData controls whether we add the beaconData to the Message in flattened-to-bytes form
or just add the PZGBeaconData object to the Message.
serializeBeaconData controls whether we add the beaconData to the Message in flattened - to - bytes form or just add the PZGBeaconData object to the Message .