A factory that generates protobuf message based on a string type.
More...
#include <msgs/msgs.hh>
|
static void | GetMsgTypes (std::vector< std::string > &_types) |
| Get all the message types. More...
|
|
static boost::shared_ptr< google::protobuf::Message > | NewMsg (const std::string &_msgType) |
| Create a new instance of a message. More...
|
|
static void | RegisterMsg (const std::string &_msgType, MsgFactoryFn _factoryfn) |
| Register a message. More...
|
|
A factory that generates protobuf message based on a string type.
◆ GetMsgTypes()
static void GetMsgTypes |
( |
std::vector< std::string > & |
_types | ) |
|
|
static |
Get all the message types.
- Parameters
-
[out] | _types | Vector of strings of the message types. |
◆ NewMsg()
static boost::shared_ptr<google::protobuf::Message> NewMsg |
( |
const std::string & |
_msgType | ) |
|
|
static |
Create a new instance of a message.
- Parameters
-
[in] | _msgType | Type of message to create. |
- Returns
- Pointer to a google protobuf message. Null if the message type could not be handled.
◆ RegisterMsg()
static void RegisterMsg |
( |
const std::string & |
_msgType, |
|
|
MsgFactoryFn |
_factoryfn |
|
) |
| |
|
static |
Register a message.
- Parameters
-
[in] | _msgType | Type of message to register. |
[in] | _factoryfn | Function that generates the message. |
The documentation for this class was generated from the following file: