IceManager Class Reference

The IceManager class provides simplified access to commonly used Ice features. More...

#include <ArmarXCore/core/IceManager.h>

+ Inheritance diagram for IceManager:

Classes

struct  Impl
 
struct  ObjectEntry
 

Public Member Functions

void destroy ()
 Destroys the communicator.
 
const Ice::CommunicatorPtr & getCommunicator ()
 Short helper method to return the Ice Communicator.
 
IceGrid::RegistryPrx getIceGridRegistry ()
 Provides access to the IceGrid Registry.
 
const armarx::IceGridAdminPtr & getIceGridSession ()
 Provides access to the IceGrid AdminSession via IceGridAdmin.
 
template<class ProxyType>
ProxyType getProxy (const std::string &name, const std::string &endpoints=std::string())
 Retrieves a proxy object.
 
template<class TopicProxy>
TopicProxy getTopic (const std::string &topicName, bool useUDP=false)
 Gets an Ice Storm topic for publishing messages.
 
IceStorm::TopicManagerPrx getTopicManager ()
 Provides access to the Ice Storm Topic Manager.
 
std::string getTopicSuffix () const
 Get the suffix that is appended to all topics.
 
 IceManager (const Ice::CommunicatorPtr &communicator, std::string name="", const std::string topicSuffix="")
 Set up an instance of this class with a preexisting communicator.
 
bool isObjectReachable (std::string objectName)
 creates a proxy to the object specified with parameter objectName and tries to ping it.
 
template<typename ProxyType>
bool isObjectReachable (std::string objectName)
 creates a proxy to the object specified with parameter objectName and tries to ping it.
 
bool isShutdown ()
 Determines whether the communicator is shutdown.
 
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.
 
void registerDelayedTopicSubscription (const std::string &registrantName, const std::string &topicName)
 Registers a delayed topic subscription.
 
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.
 
void registerObjectDependency (const std::string &registrantName, const std::string &dependencyObjectName)
 Registers a specified object that is required before activating the endpoints.
 
void removeObject (const std::string &objectName)
 Removes an object from the IceGrid.
 
bool removeProxyFromCache (const Ice::ObjectPrx &proxy)
 This functions removes the given proxy from the proxy cache.
 
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.
 
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.
 
void shutdown ()
 Removes all component objects and topics and shuts down the communicator.
 
void subscribeTopic (Ice::ObjectPrx subscriber, const std::string &topicName, bool orderedPublishing=false)
 Subscribe an object to a particular Ice Storm topic.
 
void throwUserException (std::string const &message)
 
void unsubscribeTopic (Ice::ObjectPrx subscriberProxy, const std::string &topicName)
 Unsubscribe a given subscriber from a given topic.
 
void waitForShutdown ()
 Waits until all invoked operation has been processed.
 
 ~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.
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set.
 
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.
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 
- Protected Attributes inherited from Logging
MessageTypeT minimumLoggingLevel
 
SpamFilterDataPtr spamFilter
 
LogTag tag
 

Detailed Description

The IceManager class provides simplified access to commonly used Ice features.

See also
Logging

Constructor & Destructor Documentation

◆ IceManager()

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.

Parameters
communicatorAn Ice communicator
nameA unique name, e.g. the base component's name. This name is used to create IceGridObservers, which must have a unique name.
topicSuffixSuffix appended to all topic names.

◆ ~IceManager()

~IceManager ( )
override

Member Function Documentation

◆ destroy()

void destroy ( )

Destroys the communicator.

◆ getCommunicator()

const Ice::CommunicatorPtr & getCommunicator ( )

Short helper method to return the Ice Communicator.

Uses static communicator() method

◆ getIceGridRegistry()

IceGrid::RegistryPrx getIceGridRegistry ( )

Provides access to the IceGrid Registry.

A proxy is created if necessary.

Returns
A proxy of the IceGrid Registy.

◆ getIceGridSession()

const IceGridAdminPtr & getIceGridSession ( )

Provides access to the IceGrid AdminSession via IceGridAdmin.

Returns
The IceGrid AdminSession.

◆ getProxy()

template<class ProxyType>
ProxyType getProxy ( const std::string & name,
const std::string & endpoints = std::string() )
inline

Retrieves a proxy object.

Parameters
nameProxy name, e.g. Log
endpointsThe endpoints, e.g. tcp ‑p 10002
Returns
A proxy of the remote instance.

◆ getTopic()

template<class TopicProxy>
TopicProxy getTopic ( const std::string & topicName,
bool useUDP = false )
inline

Gets an Ice Storm topic for publishing messages.

Parameters
topicNameThe name of the topic to publish on.
Returns
A proxy of the topic's remote instance.

◆ GetTopicManager()

IceStorm::TopicManagerPrx GetTopicManager ( Ice::CommunicatorPtr communicator)
static

◆ getTopicManager()

IceStorm::TopicManagerPrx getTopicManager ( )

Provides access to the Ice Storm Topic Manager.

A proxy is created if necessary.

Returns
A proxy of the IceStorm TopicManager.

◆ getTopicSuffix()

std::string getTopicSuffix ( ) const

Get the suffix that is appended to all topics.

◆ isObjectReachable() [1/2]

bool isObjectReachable ( std::string objectName)

creates a proxy to the object specified with parameter objectName and tries to ping it.

Parameters
objectNameName of the object that should be checked
Returns
true, if reachable

◆ isObjectReachable() [2/2]

template<typename ProxyType>
bool isObjectReachable ( std::string objectName)

creates a proxy to the object specified with parameter objectName and tries to ping it.

Parameters
objectNameName of the object that should be checked
Returns
true, if reachable

◆ isShutdown()

bool isShutdown ( )

Determines whether the communicator is shutdown.

◆ registerAndSubscribeTopic()

void registerAndSubscribeTopic ( Ice::ObjectPtr subscriber,
const std::string & topicName,
bool orderedPublishing = false )

◆ registerDelayedTopicRetrieval()

void registerDelayedTopicRetrieval ( const std::string & registrantName,
const std::string & topicName )

Registers a delayed topic retrieval.

Parameters
registrantNameRegistrant object name
topicNameThe topic name

◆ registerDelayedTopicSubscription()

void registerDelayedTopicSubscription ( const std::string & registrantName,
const std::string & topicName )

Registers a delayed topic subscription.

Parameters
registrantNameRegistrant object name
topicNameThe topic name that should be subscribed later on

◆ registerObject()

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.

Parameters
objectThe object to be registered, implementing an Ice interface.
objectNameThe name this object should be available as.
Returns
The registered object proxy.

◆ registerObjectDependency()

void registerObjectDependency ( const std::string & registrantName,
const std::string & dependencyObjectName )

Registers a specified object that is required before activating the endpoints.

Parameters
registrantNameObject that has a dependency
dependecyObjectNameDependecy object name
Exceptions
ObjectAlreadyActiveException

◆ removeObject()

void removeObject ( const std::string & objectName)

Removes an object from the IceGrid.

Parameters
objectNameThe name of the object that should be removed

◆ removeProxyFromCache() [1/3]

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.

Parameters
nameProxy name, e.g. Log
endpointsThe endpoints, e.g. tcp ‑p 10002
Returns
True, if the proxy was found and removed.

◆ removeProxyFromCache() [2/3]

template<class ProxyType>
bool removeProxyFromCache ( const std::string & name,
const std::string & endpoints = std::string() )
inline

This functions removes the given proxy from the proxy cache.

This is useful if the cached proxy became invalid.

Parameters
nameProxy name, e.g. Log
endpointsThe endpoints, e.g. tcp ‑p 10002
Returns
True, if the proxy was found and removed.

◆ removeProxyFromCache() [3/3]

bool removeProxyFromCache ( const std::string & name,
const std::string & typeName,
const std::string & endpoints = std::string() )

◆ setName()

void setName ( std::string name)

Sets the session name.

◆ shutdown()

void shutdown ( )

Removes all component objects and topics and shuts down the communicator.

◆ subscribeTopic()

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.

Parameters
subcriberA proxy of the object to be subscribed, implementing the interface for listening on this topic
topicNameThe topic's name
orderedPublishingIf true, the order of topic calls is ensured. This might decrease performance.

◆ throwUserException()

void throwUserException ( std::string const & message)

◆ unsubscribeTopic()

void unsubscribeTopic ( Ice::ObjectPrx subscriberProxy,
const std::string & topicName )

Unsubscribe a given subscriber from a given topic.

Parameters
subscriberProxyof the subscriber
topicNameThe name of the subscribed topic.

◆ waitForShutdown()

void waitForShutdown ( )

Waits until all invoked operation has been processed.

Friends And Related Symbol Documentation

◆ Component

friend class Component
friend

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