|
|
The memory name system (MNS) client. More...
#include <RobotAPI/libraries/armem/client/MemoryNameSystem.h>
Inheritance diagram for MemoryNameSystem:Public Member Functions | |
| std::map< std::string, Configurator > | getAllConfigurators () const |
| Get Configurators for all registered servers (without updating). | |
| std::map< std::string, Configurator > | getAllConfigurators (bool update=true) |
| Get Configurators for all registered servers. | |
| std::map< std::string, Loader > | getAllLoaders () const |
| Get Loaders for all registered servers (without updating). | |
| std::map< std::string, Loader > | getAllLoaders (bool update=true) |
| Get Loaders for all registered servers. | |
| std::map< std::string, Reader > | getAllReaders () const |
| Get Readers for all registered servers (without updating). | |
| std::map< std::string, Reader > | getAllReaders (bool update=true) |
| Get Readers for all registered servers. | |
| std::map< std::string, Writer > | getAllWriters () const |
| Get Writers for all registered servers (without updating). | |
| std::map< std::string, Writer > | getAllWriters (bool update=true) |
| Get Writers for all registered servers. | |
| Configurator | getConfigurator (const MemoryID &memoryID) |
| Get a configurator to the given memory name. | |
| Loader | getLoader (const MemoryID &memoryID) |
| mns::MemoryNameSystemInterfacePrx | getMemoryNameSystem () const |
| void | getMemoryNameSystem (mns::MemoryNameSystemInterfacePrx mns) |
| Reader | getReader (const MemoryID &memoryID) |
| Get a reader to the given memory name. | |
| Writer | getWriter (const MemoryID &memoryID) |
| Get a writer to the given memory name. | |
| void | initialize (mns::MemoryNameSystemInterfacePrx mns, ManagedIceObject *component=nullptr) |
| MemoryNameSystem () | |
| MemoryNameSystem (mns::MemoryNameSystemInterfacePrx mns, ManagedIceObject *component=nullptr) | |
| Construct an MNS client. | |
| operator bool () const | |
| Indicate whether the proxy is set. | |
| void | registerServer (const MemoryID &memoryID, mns::dto::MemoryServerInterfaces server) |
| Register a memory server in the MNS. | |
| void | removeServer (const MemoryID &memoryID) |
| Remove a memory server from the MNS. | |
| std::optional< wm::EntityInstance > | resolveEntityInstance (const MemoryID &id) |
| Resolve a memory ID to an EntityInstance. | |
| std::map< MemoryID, wm::EntityInstance > | resolveEntityInstances (const std::vector< MemoryID > &ids) |
| mns::dto::MemoryServerInterfaces | resolveServer (const MemoryID &memoryID) |
| Resolve the given memory server for the given memory ID. | |
| void | setComponent (ManagedIceObject *component) |
| void | update () |
| Update the internal registry to the data in the MNS. | |
| Configurator | useConfigurator (const MemoryID &memoryID) |
| Use a memory server and get a configurator for it. | |
| Configurator | useConfigurator (const MemoryID &memoryID, ManagedIceObject &component) |
| Configurator | useConfigurator (const std::string &memoryName) |
| Configurator | useConfigurator (const std::string &memoryName, ManagedIceObject &component) |
| Loader | useLoader (const MemoryID &memoryID) |
| Use a memory server and get a configurator for it. | |
| Loader | useLoader (const MemoryID &memoryID, ManagedIceObject &component) |
| Loader | useLoader (const std::string &memoryName) |
| Loader | useLoader (const std::string &memoryName, ManagedIceObject &component) |
| Reader | useReader (const MemoryID &memoryID) |
| Use a memory server and get a reader for it. | |
| Reader | useReader (const MemoryID &memoryID, ManagedIceObject &component) |
| Reader | useReader (const std::string &memoryName) |
| Reader | useReader (const std::string &memoryName, ManagedIceObject &component) |
| Writer | useWriter (const MemoryID &memoryID) |
| Use a memory server and get a writer for it. | |
| Writer | useWriter (const MemoryID &memoryID, ManagedIceObject &component) |
| Writer | useWriter (const std::string &memoryName) |
| Writer | useWriter (const std::string &memoryName, ManagedIceObject &component) |
Public Member Functions inherited from MemoryListener | |
| MemoryListener (ManagedIceObject *component=nullptr) | |
| void | setComponent (ManagedIceObject *component) |
| SubscriptionHandle | subscribe (const MemoryID &subscriptionID, Callback Callback) |
| SubscriptionHandle | subscribe (const MemoryID &subscriptionID, CallbackUpdatedOnly Callback) |
| template<class CalleeT> | |
| SubscriptionHandle | subscribe (const MemoryID &subscriptionID, CalleeT *callee, MemberCallback< CalleeT > callback) |
| Subscribe with a class member function: | |
| template<class CalleeT> | |
| SubscriptionHandle | subscribe (const MemoryID &subscriptionID, CalleeT *callee, MemberCallbackUpdatedOnly< CalleeT > callback) |
| void | unsubscribe (SubscriptionHandle &subscriptionHandle) |
| void | updated (const std::vector< data::MemoryID > &updatedIDs) const |
| void | updated (const std::vector< MemoryID > &updatedIDs) const |
| Function handling updates from the MemoryListener ice topic. | |
Additional Inherited Members | |
Public Types inherited from MemoryListener | |
| using | Callback |
| using | CallbackUpdatedOnly |
| template<class CalleeT> | |
| using | MemberCallback |
| template<class CalleeT> | |
| using | MemberCallbackUpdatedOnly |
Static Public Member Functions inherited from MemoryListener | |
| static std::string | MakeMemoryTopicName (const MemoryID &memoryID) |
Protected Attributes inherited from MemoryListener | |
| std::unordered_map< MemoryID, std::vector< ManagedCallback > > | callbacks |
| std::unordered_map< std::string, int > | memoryRefCount |
| memoryName -> callbacks needing memory topic | |
| long | nextId = 0 |
| std::mutex | subscribeMutex |
The memory name system (MNS) client.
This client class serves provides the MNS interface and is a local cache of the MNS registry. It can be used to resolve memory servers by their memory ID and to construct client::Readers and client::Writers.
During server resolution, it first consults the locally cached registry. If the memory server is not known locally, the local registry is updated to that of the remote MNS before trying again.
In addition, the MNS client can be used to send queries over multiple memory servers, as well as retrieving the data for arbitrary entity or entity snapshot IDs.
Definition at line 73 of file MemoryNameSystem.h.
| MemoryNameSystem | ( | ) |
Definition at line 31 of file MemoryNameSystem.cpp.
| MemoryNameSystem | ( | mns::MemoryNameSystemInterfacePrx | mns, |
| ManagedIceObject * | component = nullptr ) |
Construct an MNS client.
| mns | The MNS proxy. |
| component | The owning component. When using a memory server, dependencies will be added to this component. |
Definition at line 35 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| std::map< std::string, Configurator > getAllConfigurators | ( | ) | const |
Get Configurators for all registered servers (without updating).
Definition at line 424 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| std::map< std::string, Configurator > getAllConfigurators | ( | bool | update = true | ) |
Get Configurators for all registered servers.
| update | If true, perform an update first. |
Definition at line 413 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| std::map< std::string, Loader > getAllLoaders | ( | ) | const |
Get Loaders for all registered servers (without updating).
Definition at line 407 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| std::map< std::string, Loader > getAllLoaders | ( | bool | update = true | ) |
Get Loaders for all registered servers.
| update | If true, perform an update first. |
Definition at line 396 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| std::map< std::string, Reader > getAllReaders | ( | ) | const |
Get Readers for all registered servers (without updating).
Definition at line 441 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| std::map< std::string, Reader > getAllReaders | ( | bool | update = true | ) |
Get Readers for all registered servers.
| update | If true, perform an update first. |
Definition at line 430 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| std::map< std::string, Writer > getAllWriters | ( | ) | const |
Get Writers for all registered servers (without updating).
Definition at line 487 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| std::map< std::string, Writer > getAllWriters | ( | bool | update = true | ) |
Get Writers for all registered servers.
| update | If true, perform an update first. |
Definition at line 477 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| Configurator getConfigurator | ( | const MemoryID & | memoryID | ) |
Get a configurator to the given memory name.
| memoryID | The memory ID. |
| `error::CouldNotResolveMemoryServer` | If the memory name could not be resolved. |
Definition at line 228 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| mns::MemoryNameSystemInterfacePrx getMemoryNameSystem | ( | ) | const |
Definition at line 617 of file MemoryNameSystem.cpp.
| void getMemoryNameSystem | ( | mns::MemoryNameSystemInterfacePrx | mns | ) |
Definition at line 623 of file MemoryNameSystem.cpp.
Get a reader to the given memory name.
| memoryID | The memory ID. |
| `error::CouldNotResolveMemoryServer` | If the memory name could not be resolved. |
Definition at line 294 of file MemoryNameSystem.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Get a writer to the given memory name.
| memoryID | The memory ID. |
| `error::CouldNotResolveMemoryServer` | If the memory name could not be resolved. |
Definition at line 447 of file MemoryNameSystem.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void initialize | ( | mns::MemoryNameSystemInterfacePrx | mns, |
| ManagedIceObject * | component = nullptr ) |
|
inline |
Indicate whether the proxy is set.
Definition at line 278 of file MemoryNameSystem.h.
| void registerServer | ( | const MemoryID & | memoryID, |
| mns::dto::MemoryServerInterfaces | server ) |
Register a memory server in the MNS.
| memoryID | The memoryID. |
| server | The memory server proxy. |
| `error::ServerRegistrationOrRemovalFailed` | If the registration failed. |
Definition at line 581 of file MemoryNameSystem.cpp.
| void removeServer | ( | const MemoryID & | memoryID | ) |
Remove a memory server from the MNS.
| memoryID | The memoryID. |
| `error::ServerRegistrationOrRemovalFailed` | If the removal failed. |
Definition at line 603 of file MemoryNameSystem.cpp.
| std::optional< wm::EntityInstance > resolveEntityInstance | ( | const MemoryID & | id | ) |
Resolve a memory ID to an EntityInstance.
The ID can refer to an entity, an entity snapshot, or an entity instance. When not referring to an entity instance, the latest snapshot and first instance will be queried.
| id | The entity, snapshot or instance ID. |
Definition at line 493 of file MemoryNameSystem.cpp.
Here is the call graph for this function:| std::map< MemoryID, wm::EntityInstance > resolveEntityInstances | ( | const std::vector< MemoryID > & | ids | ) |
Definition at line 507 of file MemoryNameSystem.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| mns::dto::MemoryServerInterfaces resolveServer | ( | const MemoryID & | memoryID | ) |
Resolve the given memory server for the given memory ID.
| memoryID | The memory ID. |
| `error::CouldNotResolveMemoryServer` | If the memory name could not be resolved. |
Definition at line 145 of file MemoryNameSystem.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void setComponent | ( | ManagedIceObject * | component | ) |
Definition at line 629 of file MemoryNameSystem.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void update | ( | ) |
Update the internal registry to the data in the MNS.
| `error::MemoryNameSystemQueryFailed` | If the call to the MNS failed. |
Definition at line 49 of file MemoryNameSystem.cpp.
Here is the caller graph for this function:| Configurator useConfigurator | ( | const MemoryID & | memoryID | ) |
Use a memory server and get a configurator for it.
Definition at line 235 of file MemoryNameSystem.cpp.
Here is the caller graph for this function:| Configurator useConfigurator | ( | const MemoryID & | memoryID, |
| ManagedIceObject & | component ) |
Definition at line 242 of file MemoryNameSystem.cpp.
| Configurator useConfigurator | ( | const std::string & | memoryName | ) |
| Configurator useConfigurator | ( | const std::string & | memoryName, |
| ManagedIceObject & | component ) |
Use a memory server and get a configurator for it.
Definition at line 268 of file MemoryNameSystem.cpp.
Here is the caller graph for this function:| Loader useLoader | ( | const MemoryID & | memoryID, |
| ManagedIceObject & | component ) |
Definition at line 275 of file MemoryNameSystem.cpp.
| Loader useLoader | ( | const std::string & | memoryName | ) |
| Loader useLoader | ( | const std::string & | memoryName, |
| ManagedIceObject & | component ) |
Use a memory server and get a reader for it.
Definition at line 301 of file MemoryNameSystem.cpp.
Here is the caller graph for this function:| Reader useReader | ( | const MemoryID & | memoryID, |
| ManagedIceObject & | component ) |
Definition at line 308 of file MemoryNameSystem.cpp.
| Reader useReader | ( | const std::string & | memoryName | ) |
| Reader useReader | ( | const std::string & | memoryName, |
| ManagedIceObject & | component ) |
Use a memory server and get a writer for it.
Definition at line 453 of file MemoryNameSystem.cpp.
Here is the caller graph for this function:| Writer useWriter | ( | const MemoryID & | memoryID, |
| ManagedIceObject & | component ) |
Definition at line 459 of file MemoryNameSystem.cpp.
| Writer useWriter | ( | const std::string & | memoryName | ) |
| Writer useWriter | ( | const std::string & | memoryName, |
| ManagedIceObject & | component ) |