#include <xml_message_format.h>
Inherits fipa::acl::MessageFormat.
Definition at line 11 of file xml_message_format.h.
◆ apply()
| std::string fipa::acl::XMLMessageFormat::apply |
( |
const ACLMessage & |
aclMsg | ) |
const |
|
virtual |
Applies the XML format to the message
- Returns
- the formatted message
Implements fipa::acl::MessageFormat.
Definition at line 10 of file xml_message_format.cpp.
13 TiXmlDeclaration * decl =
new TiXmlDeclaration(
"1.0",
"",
"" );
14 doc.LinkEndChild( decl );
16 TiXmlElement * messageElem =
new TiXmlElement(
"fipa-message" );
18 messageElem->SetAttribute(
"act", aclMsg.getPerformative());
19 messageElem->SetAttribute(
"conversation-id", aclMsg.getConversationID());
20 doc.LinkEndChild( messageElem );
22 BOOST_FOREACH(TiXmlElement* elem, getParameters(aclMsg))
24 messageElem->LinkEndChild(elem);
28 printer.SetIndent(
"");
29 printer.SetLineBreak(
"");
31 doc.Accept( &printer );
The documentation for this class was generated from the following files:
- /build/rock-master-18.09-multiagent-fipa-acl-0.20180914/src/message_generator/format/xml_message_format.h
- /build/rock-master-18.09-multiagent-fipa-acl-0.20180914/src/message_generator/format/xml_message_format.cpp