fipa_acl  1.4
bitefficient_format.h
Go to the documentation of this file.
1 #ifndef FIPA_ACL_BITEFFICIENT_FORMAT_H
2 #define FIPA_ACL_BITEFFICIENT_FORMAT_H
3 
4 #include <string>
5 #include <base/Time.hpp>
6 #include <fipa_acl/message_generator/acl_envelope.h>
7 #include <fipa_acl/message_generator/acl_message.h>
8 #include <fipa_acl/message_generator/types.h>
9 
10 namespace fipa {
11 namespace acl {
12 
14 {
15 public:
19  static char getEOFCollection() { return 0x01; }
20 
21  static char getEOFEnvelope() { return getEOFCollection(); }
22 
23  static std::string getByteLengthEncodedString(const std::string& sword);
24 
25  static std::string getNullTerminatedString(const std::string& sword);
26 
30  static std::string getString(const std::string& sword);
31 
36  static std::string getCodedNumber(const std::string& cn);
37 
41  static std::string getCodedNaturalNumber(const std::string& cn);
42 
49  static std::string getBinDateTimeToken(const std::string& date1);
50 
57  static std::string getBinDateTimeToken(const base::Time& time);
58 
62  static std::string getBinDate(const base::Time& time);
63 
68  static std::string getBinDate(const std::string& date1);
69 
73  static std::string getBinNumber(uint32_t number, bool asHex = false);
74 
78  static std::string getACLRepresentation(const representation::Type& type);
79 
83  static std::string getDigits(const std::string& numberString) { return getCodedNumber(numberString); }
84 
88  static std::string getDigits(uint32_t number);
89 
93  static std::string getReceivedObject(const ReceivedObject& object);
94 
98  static std::string getAgentID(const AgentID& agentId);
99 
103  static std::string getAgentIDSequence(const std::vector<AgentID>& agentIds);
104 
108  static std::string getBinStringNoCodetable(const std::string& sword) { return char(0x14) + getNullTerminatedString(sword); }
109 
110 };
111 
112 } // end namespace acl
113 } // end namespace fipa
114 
115 #endif // FIPA_ACL_BITEFFICIENT_FORMAT_H
static std::string getCodedNaturalNumber(const std::string &cn)
Allow proper generation of natural numbers, will remove any leading zeros.
static std::string getString(const std::string &sword)
static std::string getACLRepresentation(const representation::Type &type)
static std::string getBinDate(const base::Time &time)
static std::string getNullTerminatedString(const std::string &sword)
static std::string getDigits(const std::string &numberString)
static std::string getCodedNumber(const std::string &cn)
implements a coded number passed as a string it goes through it digit by digit(char by char) ...
static std::string getByteLengthEncodedString(const std::string &sword)
static std::string getAgentID(const AgentID &agentId)
static char getEOFCollection()
returns the very used end-of-collection marker
Implements the general AgentID functionality, which is present throughout the fipa specifications(FIP...
Definition: agent_id.h:37
static std::string getAgentIDSequence(const std::vector< AgentID > &agentIds)
static std::string getBinDateTimeToken(const std::string &date1)
implements the date time token production of the grammar; not complete(w.r.t. the specification) in f...
static std::string getReceivedObject(const ReceivedObject &object)
static std::string getBinNumber(uint32_t number, bool asHex=false)
static std::string getBinStringNoCodetable(const std::string &sword)