fipa_acl
1.4
Main Page
Namespaces
Classes
Files
File List
File Members
build
rock-master-18.09-multiagent-fipa-acl-0.20180914
src
message_parser
types.h
Go to the documentation of this file.
1
#ifndef _FIPAACL_TYPES_H_
2
#define _FIPAACL_TYPES_H_
3
4
#include <stdio.h>
5
#include <vector>
6
#include <string>
7
8
#include <boost/variant/recursive_variant.hpp>
9
#include <boost/variant/apply_visitor.hpp>
10
#include <boost/variant/get.hpp>
11
#include <boost/bind.hpp>
12
13
#include <fipa_acl/message_parser/date_time.h>
14
#include <fipa_acl/message_parser/byte_sequence.h>
15
#include <fipa_acl/message_parser/agent_id.h>
16
#include <fipa_acl/message_parser/parameter.h>
17
18
namespace
fipa
19
{
20
21
//#############################################################
22
// The FIPA Bit Message Representation in Bit-Efficient Encoding
23
//#############################################################
24
25
namespace
acl
26
{
27
28
// Embedd only types into the BOOST_FUSION_ADAPT_STRUCT
29
// So perform all definitions here
30
//
31
struct
Header
32
{
33
char
id
;
34
char
version
;
35
36
std::string
toString
()
const
37
{
38
char
tmp[100];
39
snprintf(tmp,100,
"Header<id=%x, version=%x>"
,
id
,
version
);
40
return
std::string(tmp);
41
}
42
43
};
44
45
namespace
message {
46
47
struct
Parameter
48
{
49
std::string
name
;
50
ParameterValue
data
;
51
52
std::string
toString
()
const
53
{
54
std::string tmp =
name
;
55
tmp +=
"<"
+ boost::apply_visitor(
ParameterPrinter
(),
data
) +
">"
;
56
return
tmp;
57
}
58
59
};
60
61
}
62
63
namespace
envelope
64
{
65
struct
Parameter
66
{
67
std::string
name
;
68
ParameterValue
data
;
69
70
std::string
toString
()
const
71
{
72
return
name
+
"<"
+
data
+
">"
;
73
}
74
};
75
76
}
77
78
// Define the final message structure here
79
struct
Message
80
{
81
Message
() :
type
(
""
),
parameters
() {}
82
83
Header
header
;
84
std::string
type
;
85
std::vector<message::Parameter>
parameters
;
86
};
87
88
89
90
}
// end namespace acl
91
}
// end namespace fipa
92
93
#endif // _FIPAACL_TYPES_H_
fipa::acl::message::Parameter::name
std::string name
Definition:
types.h:49
fipa::acl::envelope::Parameter::toString
std::string toString() const
Definition:
types.h:70
fipa::acl::envelope::Parameter
Definition:
types.h:65
fipa::acl::message::ParameterPrinter
Definition:
parameter.h:14
fipa::acl::Header
Definition:
types.h:31
fipa::acl::Header::toString
std::string toString() const
Definition:
types.h:36
fipa::acl::message::ParameterValue
boost::variant< std::string, fipa::acl::AgentIdentifier, std::vector< fipa::acl::AgentIdentifier >, fipa::acl::ByteSequence, fipa::acl::DateTime, fipa::acl::ByteString > ParameterValue
Definition:
parameter.h:12
fipa::acl::Message::parameters
std::vector< message::Parameter > parameters
Definition:
types.h:85
fipa::acl::message::Parameter
Definition:
types.h:47
fipa::acl::Message
Definition:
types.h:79
fipa::acl::envelope::Parameter::name
std::string name
Definition:
types.h:67
fipa::acl::message::Parameter::data
ParameterValue data
Definition:
types.h:50
fipa::acl::Header::id
char id
Definition:
types.h:33
fipa::acl::envelope::ParameterValue
std::string ParameterValue
Definition:
parameter.h:54
fipa::acl::envelope::Parameter::data
ParameterValue data
Definition:
types.h:68
fipa::acl::Header::version
char version
Definition:
types.h:34
fipa::acl::Message::Message
Message()
Definition:
types.h:81
fipa::acl::Message::type
std::string type
Definition:
types.h:84
fipa::acl::message::Parameter::toString
std::string toString() const
Definition:
types.h:52
fipa::acl::Message::header
Header header
Definition:
types.h:83
Generated on Tue Oct 9 2018 11:04:42 for fipa_acl by
1.8.6