6 #define FIPA_BASE_MSG_ID char(0xfe) 7 #define FIPA_EXT_MSG_ID char(0xfd) 14 std::string msg = getAllExternalEnvelopes(envelope) + getBaseEnvelope(envelope.
getBaseEnvelope()) + envelope.
getPayload();
19 std::string BitefficientEnvelopeFormat::getAllExternalEnvelopes(
const ACLEnvelope& envelope)
const 21 std::string extEnvelopes;
25 ACLBaseEnvelopeList::const_iterator cit = list.begin();
26 for(; cit != list.end(); ++cit)
28 extEnvelopes += getExtEnvelope(*cit);
34 std::string BitefficientEnvelopeFormat::getBaseEnvelope(
const ACLBaseEnvelope& envelope)
const 36 std::string baseEnvelope;
37 baseEnvelope += getBaseEnvelopeHeader(envelope);
38 baseEnvelope += getParameters(envelope);
43 std::string BitefficientEnvelopeFormat::getParameters(
const ACLBaseEnvelope& envelope)
const 45 std::string baseEnvelope;
93 std::string BitefficientEnvelopeFormat::getBaseEnvelopeHeader(
const ACLBaseEnvelope& envelope)
const 98 uint32_t length = 2 + 2 + 2 + dateTimeToken.size();
102 uint16_t envLen = htons( (uint16_t) length);
103 header.append(reinterpret_cast<const char*>(&envLen),
sizeof(uint16_t));
104 header += representation;
105 header += dateTimeToken;
110 std::string BitefficientEnvelopeFormat::getExtEnvelope(
const ACLBaseEnvelope& envelope)
const 112 std::string parameters = getParameters(envelope);
113 std::string receivedObject = getReceivedObject(envelope);
115 uint32_t length = 2 + 2 + parameters.size() + 1 ;
116 std::string extEnvelope =
"";
118 if(length > std::numeric_limits<uint16_t>::max() )
121 extEnvelope.append(reinterpret_cast<const char*>((uint16_t) 0),
sizeof(uint16_t));
122 uint32_t envLen = htonl( length );
123 extEnvelope.append(reinterpret_cast<const char*>(&envLen),
sizeof(uint32_t));
125 uint16_t envLen = htons( length );
126 extEnvelope.append(reinterpret_cast<const char*>(&envLen),
sizeof(uint16_t));
128 extEnvelope += receivedObject;
129 extEnvelope += parameters;
134 std::string BitefficientEnvelopeFormat::getReceivedObject(
const ACLBaseEnvelope& envelope)
const 149 ID id = receivedObject.
getId();
const ReceivedObject & getReceivedObject() const
The ACLBaseEnvelope defines the layout for an envelope with which ACLMessage data can be wrapped...
ACLMessage envelope (also typed as fipa::acl::Letter) includes the base envelope and updated fields...
const TransportBehaviour & getTransportBehaviour() const
const Via & getVia() const
const ACLBaseEnvelopeList & getExtraEnvelopes() const
const PayloadLength & getPayloadLength() const
const PayloadEncoding & getPayloadEncoding() const
const URL & getFrom() const
const AgentIDList & getIntendedReceivers() const
std::vector< ACLBaseEnvelope > ACLBaseEnvelopeList
const base::Time & getDate() const
const base::Time & getDate() const
const std::string & getPayload() const
bool contains(envelope::ParameterId id) const
const representation::Type & getACLRepresentation() const
const Comments & getComments() const
const URL & getBy() const
const AgentIDList & getTo() const
const ACLBaseEnvelope & getBaseEnvelope() const
const AgentID & getFrom() const
Foundation of Physical Intelligent Agents.