|
The IceManager class provides simplified access to commonly used Ice features. More...
#include <ArmarXCore/core/IceManager.h>
Classes | |
struct | Impl |
struct | ObjectEntry |
Public Member Functions | |
void | destroy () |
Destroys the communicator. More... | |
const Ice::CommunicatorPtr & | getCommunicator () |
Short helper method to return the Ice Communicator. More... | |
IceGrid::RegistryPrx | getIceGridRegistry () |
Provides access to the IceGrid Registry. More... | |
const armarx::IceGridAdminPtr & | getIceGridSession () |
Provides access to the IceGrid AdminSession via IceGridAdmin. More... | |
template<class ProxyType > | |
ProxyType | getProxy (const std::string &name, const std::string &endpoints=std::string()) |
Retrieves a proxy object. More... | |
template<class TopicProxy > | |
TopicProxy | getTopic (const std::string &topicName, bool useUDP=false) |
Gets an Ice Storm topic for publishing messages. More... | |
IceStorm::TopicManagerPrx | getTopicManager () |
Provides access to the Ice Storm Topic Manager. More... | |
std::string | getTopicSuffix () const |
Get the suffix that is appended to all topics. More... | |
IceManager (const Ice::CommunicatorPtr &communicator, std::string name="", const std::string topicSuffix="") | |
Set up an instance of this class with a preexisting communicator. More... | |
bool | isObjectReachable (std::string objectName) |
creates a proxy to the object specified with parameter objectName and tries to ping it. More... | |
template<typename ProxyType > | |
bool | isObjectReachable (std::string objectName) |
creates a proxy to the object specified with parameter objectName and tries to ping it. More... | |
bool | isShutdown () |
Determines whether the communicator is shutdown. More... | |
void | registerAndSubscribeTopic (Ice::ObjectPtr subscriber, const std::string &topicName, bool orderedPublishing=false) |
void | registerDelayedTopicRetrieval (const std::string ®istrantName, const std::string &topicName) |
Registers a delayed topic retrieval. More... | |
void | registerDelayedTopicSubscription (const std::string ®istrantName, const std::string &topicName) |
Registers a delayed topic subscription. More... | |
ObjectHandles | registerObject (const Ice::ObjectPtr &object, const std::string &objectName, const Ice::ObjectAdapterPtr &adapterToAddTo=nullptr) |
Register an object with Ice for being accessed through IceGrid. More... | |
void | registerObjectDependency (const std::string ®istrantName, const std::string &dependencyObjectName) |
Registers a specified object that is required before activating the endpoints. More... | |
void | removeObject (const std::string &objectName) |
Removes an object from the IceGrid. More... | |
bool | removeProxyFromCache (const Ice::ObjectPrx &proxy) |
This functions removes the given proxy from the proxy cache. More... | |
template<class ProxyType > | |
bool | removeProxyFromCache (const std::string &name, const std::string &endpoints=std::string()) |
This functions removes the given proxy from the proxy cache. More... | |
bool | removeProxyFromCache (const std::string &name, const std::string &typeName, const std::string &endpoints=std::string()) |
void | setName (std::string name) |
Sets the session name. More... | |
void | shutdown () |
Removes all component objects and topics and shuts down the communicator. More... | |
void | subscribeTopic (Ice::ObjectPrx subscriber, const std::string &topicName, bool orderedPublishing=false) |
Subscribe an object to a particular Ice Storm topic. More... | |
void | throwUserException (std::string const &message) |
void | unsubscribeTopic (Ice::ObjectPrx subscriberProxy, const std::string &topicName) |
Unsubscribe a given subscriber from a given topic. More... | |
void | waitForShutdown () |
Waits until all invoked operation has been processed. More... | |
~IceManager () override | |
Public Member Functions inherited from Logging | |
SpamFilterDataPtr | deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const |
disables the logging for the current line for the given amount of seconds. More... | |
MessageTypeT | getEffectiveLoggingLevel () const |
Logging () | |
void | setLocalMinimumLoggingLevel (MessageTypeT level) |
With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More... | |
void | setTag (const LogTag &tag) |
void | setTag (const std::string &tagName) |
virtual | ~Logging () |
Static Public Member Functions | |
static IceStorm::TopicManagerPrx | GetTopicManager (Ice::CommunicatorPtr communicator) |
Friends | |
class | Component |
Additional Inherited Members | |
Protected Member Functions inherited from Logging | |
bool | checkLogLevel (MessageTypeT level) const |
const LogSenderPtr & | getLogSender () const |
Retrieve log sender. More... | |
LogSenderPtr | loghelper (const char *file, int line, const char *function) const |
Protected Attributes inherited from Logging | |
MessageTypeT | minimumLoggingLevel |
SpamFilterDataPtr | spamFilter |
LogTag | tag |
The IceManager class provides simplified access to commonly used Ice features.
Definition at line 106 of file IceManager.h.
IceManager | ( | const Ice::CommunicatorPtr & | communicator, |
std::string | name = "" , |
||
const std::string | topicSuffix = "" |
||
) |
Set up an instance of this class with a preexisting communicator.
This is useful for creating an instance from within an Ice::Application. If you do not have a communicator yet you can use one of the static factory methods instead.
communicator | An Ice communicator |
name | A unique name, e.g. the base component's name. This name is used to create IceGridObservers, which must have a unique name. |
topicSuffix | Suffix appended to all topic names. |
Definition at line 59 of file IceManager.cpp.
|
override |
void destroy | ( | ) |
Destroys the communicator.
Definition at line 409 of file IceManager.cpp.
const Ice::CommunicatorPtr & getCommunicator | ( | ) |
Short helper method to return the Ice Communicator.
Uses static communicator() method
Definition at line 639 of file IceManager.cpp.
IceGrid::RegistryPrx getIceGridRegistry | ( | ) |
Provides access to the IceGrid Registry.
A proxy is created if necessary.
Definition at line 658 of file IceManager.cpp.
const IceGridAdminPtr & getIceGridSession | ( | ) |
Provides access to the IceGrid AdminSession via IceGridAdmin.
Definition at line 645 of file IceManager.cpp.
|
inline |
Retrieves a proxy object.
name | Proxy name, e.g. Log |
endpoints | The endpoints, e.g. tcp ‑p 10002 |
Definition at line 162 of file IceManager.h.
|
inline |
Gets an Ice Storm topic for publishing messages.
topicName | The name of the topic to publish on. |
Definition at line 258 of file IceManager.h.
IceStorm::TopicManagerPrx getTopicManager | ( | ) |
Provides access to the Ice Storm Topic Manager.
A proxy is created if necessary.
Definition at line 251 of file IceManager.cpp.
|
static |
std::string getTopicSuffix | ( | ) | const |
Get the suffix that is appended to all topics.
Definition at line 419 of file IceManager.cpp.
bool isObjectReachable | ( | std::string | objectName | ) |
creates a proxy to the object specified with parameter objectName and tries to ping it.
objectName | Name of the object that should be checked |
Definition at line 684 of file IceManager.cpp.
bool isObjectReachable | ( | std::string | objectName | ) |
creates a proxy to the object specified with parameter objectName and tries to ping it.
objectName | Name of the object that should be checked |
Definition at line 494 of file IceManager.h.
bool isShutdown | ( | ) |
Determines whether the communicator is shutdown.
Definition at line 403 of file IceManager.cpp.
void registerAndSubscribeTopic | ( | Ice::ObjectPtr | subscriber, |
const std::string & | topicName, | ||
bool | orderedPublishing = false |
||
) |
void registerDelayedTopicRetrieval | ( | const std::string & | registrantName, |
const std::string & | topicName | ||
) |
Registers a delayed topic retrieval.
registrantName | Registrant object name |
topicName | The topic name |
Definition at line 598 of file IceManager.cpp.
void registerDelayedTopicSubscription | ( | const std::string & | registrantName, |
const std::string & | topicName | ||
) |
Registers a delayed topic subscription.
registrantName | Registrant object name |
topicName | The topic name that should be subscribed later on |
Definition at line 586 of file IceManager.cpp.
ObjectHandles registerObject | ( | const Ice::ObjectPtr & | object, |
const std::string & | objectName, | ||
const Ice::ObjectAdapterPtr & | adapterToAddTo = nullptr |
||
) |
Register an object with Ice for being accessed through IceGrid.
object | The object to be registered, implementing an Ice interface. |
objectName | The name this object should be available as. |
Definition at line 99 of file IceManager.cpp.
void registerObjectDependency | ( | const std::string & | registrantName, |
const std::string & | dependencyObjectName | ||
) |
Registers a specified object that is required before activating the endpoints.
registrantName | Object that has a dependency |
dependecyObjectName | Dependecy object name |
ObjectAlreadyActiveException |
Definition at line 495 of file IceManager.cpp.
void removeObject | ( | const std::string & | objectName | ) |
Removes an object from the IceGrid.
objectName | The name of the object that should be removed |
Definition at line 145 of file IceManager.cpp.
bool removeProxyFromCache | ( | const Ice::ObjectPrx & | proxy | ) |
This functions removes the given proxy from the proxy cache.
This is useful if the cached proxy became invalid.
name | Proxy name, e.g. Log |
endpoints | The endpoints, e.g. tcp ‑p 10002 |
Definition at line 233 of file IceManager.cpp.
|
inline |
This functions removes the given proxy from the proxy cache.
This is useful if the cached proxy became invalid.
name | Proxy name, e.g. Log |
endpoints | The endpoints, e.g. tcp ‑p 10002 |
Definition at line 222 of file IceManager.h.
bool removeProxyFromCache | ( | const std::string & | name, |
const std::string & | typeName, | ||
const std::string & | endpoints = std::string() |
||
) |
Definition at line 215 of file IceManager.cpp.
void setName | ( | std::string | name | ) |
Sets the session name.
Definition at line 633 of file IceManager.cpp.
void shutdown | ( | ) |
Removes all component objects and topics and shuts down the communicator.
Definition at line 389 of file IceManager.cpp.
void subscribeTopic | ( | Ice::ObjectPrx | subscriber, |
const std::string & | topicName, | ||
bool | orderedPublishing = false |
||
) |
Subscribe an object to a particular Ice Storm topic.
If the object is already subscribed to the topic, it will be unsubscribed before. This is necessary to circumvent the usage from outdated subscriptions due to unproper exits.
subcriber | A proxy of the object to be subscribed, implementing the interface for listening on this topic |
topicName | The topic's name |
orderedPublishing | If true, the order of topic calls is ensured. This might decrease performance. |
Definition at line 271 of file IceManager.cpp.
void throwUserException | ( | std::string const & | message | ) |
void unsubscribeTopic | ( | Ice::ObjectPrx | subscriberProxy, |
const std::string & | topicName | ||
) |
Unsubscribe a given subscriber from a given topic.
subscriberProxy | of the subscriber |
topicName | The name of the subscribed topic. |
Definition at line 318 of file IceManager.cpp.
void waitForShutdown | ( | ) |
Waits until all invoked operation has been processed.
Definition at line 397 of file IceManager.cpp.
|
friend |
Definition at line 110 of file IceManager.h.