Ignition Msgs

API Reference

8.4.0
Factory.hh File Reference
#include <google/protobuf/message.h>
#include <string>
#include <map>
#include <memory>
#include <vector>
#include "ignition/msgs/config.hh"
#include "ignition/msgs/Export.hh"

Go to the source code of this file.

Classes

class  Factory
 A factory that generates protobuf message based on a string type. This class will also try to load all Protobuf descriptors specified in the IGN_DESCRIPTOR_PATH environment variable on program start. More...
 

Namespaces

 ignition
 
 ignition::msgs
 

Macros

#define IGN_REGISTER_STATIC_MSG(_msgtype, _classname)
 Static message registration macro. More...
 

Typedefs

typedef std::unique_ptr< google::protobuf::Message >(* FactoryFn) ()
 Prototype for message factory generation. More...
 

Macro Definition Documentation

◆ IGN_REGISTER_STATIC_MSG

#define IGN_REGISTER_STATIC_MSG (   _msgtype,
  _classname 
)
Value:
\
std::unique_ptr<google::protobuf::Message> New##_classname() \
{ \
new _classname); \
} \
class IgnMsg##_classname \
{ \
public: IgnMsg##_classname() \
{ \
Factory::Register(_msgtype, New##_classname);\
} \
}; \
static IgnMsg##_classname IgnitionMessagesInitializer##_classname;
STL class.

Static message registration macro.

Use this macro to register messages.

Parameters
[in]_msgtypeMessage type name.
[in]_classnameClass name for message.