3 namespace fipa {
namespace acl {
15 printf(
"FIPA Message read:\n");
18 if( (msg.
header.
id & ! 0xfa) == 0) printf(
"\tid is FA\n");
19 else if( (msg.
header.
id & ! 0xfb) == 0 ) printf(
"\tid is FB\n");
20 else if( (msg.
header.
id & ! 0xfc) == 0 ) printf(
"\tid is FC\n");
21 else printf(
"\tWARNING: id is unknown\n");
25 printf(
"performative(type): %s\n", msg.
type.c_str());
27 printf(
"msg-parameters count: %d\n",(
int) msg.
parameters.size());
28 for(uint32_t i=0; i < msg.
parameters.size(); i++)
31 printf(
"\tparameter #%d: %s\n",i, mp.
name.c_str());
33 if(mp.
name ==
"sender")
37 aidPrinter.
print(aid);
38 }
else if(mp.
name ==
"receiver")
41 std::vector<fipa::acl::AgentIdentifier> aids = boost::get<std::vector<fipa::acl::AgentIdentifier> >(mp.
data);
42 int length = aids.size();
44 printf(
"Receiver: \n");
45 for(
int i = 0; i < length; i++)
47 aidPrinter.
print(aids[i]);
51 }
else if(mp.
name ==
"content")
54 printf(
"encoding: %s\n", bs.
encoding.c_str());
57 printf(
"content: %s\n", printBytes.c_str());
58 }
else if(mp.
name ==
"reply-with")
60 std::string replyWith = boost::get<std::string>(mp.
data);
61 printf(
"ReplyWith: %s\n", replyWith.c_str());
62 }
else if(mp.
name ==
"reply-by")
65 std::string dtString = dt.
toString();
66 printf(
"DateTime: %s\n", dtString.c_str());
68 }
else if(mp.
name ==
"in-reply-to")
70 std::string inReplyTo = boost::get<std::string>(mp.
data);
71 printf(
"InReplyTo: %s\n", inReplyTo.c_str());
73 }
else if(mp.
name ==
"reply-to")
76 std::vector<fipa::acl::AgentIdentifier> aids = boost::get<std::vector<fipa::acl::AgentIdentifier> >(mp.
data);
77 int length = aids.size();
79 printf(
"ReplyTo: \n");
80 for(
int i = 0; i < length; i++)
82 aidPrinter.
print(aids[i]);
86 }
else if(mp.
name ==
"language")
88 std::string language = boost::get<std::string>(mp.
data);
89 printf(
"Language: %s\n", language.c_str());
92 }
else if(mp.
name ==
"encoding")
94 std::string encoding = boost::get<std::string>(mp.
data);
95 printf(
"Encoding: %s\n", encoding.c_str());
98 }
else if(mp.
name ==
"ontology")
101 std::string ontology = boost::get<std::string>(mp.
data);
102 printf(
"Ontology: %s\n", ontology.c_str());
105 }
else if(mp.
name ==
"protocol")
107 std::string protocol = boost::get<std::string>(mp.
data);
108 printf(
"Protocol: %s\n", protocol.c_str());
111 }
else if(mp.
name ==
"conversation-id")
113 std::string conversationId = boost::get<std::string>(mp.
data);
114 printf(
"Conversation-id: %s\n", conversationId.c_str());
std::string toString() const
std::vector< message::Parameter > parameters
Representation of a byte sequence. We also embed information about the encoding.
This class can be used to print the AgentIdentifier.
Definition for AgentIdentifier.
void print(const fipa::acl::Message &msg) const
std::string toPrettyString() const
void print(const fipa::acl::AgentIdentifier &aid)
Print an AgentIdentifier.
Foundation of Physical Intelligent Agents.