Viam C++ SDK current
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
viam::sdk::Registry Class Reference

A registry of known resources. More...

#include <registry.hpp>

Static Public Member Functions

static void register_model (std::shared_ptr< const ModelRegistration > resource)
 Registers a resource with the Registry.
 
static std::shared_ptr< const ModelRegistrationlookup_model (const std::string &name)
 Lookup a given registered resource.
 
static std::shared_ptr< const ModelRegistrationlookup_model (const API &api, const Model &model)
 Lookup a given registered resource.
 
template<typename ResourceClientT >
static void register_resource_client ()
 Register a resource client constructor.
 
template<typename ResourceServerT >
static void register_resource_server ()
 Register a resource server constructor.
 
template<typename ResourceClientT , typename ResourceServerT >
static void register_resource ()
 Register resource client and server constructors.
 
static std::shared_ptr< const ResourceServerRegistrationlookup_resource_server (const API &api)
 Lookup a registered server api.
 
static std::shared_ptr< const ResourceClientRegistrationlookup_resource_client (const API &api)
 Lookup a registered client api.
 
static const std::unordered_map< std::string, std::shared_ptr< const ModelRegistration > > & registered_models ()
 Provide information on registered resource models.
 
static const std::unordered_map< API, std::shared_ptr< const ResourceServerRegistration > > & registered_resource_servers ()
 Provide access to registered resources.
 
static void initialize ()
 Initialized the Viam registry. No-op if it has already been called.
 

Detailed Description

A registry of known resources.

Member Function Documentation

◆ lookup_model() [1/2]

static std::shared_ptr< const ModelRegistration > viam::sdk::Registry::lookup_model ( const API & api,
const Model & model )
static

Lookup a given registered resource.

Parameters
apiThe api of the resource to lookup.
modelThe model of the resource to lookup.
Returns
a shared_ptr to the resource's registration data.

◆ lookup_model() [2/2]

static std::shared_ptr< const ModelRegistration > viam::sdk::Registry::lookup_model ( const std::string & name)
static

Lookup a given registered resource.

Parameters
nameThe name of the resource to lookup.
Returns
a shared_ptr to the resource's registration data.

◆ lookup_resource_client()

static std::shared_ptr< const ResourceClientRegistration > viam::sdk::Registry::lookup_resource_client ( const API & api)
static

Lookup a registered client api.

Parameters
apiThe api to lookup.
Returns
A shared_ptr to the registered api's ResourceClientRegistration.

◆ lookup_resource_server()

static std::shared_ptr< const ResourceServerRegistration > viam::sdk::Registry::lookup_resource_server ( const API & api)
static

Lookup a registered server api.

Parameters
apiThe api to lookup.
Returns
A shared_ptr to the registered api's ResourceServerRegistration.

◆ register_model()

static void viam::sdk::Registry::register_model ( std::shared_ptr< const ModelRegistration > resource)
static

Registers a resource with the Registry.

Parameters
resourceAn object containing resource registration information.
Exceptions
`Exception`if the resource has already been registered.

◆ registered_models()

static const std::unordered_map< std::string, std::shared_ptr< const ModelRegistration > > & viam::sdk::Registry::registered_models ( )
static

Provide information on registered resource models.

Returns
A map from name to ModelRegistration of all registered resource models.

◆ registered_resource_servers()

static const std::unordered_map< API, std::shared_ptr< const ResourceServerRegistration > > & viam::sdk::Registry::registered_resource_servers ( )
static

Provide access to registered resources.

Returns
A map from API to ResourceServerRegistration of all registered resources.

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