fipa_acl  1.4
Static Public Member Functions | List of all members
fipa::acl::MessageGenerator Class Reference

#include <message_generator.h>

Static Public Member Functions

static std::string create (const ACLMessage &msg, const representation::Type &acl_representation)
 

Detailed Description

Definition at line 15 of file message_generator.h.

Member Function Documentation

◆ create()

std::string fipa::acl::MessageGenerator::create ( const ACLMessage msg,
const representation::Type acl_representation 
)
static

Create a message of a certain acl representation (format), e.g. bitefficient, string, xml

Returns
message object using the given acl representation (format)

Definition at line 18 of file message_generator.cpp.

19 {
20  std::map<representation::Type, MessageFormatPtr >::const_iterator it = msFormats.find(type);
21 
22  if( it != msFormats.end())
23  {
24  return it->second->apply(msg);
25  } else
26  {
27  char buffer[512];
28  snprintf(buffer, 512, "Message format of type '%s' is unknown", representation::TypeTxt[type].c_str());
29  LOG_ERROR("%s", buffer);
30  throw std::runtime_error(buffer);
31  }
32 }
const std::string TypeTxt[]
Definition: types.h:28

The documentation for this class was generated from the following files: