Defines the gRPC receiving logic for a module. C++ module authors can construct a ModuleService and use its associated methods to write a working C++ module. See examples under src/viam/examples/modules.
More...
#include <service.hpp>
|
| | ModuleService (std::string addr) |
| | Creates a new ModuleService that can serve on the provided socket.
|
| |
| | ModuleService (std::string addr, std::string grpc_conn_protocol) |
| | Creates a new ModuleService that can serve on the provided socket.
|
| |
| | ModuleService (int argc, char **argv, const std::vector< std::shared_ptr< ModelRegistration > > ®istrations) |
| | Creates a new ModuleService. Socket path and log level will be inferred from passed in command line arguments, and passed in model registrations will be registered and added to module.
|
| |
|
void | serve () |
| | Starts module. serve will return when SIGINT or SIGTERM is received (this happens when the RDK shuts down).
|
| |
| void | add_model_from_registry (API api, Model model) |
| | Adds an API/model pair to the module; both the API and model should have already been registered. If the ModuleService was constructed with a vector of ModelRegistration, the passed in models will already be registered and added.
|
| |
Defines the gRPC receiving logic for a module. C++ module authors can construct a ModuleService and use its associated methods to write a working C++ module. See examples under src/viam/examples/modules.
◆ ModuleService() [1/3]
| viam::sdk::ModuleService::ModuleService |
( |
std::string | addr | ) |
|
|
explicit |
Creates a new ModuleService that can serve on the provided socket.
- Parameters
-
| addr | Address of socket to serve on. |
◆ ModuleService() [2/3]
| viam::sdk::ModuleService::ModuleService |
( |
std::string | addr, |
|
|
std::string | grpc_conn_protocol ) |
|
explicit |
Creates a new ModuleService that can serve on the provided socket.
- Parameters
-
| addr | Address of socket to serve on. |
| grpc_conn_protocol | The protocol to connect with (UDS or TCP) |
◆ ModuleService() [3/3]
| viam::sdk::ModuleService::ModuleService |
( |
int | argc, |
|
|
char ** | argv, |
|
|
const std::vector< std::shared_ptr< ModelRegistration > > & | registrations ) |
|
explicit |
Creates a new ModuleService. Socket path and log level will be inferred from passed in command line arguments, and passed in model registrations will be registered and added to module.
- Parameters
-
| argc | Number of arguments from command line. |
| argv | Arguments from command line. |
| registrations | Models to register and add to the module. |
◆ add_model_from_registry()
| void viam::sdk::ModuleService::add_model_from_registry |
( |
API | api, |
|
|
Model | model ) |
Adds an API/model pair to the module; both the API and model should have already been registered. If the ModuleService was constructed with a vector of ModelRegistration, the passed in models will already be registered and added.
- Parameters
-
| api | The API to add. |
| model | The model to add. |
The documentation for this class was generated from the following file: