|
static const google::protobuf::Descriptor * | find_descriptor (const std::string &protobuf_type_name, bool user_pool_first=false) |
| Finds the Google Protobuf Descriptor (essentially a meta-class for a given Message) from a given Message name. More...
|
|
template<typename GoogleProtobufMessagePointer > |
static GoogleProtobufMessagePointer | new_protobuf_message (const std::string &protobuf_type_name, bool user_pool_first=false) |
| Create a new (empty) Google Protobuf message of a given type by name. More...
|
|
template<typename GoogleProtobufMessagePointer > |
static GoogleProtobufMessagePointer | new_protobuf_message (const google::protobuf::Descriptor *desc) |
| Create a new (empty) Google Protobuf message of a given type by Descriptor. More...
|
|
static std::shared_ptr< google::protobuf::Message > | new_protobuf_message (const google::protobuf::Descriptor *desc) |
| Create a new (empty) Google Protobuf message of a given type by Descriptor. More...
|
|
static std::shared_ptr< google::protobuf::Message > | new_protobuf_message (const std::string &protobuf_type_name) |
| Create a new (empty) Google Protobuf message of a given type by name. More...
|
|
static void | add_database (std::shared_ptr< google::protobuf::DescriptorDatabase > database) |
| Add a Google Protobuf DescriptorDatabase to the set of databases searched for Message Descriptors.
|
|
static void | enable_compilation () |
| Enable on the fly compilation of .proto files on the local disk. Must be called before load_from_proto_file() is called.
|
|
static const google::protobuf::FileDescriptor * | load_from_proto_file (const std::string &protofile_absolute_path) |
| Load a message from a .proto file on the disk. enable_compilation() must be called first. More...
|
|
static void | add_include_path (const std::string &path) |
| Add a path for searching for import messages when loading .proto files using load_from_proto_file() More...
|
|
static void * | load_from_shared_lib (const std::string &shared_lib_path) |
| Load compiled .proto files from a UNIX shared library (i.e. *.so or *.dylib) More...
|
|
static void | protobuf_shutdown () |
|
static const google::protobuf::FileDescriptor * | add_protobuf_file (const google::protobuf::FileDescriptorProto &proto) |
| Add a protobuf file defined in a google::protobuf::FileDescriptorProto.
|
|
static void | reset () |
|
static void | custom_deleter (DynamicProtobufManager *obj) |
|
static google::protobuf::DynamicMessageFactory & | msg_factory () |
|
static google::protobuf::DescriptorPool & | user_descriptor_pool () |
|
static google::protobuf::SimpleDescriptorDatabase & | simple_database () |
|
template<typename ReturnType , typename... Args1, typename... Args2> |
static ReturnType | msg_factory_call (ReturnType(google::protobuf::DynamicMessageFactory::*func)(Args1...) const, Args2... args) |
|
template<typename ReturnType , typename... Args1, typename... Args2> |
static ReturnType | user_descriptor_pool_call (ReturnType(google::protobuf::DescriptorPool::*func)(Args1...) const, Args2... args) |
|
template<typename ReturnType , typename... Args1, typename... Args2> |
static ReturnType | simple_database_call (ReturnType(google::protobuf::SimpleDescriptorDatabase::*func)(Args1...) const, Args2... args) |
|
Helper class for creating google::protobuf::Message objects that are not statically compiled into the application.
Definition at line 46 of file dynamic_protobuf_manager.h.
const google::protobuf::FileDescriptor * dccl::DynamicProtobufManager::load_from_proto_file |
( |
const std::string & |
protofile_absolute_path | ) |
|
|
static |
Load a message from a .proto file on the disk. enable_compilation() must be called first.
- Parameters
-
protofile_absolute_path | It is critical that the argument be the absolute, canonical path to the file. (No relative paths and no "." or "..") This could be achieved, e.g., by using Boost filesystem as follows... boost::filesystem::path abs_path = boost::filesystem::complete(rel_path);
abs_path.normalize();
|
- Exceptions
-
It is critical that the argument be the absolute, canonical path to the file. This could be achieved, e.g., by using Boost filesystem as follows... boost::filesystem::path abs_path = boost::filesystem::complete(rel_path); abs_path.normalize();
Definition at line 112 of file dynamic_protobuf_manager.cpp.