INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

orcaice Namespace Reference

libOrcaIce customizes Ice to simplify writing Orca components. More...

Classes

class  PostActivationCallback
 A hook to allow something to be done post-activation. More...
class  Activator
 A 'fire-and-forget' component activator. More...
class  Application
 Similar to Ice::Application, plus some Orca-specifc stuff. More...
class  Component
 Base class for all Components using libOrcaIce. More...
class  Context
 Component's naming and networking information. More...
class  ConfigFileException
 This exception is raised when something goes wrong while reading the configuration file. More...
class  NetworkException
 This exception is raised when something is wrong with the network connection. More...
class  ComponentDeactivatingException
class  TypeMismatchException
 This exception is raised if the required interface type does not match the proxy type. More...
class  Heartbeater
 Small utility class for keeping track of regular heartbeats. More...
class  Home
 Local API to component information. More...
class  PtrBuffer
 A thread-safe data pipe with buffer semantics for Ice smart pointers. More...
class  PtrNotify
 A data pipe with callback semantics for Ice smart pointers. More...
class  PtrStore
 Thread-safe storage for a single data object represented by an Ice smart pointer. More...
class  Service
 Base class to use when putting Orca components into an IceBox. More...
class  SubsystemThread
 A class implementing the common subsystem state machine, also catches all. More...

Typedefs

typedef IceUtil::Handle
< SubsystemThread
SubsystemThreadPtr
 A smart pointer to the SubsystemThread class.

Enumerations

enum  ComponentInterfaceFlag {
  NoStandardInterfaces = 0x000, HomeInterface = 0x001, StatusInterface = 0x010, TracerInterface = 0x100,
  AllStandardInterfaces = HomeInterface | StatusInterface | TracerInterface
}
enum  ComponentAdapterActivationPolicy { AdapterManualActivation = 0, AdapterAutoActivation }

Functions

std::string catchExceptions (gbxutilacfr::Tracer &tracer, const std::string &activity)
std::string catchExceptionsWithSleep (gbxutilacfr::Tracer &tracer, const std::string &activity, int sleepIntervalMSec)
std::string catchExceptionsWithStatus (const std::string &activity, gbxutilacfr::SubHealth &subHealth, gbxutilacfr::SubsystemHealth newHealth)
std::string catchExceptionsWithStatusAndSleep (const std::string &activity, gbxutilacfr::SubHealth &subHealth, gbxutilacfr::SubsystemHealth newHealth, int sleepIntervalMSec)
void catchMainLoopExceptions (gbxutilacfr::SubHealth &subHealth)
Component Configuration Functions



orca::FQInterfaceName getProvidedInterface (const Context &context, const std::string &ifaceTag)
orca::FQTopicName getProvidedTopicWithTag (const Context &context, const std::string &ifaceTag, const std::string &subtopic)
std::string getRequiredInterfaceAsString (const Context &context, const std::string &ifaceTag)
std::vector< std::string > getProvidedTags (const Context &context, const std::string &pattern)
std::vector< std::string > getRequiredTags (const Context &context, const std::string &pattern)
orca::FQComponentName resolveLocalPlatform (const orca::FQComponentName &fqname)
orca::FQComponentName resolveLocalPlatform (const Context &context, const orca::FQComponentName &fqname)
 Same as above with the addition of information traced to the tracer of context.
std::string resolveLocalPlatform (const Context &context, const std::string &proxy)
orca::ComponentData getComponentData (const Context &context)
Connection Functions



std::string getInterfaceIdWithString (const Context &context, const std::string &proxyString)
std::string getInterfaceIdWithTag (const Context &context, const std::string &interfaceTag)
bool isInterfaceReachable (const Context &context, const std::string &proxyString, std::string &diagnostic)
template<class InterfaceType >
void connectToInterfaceWithString (const Context &context,::IceInternal::ProxyHandle< InterfaceType > &proxy, const std::string &proxyString)
template<class InterfaceType >
void connectToInterfaceWithTag (const Context &context, InterfaceType &proxy, const std::string &interfaceTag)
template<class InterfacePrxType , typename DescriptionType >
DescriptionType getDescriptionWithTag (const Context &context, const std::string &interfaceTag)
template<class InterfacePrxType , typename DescriptionType >
DescriptionType getDescriptionWithString (const Context &context, const std::string &interfaceString)
Conversion Functions



orca::FQComponentName toComponent (const orca::FQInterfaceName &fqIName)
orca::FQInterfaceName toInterface (const orca::FQComponentName &fqCName, const std::string &iface)
orca::FQTopicName toTopic (const orca::FQInterfaceName &fqIName, const std::string &subtopic)
orca::FQTopicName toTopic (const orca::FQComponentName &fqCName, const std::string &iface, const std::string &subtopic)
std::string toTopicAsString (const orca::FQComponentName &component, const std::string &ifaceName, const std::string &subtopic)
orca::FQTopicName toStatusTopic (const orca::FQComponentName &fqCName)
 Based on the component name, returns the default topic name for Status interface.
orca::FQTopicName toTracerTopic (const orca::FQComponentName &fqCName)
 Based on the component name, returns the default topic name for Tracer interface.
IceGrid-Related Functions



bool isRegistryReachable (const Context &context)
IceGrid::QueryPrx getDefaultQuery (const orcaice::Context &context)
Ice::Identity toAdminIdentity (const orca::FQComponentName &)
 Returns identity of the component's Admin object.
orca::FQComponentName toComponentName (const Ice::Identity &adminId)
orca::FQComponentName toComponentName (const Ice::ObjectPrx &homePrx)
 Parses home proxy to a fully qualified name of the component to whome it belongs.
Ice::ObjectPrx getComponentAdmin (const orcaice::Context &context, const orca::FQComponentName &fqName)
Ice::ObjectProxySeq getAllComponentAdmins (const orcaice::Context &context)
std::string toAdminFacet (const orca::FQComponentName &fqName, const std::string &interfaceType)
bool isAdminInterfaceReachable (const Context &context, const orca::FQComponentName &fqName, const std::string &interfaceType, std::string &diagnostic)
void createAdminInterface (const Context &context, Ice::ObjectPtr &object, const orca::FQComponentName &fqName)
template<class InterfaceType , class InterfaceProxyType >
void connectToAdminInterface (const Context &context, InterfaceProxyType &interfacePrx, const orca::FQComponentName &fqname)
IceStorm-Related Functions



IceStorm::TopicPrx connectToIceStormTopicPrx (const Context &context, const std::string &topicName, bool createIfMissing)
IceStorm::TopicPrx connectToIceStormTopicPrx (const Ice::CommunicatorPtr &communicator, const std::string &topicName, bool createIfMissing)
IceStorm::TopicPrx connectToIceStormTopicPrxWithManager (const Ice::CommunicatorPtr &communicator, const std::string &topicName, const std::string &topicManagerString, bool createIfMissing)
Ice::ObjectPrx connectToIceStormTopicPublisherPrx (const Ice::CommunicatorPtr &communicator, const std::string &topicName)
Ice::ObjectPrx getIceStormTopicPublisherPrx (const IceStorm::TopicPrx &topic)
template<class ConsumerProxyType >
ConsumerProxyType createConsumerInterface (const Context &context, Ice::ObjectPtr &consumer)
template<class ConsumerProxyType >
IceStorm::TopicPrx connectToTopicWithString (const Context &context, ConsumerProxyType &publisher, const std::string &topicName, bool localReportingOnly=false)
template<class ConsumerProxyType >
IceStorm::TopicPrx connectToTopicWithTag (const Context &context, ConsumerProxyType &publisher, const std::string &interfaceTag, const std::string &subtopic="*", bool localReportingOnly=false)
template<class ConsumerPrxType , class DataType >
void tryPushToIceStormWithReconnect (orcaice::Context &context, ConsumerPrxType &publisherPrx, const DataType &data, IceStorm::TopicPrx &topicPrx, const std::string &topicName)
Ice-Related Functions



void createInterfaceWithString (const Context &context, Ice::ObjectPtr &object, const std::string &proxyString)
void createInterfaceWithTag (const Context &context, Ice::ObjectPtr &object, const std::string &ifaceTag)
void tryRemoveInterface (orcaice::Context &context, const std::string &interfaceName)
void tryRemoveInterfaceWithIdentity (orcaice::Context &context, const Ice::Identity &interfaceId)
Multi-Try Connection Functions



std::string getInterfaceIdWithString (const Context &context, const std::string &proxyString, gbxutilacfr::Stoppable *activity, const std::string &subsysName, int retryIntervalSec, int retryNumber)
std::string getInterfaceIdWithTag (const Context &context, const std::string &interfaceTag, gbxutilacfr::Stoppable *activity, const std::string &subsysName, int retryIntervalSec, int retryNumber)
template<class ProxyType >
void connectToInterfaceWithString (const Context &context, ProxyType &proxy, const std::string &proxyString, gbxutilacfr::Stoppable *activity, const std::string &subsysName="", int retryIntervalSec=2, int retryNumber=-1)
template<class ProxyType >
void connectToInterfaceWithTag (const Context &context, ProxyType &proxy, const std::string &interfaceTag, gbxutilacfr::Stoppable *activity, const std::string &subsysName="", int retryIntervalSec=2, int retryNumber=-1)
template<class InterfacePrxType , typename DescriptionType >
void getDescriptionWithTag (const Context &context, const std::string &interfaceTag, DescriptionType &description, gbxutilacfr::Stoppable *activity, const std::string &subsysName="", int retryIntervalSec=2, int retryNumber=-1)
template<class InterfacePrxType , typename DescriptionType >
void getDescriptionWithString (const Context &context, const std::string &interfaceString, DescriptionType &description, gbxutilacfr::Stoppable *activity, const std::string &subsysName="", int retryIntervalSec=2, int retryNumber=-1)
Multi-Try IceStorm-Related Functions



template<class ConsumerProxyType >
IceStorm::TopicPrx connectToTopicWithString (const Context &context, ConsumerProxyType &publisher, const std::string &topicName, gbxutilacfr::Stoppable *activity, const std::string &subsysName="", int retryIntervalSec=2, int retryNumber=-1, bool localReportingOnly=false)
template<class ConsumerProxyType >
IceStorm::TopicPrx connectToTopicWithTag (const Context &context, ConsumerProxyType &publisher, const std::string &interfaceTag, const std::string &subtopic, gbxutilacfr::Stoppable *activity, const std::string &subsysName="", int retryIntervalSec=2, int retryNumber=-1, bool localReportingOnly=false)
Multi-Try Ice-Related Functions



void createInterfaceWithString (const Context &context, Ice::ObjectPtr &object, const std::string &name, gbxutilacfr::Stoppable *activity, const std::string &subsysName, int retryIntervalSec, int retryNumber)
void createInterfaceWithTag (const Context &context, Ice::ObjectPtr &object, const std::string &interfaceTag, gbxutilacfr::Stoppable *activity, const std::string &subsysName, int retryIntervalSec, int retryNumber)
void activate (Context &context, gbxutilacfr::Stoppable *activity, const std::string &subsysName, int retryIntervalSec, int retryNumber)
Property functions



void ensurePropertyNotNull (const Ice::PropertiesPtr &props, const std::string &key)
std::string warnMissingProperty (const std::string &props, bool fatal)
std::string warnMissingPropertyWithDefault (const std::string &props, const std::string &defaultValue)
std::string warnMissingProperty (const std::string &info, const std::string &props, bool fatal)
std::string warnMissingPropertyWithDefault (const std::string &info, const std::string &props, const std::string &defaultValue)
bool isPropertyNotNull (const Ice::PropertiesPtr &, const ::std::string &key)
int getProperty (const Ice::PropertiesPtr &, const std::string &key, std::string &value)
std::string getPropertyWithDefault (const Ice::PropertiesPtr &, const std::string &key, const std::string &defaultValue)
 Returns the default value if key is not found.
int getPropertyAsInt (const Ice::PropertiesPtr &, const std::string &key, int &value)
int getPropertyAsIntWithDefault (const Ice::PropertiesPtr &, const std::string &key, int defaultValue)
int getPropertyAsDouble (const Ice::PropertiesPtr &, const std::string &key, double &value)
double getPropertyAsDoubleWithDefault (const Ice::PropertiesPtr &, const std::string &key, double defaultValue)
int getPropertyAsStringVector (const Ice::PropertiesPtr &, const std::string &key, std::vector< std::string > &value, char delim=':')
std::vector< std::string > getPropertyAsStringVectorWithDefault (const Ice::PropertiesPtr &, const std::string &key, const std::vector< std::string > &defaultValue, char delim=':')
 Returns the default value if key is not found or cannot be converted to a string sequence.
int getPropertyAsIntVector (const Ice::PropertiesPtr &, const std::string &key, std::vector< int > &value)
std::vector< int > getPropertyAsIntVectorWithDefault (const Ice::PropertiesPtr &, const std::string &key, const std::vector< int > &defaultValue)
 Returns the default value if key is not found or cannot be converted to a vector<int>.
int getPropertyAsDoubleVector (const Ice::PropertiesPtr &, const std::string &key, std::vector< double > &value)
std::vector< double > getPropertyAsDoubleVectorWithDefault (const Ice::PropertiesPtr &, const std::string &key, const std::vector< double > &defaultValue)
Stringify OCM Structures



std::string toString (const orca::FQComponentName &name)
orca::FQComponentName toComponentName (const std::string &s)
std::string toString (const orca::FQInterfaceName &name)
orca::FQInterfaceName toInterfaceName (const std::string &s)
std::string toString (const orca::FQTopicName &name)
std::string toString (const orca::FQExecutableName &name)
Stringify Date-Time Objects



std::string toStringDuration (const orca::Time &obj)
int toTimeDuration (const std::string &s, orca::Time &obj)
std::string toString (const orca::Time &obj)
std::string toString (const orca::TimeOfDay &)
 Returns string in format HH:MM:SS.sss.
std::string toString (const orca::Date &)
 Returns string in format YYYY/MM/DD.
Time Operations



IceUtil::Time toIceTime (const orca::Time &t)
 Converts from orca::Time to Ice standard time format.
orca::Time toOrcaTime (const IceUtil::Time &t)
 Converts from Ice standard time format to orca::Time.
orca::Time toOrcaTime (double sec)
orca::Time getNow ()
 Returns current time.
void setToNow (orca::Time &t)
 Set to current time.
orca::TimeOfDay toOrcaTimeOfDay (const IceUtil::Time &icetime)
orca::Date toOrcaDate (const IceUtil::Time &icetime)
orca::Time timeDiff (const orca::Time &t1, const orca::Time &t2)
double timeDiffAsDouble (const orca::Time &t1, const orca::Time &t2)
double timeAsDouble (const orca::Time &t)
void add (orca::Time &t, double seconds)
 Adds the specified number of seconds to t.
void subtract (orca::Time &t, double seconds)
 Subtracts the specified number of seconds from t.
std::string toDateTime (const orca::Time &t)

Detailed Description

libOrcaIce customizes Ice to simplify writing Orca components.

This namespace is part of a library which aims at simplifying Orca component development. It provides several helper classes to use and derive from and several functions to use. In doing so we make unavoidable assumptions about how Ice is going to be used in Orca components. If your component cannot live with these constraints you can always go back to using Ice directly (it's not much more work).

See also:
libOrcaIce

Enumeration Type Documentation

This enum type is used to describe the policy of activating the component's adapter.

Enumerator:
AdapterManualActivation 

Component adapter will be activated in the code of the component derived from orcaice::Component.

AdapterAutoActivation 

Component adapter will be activated by the internal infrastructure thead launched automatically by orcaice::Component.

This enum type is used to describe which standard interfaces the component will provide.

Flags can be combined. For example to initialize Home and Status but not Tracer.

orcaice::ComponentInterfaceFlag flag = orcaice::HomeInterface | orcaice::StatusInterface;
Enumerator:
NoStandardInterfaces 

No standard interfaces.

HomeInterface 

Home interface only.

StatusInterface 

Status interface only.

TracerInterface 

Tracer interface only.

AllStandardInterfaces 

All standard interfaces.


Function Documentation

void orcaice::activate ( Context &  context,
gbxutilacfr::Stoppable *  activity,
const std::string &  subsysName = "",
int  retryIntervalSec = 2,
int  retryNumber = -1 
)

Tries to activate the adapter (by calling Context::activate(). If fails, sleeps for retryIntervalSec [s] seconds. Will repeat until successful, the number of retries is exceeded (default -1, i.e. infinite), or the activity is stopped. Threads are a commonly used activity which implement Stoppable interface.

Nothing is done if retryNumber=0.

If a non-empty subsystem name is supplied, sends a Status heartbeat after every attempt (

See also:
gbxutilacfr::Status). Status warnings are NOT issued because the Status interface is not accessible until the adapter is activated.

If a non-empty subsystem name is supplied, sends a Status heartbeat at every iteration (

See also:
gbxutilacfr::Status).
std::string orcaice::catchExceptions ( gbxutilacfr::Tracer &  tracer,
const std::string &  activity = "" 
)

Catches the following types results in status fault: {std::exception, std::string, char*, "..."}.

Catching the following types and ignores them: {Ice::CommunicatorDestroyedException, orcaice::ComponentDeactivatingException}.

Do not call this function outside of a catch block! In this case, there will be no exception to re-throw and terminate() will be called, resulting in abort().

Returns problem description.

Example:

try
{
    // do something
}
catch ( ... ) 
{
    orcaice::catchExceptions( context_.tracer(), "initializing hardware driver" );
} 
std::string orcaice::catchExceptionsWithSleep ( gbxutilacfr::Tracer &  tracer,
const std::string &  activity,
int  sleepIntervalMSec = 1000 
)

Same as catchExceptions() but also sleeps for specified number of milliseconds before returning. Use this function to slow execution down in case of a persistent error. Default sleep interval is 1000ms.

Example:

while ( !isStopping() )
{
    try
    {
        // do something
    }
    catch ( ... ) 
    {
        orcaice::catchExceptionsWithSleep( context_.tracer(), "initializing hardware driver", 2000 );

        // possibly do something else, e.g. re-initialize your hardware driver
    } 
} 
std::string orcaice::catchExceptionsWithStatus ( const std::string &  activity,
gbxutilacfr::SubHealth &  subHealth,
gbxutilacfr::SubsystemHealth  newHealth = gbxutilacfr::SubsystemFault 
)

Same as catchExceptions() but also changes subsystem's health to newHealth. All status health types are allowed. Default new health is gbxutilacfr::SubsystemFault.

Example:

while ( !isStopping() )
{
    try
    {
        // do something
    }
    catch ( ... ) 
    {
        // will issue a status Warning instead of the default Fault.
        orcaice::catchExceptionsWithSleep( "initializing hardware driver", health(), gbxutilacfr::SubsystemWarning );
    } 
} 
std::string orcaice::catchExceptionsWithStatusAndSleep ( const std::string &  activity,
gbxutilacfr::SubHealth &  subHealth,
gbxutilacfr::SubsystemHealth  newHealth = gbxutilacfr::SubsystemFault,
int  sleepIntervalMSec = 1000 
)

Same as catchExceptionsWithStatus() but also sleeps for specified number of milliseconds before returning. Use this function to slow execution down in case of a persistent error.

This function is normally called from inside the catch block of the component's main loop, i.e. inside SubsystemThread::run() function.

Example:

while ( !isStopping() )
{
    try 
    {
        // do your stuff
    }
    catch ( ... ) 
    {
        orcaice::catchExceptionsWithStatusAndSleep( "initializing hardware driver", health() );
    }
}
void orcaice::catchMainLoopExceptions ( gbxutilacfr::SubHealth &  subHealth  ) 

Convenience function which is equivalent to

catchExceptionsWithStatusAndSleep( "running in main loop", health(), gbxutilacfr::SubsystemFault );
template<class InterfaceType , class InterfaceProxyType >
void orcaice::connectToAdminInterface ( const Context &  context,
InterfaceProxyType &  interfacePrx,
const orca::FQComponentName &  fqname 
) [inline]

Special connect function to be used with interfaces hosted as facets of component's Admin interface.

Not all objects can be added to the admin interface, see toAdminFacet() for the list of supported interfaces.

Before making any connections, the fully-qualified component name is checked and platform 'local' is replaced with current hostname.

In the event of a failed connection, adds an interpretive message and re-throws a NetworkException.

Example 1. Connect to your own Status.

orca::StatusPrx statusPrx;
orcaice::connectToAdminInterface<orca::Status,orca::StatusPrx>( context_, statusPrx, context_.name() );
Note:
Registration of Admin interface with the registry happens in a separate thread. If you really want to connect to one of your own Admin interfaces you have to sleep for a bit or try several times.

Example 2. Connect to a remote Process.

Ice::ProcessPrx processPrx;
orca::FQComponentName fqName;
fqName.platform = "papa";
fqName.component = "murphy";
orcaice::connectToAdminInterface<Ice::Process,Ice::ProcessPrx>( context_, processPrx, fqName );

References getComponentAdmin(), resolveLocalPlatform(), and toAdminFacet().

template<class ProxyType >
void orcaice::connectToInterfaceWithString ( const Context &  context,
ProxyType &  proxy,
const std::string &  proxyString,
gbxutilacfr::Stoppable *  activity,
const std::string &  subsysName = "",
int  retryIntervalSec = 2,
int  retryNumber = -1 
) [inline]

Convenience function. Tries to connect to the specified remote interface until successful, the number of retries is exceeded (default -1, i.e. infinite), or the activity is stopped. Threads are a commonly used activity which implement Stoppable interface.

Nothing is done if retryNumber=0. If a non-empty subsystem name is supplied, sends a Status heartbeat after every attempt (

See also:
gbxutilacfr::Status).

We catch orcaice::NetworkException, sleep for retryIntervalSec [s] and try again.

We do NOT catch a possible orcaice::TypeMismatchException because this condition is unlikely to change.

Example:

MyInterfacePrx myInterfacePrx;
try {
    orcaice::connectToInterfaceWithString<MyInterfacePrx>( 
        context_, myInterfacePrx, "iface@platform/component", (gbxutilacfr::Stoppable*)this );
}
catch ( const orcaice::TypeMismatchException& e ) {
    // what do we do?
}

References connectToInterfaceWithString(), orcaice::Context::status(), and orcaice::Context::tracer().

template<class InterfaceType >
void orcaice::connectToInterfaceWithString ( const Context &  context,
::IceInternal::ProxyHandle< InterfaceType > &  proxy,
const std::string &  proxyString 
) [inline]

Create an Ice proxy proxy for the remote server based on a stringified proxy proxyString. The proxy can be direct or indirect. For indirect proxies with platform name set to local, hostname is used as the platform name.

Throws TypeMismatchException if fails to connect to the remote interface or if it is of the wrong type.

In the event of a failed connection, adds an interpretive message and re-throws a NetworkException.

Example: to connect to interface of type MyInterface, use

MyInterfacePrx myInterfacePrx;
orcaice::connectToInterfaceWithString( context_, myInterfacePrx, "iface@platform/component" );

References orcaice::Context::communicator(), and resolveLocalPlatform().

Referenced by connectToInterfaceWithString(), connectToInterfaceWithTag(), getDescriptionWithString(), and orcaifaceimpl::ConsumerImpl< orca::RangeScanner2d, orca::RangeScanner2dConsumer, orca::RangeScanner2dDataPtr >::subscribeWithString().

template<class ProxyType >
void orcaice::connectToInterfaceWithTag ( const Context &  context,
ProxyType &  proxy,
const std::string &  interfaceTag,
gbxutilacfr::Stoppable *  activity,
const std::string &  subsysName = "",
int  retryIntervalSec = 2,
int  retryNumber = -1 
) [inline]

Convenience function. Tries to connect to the specified remote interface until successful, the number of retries is exceeded (default -1, i.e. infinite), or the activity is stopped. Threads are a commonly used activity which implement Stoppable interface.

Nothing is done if retryNumber=0. If a non-empty subsystem name is supplied, sends a Status heartbeat after every attempt (

See also:
gbxutilacfr::Status).

We catch orcaice::NetworkException, sleep for retryIntervalSec [s] and try again.

We do NOT catch a possible orcaice::TypeMismatchException because this condition is unlikely to change.

We do NOT catch a possible orcaice::ConfigFileException exception.

Example:

MyInterfacePrx myInterfacePrx;
try {
    orcaice::connectToInterfaceWithTag<MyInterfacePrx>( 
        context_, myInterfacePrx, "MyInterface", (gbxutilacfr::Stoppable*)this );
}
catch ( const orcaice::TypeMismatchException& e ) {
    // what do we do?
}
catch ( const orcaice::ConfigFileException& e ) {
    // what do we do?
}

References orcaice::Context::status(), and orcaice::Context::tracer().

template<class InterfaceType >
void orcaice::connectToInterfaceWithTag ( const Context &  context,
InterfaceType &  proxy,
const std::string &  interfaceTag 
) [inline]

Convenience function, behaves like connectToInterfaceWithString but the proxy information comes from the configuration file and the interfaceTag.

MyInterfacePrx myInterfacePrx;
orcaice::connectToInterfaceWithTag( context_, myInterfacePrx, "MyInterface" );

Throws ConfigFileException if the interface name cannot be read for some reason.

References connectToInterfaceWithString(), and getRequiredInterfaceAsString().

Referenced by getDescriptionWithTag().

template<class ConsumerProxyType >
IceStorm::TopicPrx orcaice::connectToTopicWithString ( const Context &  context,
ConsumerProxyType &  publisher,
const std::string &  topicName,
gbxutilacfr::Stoppable *  activity,
const std::string &  subsysName = "",
int  retryIntervalSec = 2,
int  retryNumber = -1,
bool  localReportingOnly = false 
) [inline]

Convenience function. Tries to connect to the specified topic by calling connectToTopicWithString() until successful, the number of retries is exceeded (default -1, i.e. infinite), or the activity is stopped. Threads are a commonly used activity which implement Stoppable interface.

If unsuccesful for any reason, an empty topic proxy is returned. Nothing is done if retryNumber=0. If a non-empty subsystem name is supplied, sends a Status heartbeat after every attempt (

See also:
gbxutilacfr::Status).

We catch all orcaice::NetworkException, sleep for retryIntervalSec [s] and try again.

All other exceptions are not likely to be resolved over time so we don't catch them.

References orcaice::Context::status(), and orcaice::Context::tracer().

template<class ConsumerProxyType >
IceStorm::TopicPrx orcaice::connectToTopicWithString ( const Context &  context,
ConsumerProxyType &  publisher,
const std::string &  topicName,
bool  localReportingOnly = false 
) [inline]

This function is used by potential publishers of information. It returns a proxy to the IceStorm topic and sets proxy to the topic's publisher. The publisher is used to distribute information to consumers and the topic is used to subscribe/unsubscribe data consumers.

The address of IceStorm server is looked up in the IceStorm.TopicManager.Proxy property.

Raises NetworkException if the server cannot be reached or Exception if there is any other problem.

Set localReportingOnly to true when calling this function from classes which deal with error reporting, such as Tracer and Status. Otherwise, potential connection problems will lead to infinite multiplication of fault messages.

References orcaice::Context::communicator().

Referenced by connectToTopicWithTag().

template<class ConsumerProxyType >
IceStorm::TopicPrx orcaice::connectToTopicWithTag ( const Context &  context,
ConsumerProxyType &  publisher,
const std::string &  interfaceTag,
const std::string &  subtopic,
gbxutilacfr::Stoppable *  activity,
const std::string &  subsysName = "",
int  retryIntervalSec = 2,
int  retryNumber = -1,
bool  localReportingOnly = false 
) [inline]

Convenience function. Tries to connect to the specified topic by calling connectToTopicWithTag() until successful, the number of retries is exceeded (default -1, i.e. infinite), or the activity is stopped. Threads are a commonly used activity which implement Stoppable interface.

If unsuccesful for any reason, an empty topic proxy is returned. Nothing is done if retryNumber=0.

If a non-empty subsystem name is supplied, sends a Status heartbeat after every attempt (

See also:
gbxutilacfr::Status).

We catch all orcaice::NetworkException, sleep for retryIntervalSec [s] and try again.

All other exceptions are not likely to be resolved over time so we don't catch them.

References orcaice::Context::status(), and orcaice::Context::tracer().

template<class ConsumerProxyType >
IceStorm::TopicPrx orcaice::connectToTopicWithTag ( const Context &  context,
ConsumerProxyType &  publisher,
const std::string &  interfaceTag,
const std::string &  subtopic = "*",
bool  localReportingOnly = false 
) [inline]

Convenience function, behaves like connectToTopicWithString but the proxy information comes from the configuration file and the interfaceTag. The appropriate topic name is generated based on the fully-qualified interface name. Default subtopic is "*".

Throws ConfigFileException if the interface name cannot be read for some reason.

References connectToTopicWithString(), getProvidedTopicWithTag(), toString(), and orcaice::Context::tracer().

void orcaice::createAdminInterface ( const Context &  context,
Ice::ObjectPtr &  object,
const orca::FQComponentName &  fqname 
)

Adds the object as a facet to the component's Admin interface.

Not all objects can be added to the admin interface, see toAdminFacet() for the list of supported interfaces.

Before creating the interface, the fully-qualified component name is checked and platform 'local' is replaced with current hostname.

This funciton may throw Ice::AlreadyRegisteredException. We don't catch it internally because this is a specialized function which only used in internal code.

If successful, registers the interface with Home under the name which is the same as the Admin facet.

Ice::ObjectPtr obj = new MyObjectI;
orcaice::createAdminInterface( context_, obj, context_.name() );
template<class ConsumerProxyType >
ConsumerProxyType orcaice::createConsumerInterface ( const Context &  context,
Ice::ObjectPtr &  consumer 
) [inline]

Adds an object to the adapter and returns a direct proxy to the object. A globally unique name is supplied. This function is useful for creating 'consumer' objects, i.e. you subscribe for information to be pushed into them by specifying the direct proxy to them.

This is a local operation. It normally does not throw any exceptions. The only case when an exception, orcaice::ComponentDeactivatingException, is thrown is when the adapter is deactivated. This does not happen right after a component is created because the initial state of an adapter is Holding.

Ice::ObjectPtr consumer = new Odometry2dConsumerI;
orca::Odometry2dConsumerPrx consumerPrx =
    orcaice::createConsumerInterface<orca::Odometry2dConsumerPrx>( context(), consumer );

This function returns a two-way proxy. You can change the proxy type with standard Ice functions (search the manual for "proxy factory methods").

consumerPrx = consumerPrx->ice_oneway();

References orcaice::Context::adapter(), and orcaice::Context::tracer().

void orcaice::createInterfaceWithString ( const Context &  context,
Ice::ObjectPtr &  object,
const std::string &  name,
gbxutilacfr::Stoppable *  activity,
const std::string &  subsysName = "",
int  retryIntervalSec = 2,
int  retryNumber = -1 
)

Convenience function. Tries to setup the specified interface until is successful, the number of retries is exceeded (default -1, i.e. infinite), or the activity is stopped. Threads are a commonly used activity which implement Stoppable interface.

Nothing is done if retryNumber=0.

Status warnings are set between retries if subsystem name is specified (

See also:
gbxutilacfr::Status), otherwise warnings are simply traced.

We catch gbxutilacfr::Exception, sleep for retryIntervalSec [s] and try again.

Example:

Ice::ObjectPtr obj = new MyObjectI;
orcaice::createInterfaceWithString( context_, obj, "coolname", (gbxutilacfr::Stoppable*)this );
void orcaice::createInterfaceWithString ( const Context &  context,
Ice::ObjectPtr &  object,
const std::string &  name 
)

Adds the object to the component adapter and gives it the name. Note that name is just the interface name, not its fully-qualified name. (In Ice terms this will become the object identity.)

Throws gbxutilacfr::Exception if fails to register the new object.

Ice::ObjectPtr obj = new MyObjectI;
orcaice::createInterfaceWithString( context(), obj, "coolname" );

Referenced by orcaifaceimpl::VelocityControl2dImpl::initInterface(), orcaifaceimpl::ProviderWithDescriptionImpl< ProviderType, ConsumerType, DataType, DescriptionType >::initInterface(), orcaifaceimpl::ProviderImpl< ProviderType, ConsumerType, DataType >::initInterface(), orcaifaceimpl::PropertiesImpl::initInterface(), orcaifaceimpl::PathFollower2dImpl::initInterface(), orcaifaceimpl::EStopImpl::initInterface(), orcaifaceimpl::DriveBicycleImpl::initInterface(), orcaifaceimpl::ButtonImpl::initInterface(), and orcaifaceimpl::BinarySwitchImpl::initInterface().

void orcaice::createInterfaceWithTag ( const Context &  context,
Ice::ObjectPtr &  object,
const std::string &  interfaceTag,
gbxutilacfr::Stoppable *  activity,
const std::string &  subsysName = "",
int  retryIntervalSec = 2,
int  retryNumber = -1 
)

Convenience function. Tries to setup the specified interface until successful, the number of retries is exceeded (default -1, i.e. infinite), or the activity is stopped. Threads are a commonly used activity which implement Stoppable interface.

Nothing is done if retryNumber=0.

Status warnings are set between retries if subsystem name is specified (

See also:
gbxutilacfr::Status), otherwise warnings are simply traced.

We catch gbxutilacfr::Exception, sleep for retryIntervalSec [s] and try again. Gives up after retryNumber of attempts (-1 stands for infinite number of retries).

We do NOT catch a possible orcaice::ConfigFileException exception.

Ice::ObjectPtr obj = new MyObjectI;
try
{
    orcaice::createInterfaceWithTag( context_, obj, "InterfaceTag", (gbxutilacfr::Stoppable*)this );
}
catch ( const orcaice::ConfigFileException& e ) {
    // what do we do?
}
void orcaice::createInterfaceWithTag ( const Context &  context,
Ice::ObjectPtr &  object,
const std::string &  interfaceTag 
)

Convenience function, behaves like createInterfaceWithString but the proxy information is looked up in the context properties based on the interfaceTag.

Throws ConfigFileException if the interface name cannot be read from the config file for some reason.

Ice::ObjectPtr obj = new MyObjectI;
orcaice::createInterfaceWithTag( context(), obj, "InterfaceTag" );
void orcaice::ensurePropertyNotNull ( const Ice::PropertiesPtr &  ,
const std::string &  key 
)

Checks if the property key is not null. Throws gbxutilacfr::Exception if the property is null.

Ice::ObjectProxySeq orcaice::getAllComponentAdmins ( const orcaice::Context context  ) 

Contacts the default Query interface of the Registry and looks up all registered admin proxies.

Ice::ObjectPrx orcaice::getComponentAdmin ( const orcaice::Context context,
const orca::FQComponentName &  fqName 
)

Contacts the default Locator interface of the Registry and looks up component admin proxy.

Before creating the interface, the fully-qualified component name is checked and platform 'local' is replaced with current hostname.

Referenced by connectToAdminInterface().

orca::ComponentData orcaice::getComponentData ( const Context &  context  ) 

Parses properties to build static component information. Interfaces which are not in the config file will not appear here, e.g. Home, Tracer, Status.

IceGrid::QueryPrx orcaice::getDefaultQuery ( const orcaice::Context context  ) 

Returns a proxy to the default Query object, based on the default Locator of communicator. Returns null proxy on failure.

template<class InterfacePrxType , typename DescriptionType >
DescriptionType orcaice::getDescriptionWithString ( const Context &  context,
const std::string &  interfaceString 
) [inline]

Connects to the interface and gets the description. Relies on standard naming: "getDescription()".

References connectToInterfaceWithString().

template<class InterfacePrxType , typename DescriptionType >
DescriptionType orcaice::getDescriptionWithTag ( const Context &  context,
const std::string &  interfaceTag 
) [inline]

Connects to the interface and gets the description. Relies on standard naming: "getDescription()".

References connectToInterfaceWithTag().

std::string orcaice::getInterfaceIdWithString ( const Context &  context,
const std::string &  proxyString,
gbxutilacfr::Stoppable *  activity,
const std::string &  subsysName = "",
int  retryIntervalSec = 2,
int  retryNumber = -1 
)

Convenience function. Tries to connect to the specified interface by calling getInterfaceIdWithString() until successful, the number of retries is exceeded (default -1, i.e. infinite), or the activity is stopped. Threads are a commonly used activity which implement Stoppable interface.

If unsuccesful for any reason, an empty string is returned. Nothing is done if retryNumber=0. If a non-empty subsystem name is supplied, sends a Status heartbeat after every attempt (

See also:
gbxutilacfr::Status).

We catch all orcaice::NetworkException, sleep for retryIntervalSec [s] and try again.

std::string orcaice::getInterfaceIdWithString ( const Context &  context,
const std::string &  proxyString 
)

Tries to connect the interface described in the config file and gets its ID (Slice object type). Throws NetworkException if the interface is unreachable.

std::string orcaice::getInterfaceIdWithTag ( const Context &  context,
const std::string &  interfaceTag,
gbxutilacfr::Stoppable *  activity,
const std::string &  subsysName = "",
int  retryIntervalSec = 2,
int  retryNumber = -1 
)

Convenience function. Tries to connect to the specified interface by calling getInterfaceIdWithString() until successful, the number of retries is exceeded (default -1, i.e. infinite), or the activity is stopped. Threads are a commonly used activity which implement Stoppable interface.

If unsuccesful for any reason, an empty string is returned. Nothing is done if retryNumber=0. If a non-empty subsystem name is supplied, sends a Status heartbeat after every attempt (

See also:
gbxutilacfr::Status).

We catch all orcaice::NetworkException, sleep for retryIntervalSec [s] and try again.

All other exceptions are not likely to be resolved over time so we don't catch them.

std::string orcaice::getInterfaceIdWithTag ( const Context &  context,
const std::string &  interfaceTag 
)

Tries to connect the interface described in the config file and gets its ID (Slice object type). Throws NetworkException if the interface is unreachable. Throws ConfigFileException if there's a problem with reading from the config file.

orca::Time orcaice::getNow (  ) 

Returns current time.

Time comparisons for orca::Time are autogenerated by Ice and they happen to work correctly (this tested by libOrcaIce test programs). Usage:

orca::Time t1,t2;
// set t1 and t2 values
if ( t1 < t2 ) {
    ...
}

Referenced by orcalog::SnapshotLogBuffer< ObjectType, LogWriterType >::addItem(), and orcalog::GenericAutoLogger< orca::Gps, orca::GpsConsumer, orca::GpsData, GpsLogWriter >::dataEvent().

int orcaice::getProperty ( const Ice::PropertiesPtr &  ,
const std::string &  key,
std::string &  value 
)

Returns: 0 = property found (and its value is not empty), non-zero = property not found (or is defined but left empty). Note that the Ice PropertiesI::load() method has a line size limitation of 1024 characters but quietly fails so there is no way of knowing if you have exceeded this limitation

int orcaice::getPropertyAsDouble ( const Ice::PropertiesPtr &  ,
const std::string &  key,
double &  value 
)

Returns: 0 = property found (and its value is not empty), non-zero = property not found (or is defined but left empty). Throws a gbxutilacfr::Exception if the key is found but the value cannot be converted to the desired type.

int orcaice::getPropertyAsDoubleVector ( const Ice::PropertiesPtr &  ,
const std::string &  key,
std::vector< double > &  value 
)

Parses the value into a vector of doubles assuming empty space delimeters. Elements will continue to be added to the end of the vector until the end of the line is reached. Returns: 0 = property found (and its value is not empty), non-zero = property not found (or is defined but left empty). Note that the Ice PropertiesI::load() method has a line size limitation of 1024 characters but quietly fails so there is no way of knowing if you have exceeded this limitation. Throws a gbxutilacfr::Exception if the key is found but the value cannot be converted to the desired type.

std::vector<double> orcaice::getPropertyAsDoubleVectorWithDefault ( const Ice::PropertiesPtr &  ,
const std::string &  key,
const std::vector< double > &  defaultValue 
)

Returns the default value if key is not found. Throws a gbxutilacfr::Exception if the key is found but the value cannot be converted to the desired type.

double orcaice::getPropertyAsDoubleWithDefault ( const Ice::PropertiesPtr &  ,
const std::string &  key,
double  defaultValue 
)

Returns the default value if key is not found. Throws a gbxutilacfr::Exception if the key is found but the value cannot be converted to the desired type.

int orcaice::getPropertyAsInt ( const Ice::PropertiesPtr &  ,
const std::string &  key,
int &  value 
)

Returns: 0 = property found (and its value is not empty), non-zero = property not found (or is defined but left empty). Throws a gbxutilacfr::Exception if the key is found but the value cannot be converted to the desired type.

int orcaice::getPropertyAsIntVector ( const Ice::PropertiesPtr &  ,
const std::string &  key,
std::vector< int > &  value 
)

Parses the value into a vector of ints assuming empty space delimeters. Elements will continue to be added to the end of the vector until the end of the line is reached. Returns: 0 = property found (and its value is not empty), non-zero = property not found (or is defined but left empty). Note that the Ice PropertiesI::load() method has a line size limitation of 1024 characters. but quietly fails so there is no way of knowing if you have exceeded this limitation Throws a gbxutilacfr::Exception if the key is found but the value cannot be converted to the desired type.

int orcaice::getPropertyAsIntWithDefault ( const Ice::PropertiesPtr &  ,
const std::string &  key,
int  defaultValue 
)

Returns the default value if key is not found. Throws a gbxutilacfr::Exception if the key is found but the value cannot be converted to the desired type.

int orcaice::getPropertyAsStringVector ( const Ice::PropertiesPtr &  ,
const std::string &  key,
std::vector< std::string > &  value,
char  delim = ':' 
)

Parses the value into a vector of strings using the given delimiter Returns: 0 = property found (and set in value), non-zero = property not found or parsing failed.

orca::FQInterfaceName orcaice::getProvidedInterface ( const Context &  ,
const std::string &  interfaceTag 
)

Reads properties contained in the context and returns the fully-qualified name of the provided interface corresponding to interfaceTag.

Throws ConfigFileException if the interface name cannot be read for some reason.

std::vector< std::string > orcaice::getProvidedTags ( const Context &  context,
const std::string &  pattern = "" 
)

For components with variable number of interfaces it may be useful to get a listing of all provided interfaces described in the configuration file.

See getRequiredTags() for the usage of pattern.

orca::FQTopicName orcaice::getProvidedTopicWithTag ( const Context &  ,
const std::string &  interfaceTag,
const std::string &  subtopic = "*" 
)

Convenience function which behaves like getProvidedTopicWithString() but the interface name is looked up in the config file using the interfaceTag. Throws ConfigFileException if the interface name cannot be read for some reason.

Referenced by connectToTopicWithTag().

std::string orcaice::getRequiredInterfaceAsString ( const Context &  ,
const std::string &  interfaceTag 
)

Reads properties contained in the context and returns the stringified proxy to the required interface corresponding to the interface tag.

The proxy can be direct or indirect.

Throws ConfigFileException if the interface name cannot be read for some reason.

Referenced by connectToInterfaceWithTag(), and orcaifaceimpl::ConsumerSubscriber::subscribeWithTag().

std::vector< std::string > orcaice::getRequiredTags ( const Context &  context,
const std::string &  pattern = "" 
)

For components with variable number of interfaces it may be useful to get a listing of all required interfaces described in the configuration file.

You may have a group of permanent required interfaces and group of variable or optional ones. To separate the two groups you may want to start all optional tags with a certain pattern. For example, your config file may look like this:

MyComponent.Requires.Locolise2d.Proxy=something
MyComponent.Requires.LaserScanner2dFront.Proxy=something
MyComponent.Requires.LaserScanner2dBack.Proxy=something

In this case you would get a list of "laser" required interfaces by supplying the pattern="LaserScanner2d" or pattern="Laser" or pattern="La". For example:

std::vector<std::string> laserTags;
laserTags = orcaice::getRequiredTags( context_, "Laser" );

The default empty string pattern will match all required interfaces.

bool orcaice::isAdminInterfaceReachable ( const Context &  context,
const orca::FQComponentName &  fqName,
const std::string &  interfaceType,
std::string &  diagnostic 
)

Tries to ice_ping() the remote Admin interface specified with a fully-qualified component name and the interface facet name. Returns TRUE if the ping was successful and FALSE if not. Writes diagnostic information into diagnostic string.

Before making any connections, the fully-qualified component name is checked and platform 'local' is replaced with current hostname.

The interface type must be specified fully, including the module name, e.g. "::orca::Home". Not all objects can be added to the admin interface, see toAdminFacet() for the list of supported interfaces.

Catches all exceptions. Does not throw.

bool orcaice::isInterfaceReachable ( const Context &  context,
const std::string &  proxyString,
std::string &  diagnostic 
)

Tries to reach the remote interface specified with proxyString by calling ice_ping() function. Returns TRUE if the ping was successful and FALSE if not. Writes diagnostic information into diagnostic string.

Catches all exceptions. Does not throw.

Implementation note: this function does not need to be templated because ice_ping() is implemented by all Ice objects regardless of type.

bool orcaice::isPropertyNotNull ( const Ice::PropertiesPtr &  ,
const ::std::string &  key 
)

Return TRUE if the property is defined and contains a non-null value. Note that Ice properties do not distinguish between undefined and null properties. I.e. an empty string is returned in both cases:

  • the property is not defined
  • the property is defined but set to any empty string.
bool orcaice::isRegistryReachable ( const Context &  context  ) 

Tries to ping the default Locator and, based on success or the exceptions it catches, determines if the registry is reachable.

std::string orcaice::resolveLocalPlatform ( const Context &  context,
const std::string &  proxy 
)

For indirect proxies with platform name set to local, returns a new proxy string with local replaced with the current hostname.

orca::FQComponentName orcaice::resolveLocalPlatform ( const orca::FQComponentName &  fqname  ) 

For fully-qualified component names with platform name set to local, returns a new component name string with local replaced with the current hostname. No changes are made if either the platform or the component names are empty.

Referenced by connectToAdminInterface(), and connectToInterfaceWithString().

double orcaice::timeAsDouble ( const orca::Time &  t  ) 

Converts an orca::Time to a double in seconds. Time can be negative, but remember that seconds and microseconds are added to together. e.g. -10s:-100000us and -11s:900000us will both translate to -10.1s

orca::Time orcaice::timeDiff ( const orca::Time &  t1,
const orca::Time &  t2 
)

Returns the difference between two time values (ie: t1-t2) The result is negative if t1 is earlier than t2.

double orcaice::timeDiffAsDouble ( const orca::Time &  t1,
const orca::Time &  t2 
)

Returns the difference between two time values as a double (in seconds) (ie: t1-t2) The result is negative if t1 is earlier than t2.

Referenced by orcalog::SnapshotLogBuffer< ObjectType, LogWriterType >::addItem().

std::string orcaice::toAdminFacet ( const orca::FQComponentName &  fqName,
const std::string &  interfaceType 
)

Orca convention for naming admin interface facets. The reason for encoding the platform and component name in the facet name: to allow sharing of Communicator inside the IceBox by multiple components (all of them will try to add their admin facets to the same Communicator).

The following admin interfaces are currently supported

  • Ice::Process
  • Ice::PropertiesAdmin
  • orca::Home
  • orca::Status
  • orca::Tracer

The fully-qualified component name is checked and platform 'local' is replaced with current hostname.

Throws bxutilacfr::Exception when called with unsupported object type.

Referenced by connectToAdminInterface().

orca::FQComponentName orcaice::toComponent ( const orca::FQInterfaceName &  fqIName  ) 

Extracts the fully-qualified component name. No checks are performed.

orca::FQComponentName orcaice::toComponentName ( const std::string &  s  ) 

Parses a string to extract a fully qualified component name. This is the inverse of toString(). Expects an input string in the form of platform/component A null structure is returned if no delimeter is present. Does not handle the case of multiple delimeters.

orca::FQComponentName orcaice::toComponentName ( const Ice::Identity &  adminId  ) 

Parses category of the identity to extract a fully qualified component name. This is the inverse of toIdentityCategory(); Expects an input string in the form of platform.component A null structure is returned if no delimeter is present. Does not handle the case of multiple delimeters.

std::string orcaice::toDateTime ( const orca::Time &  t  )  [inline]

Matches IceUtil::Time::toDateTime function: converts to human-readable date/time string.

References toIceTime().

orca::FQInterfaceName orcaice::toInterface ( const orca::FQComponentName &  fqIName,
const std::string &  iface 
)

Returns the fully-qualified interface name. No checks are performed.

Referenced by orcasystemstatusutil::StatusConsumerImpl::subscribe().

orca::FQInterfaceName orcaice::toInterfaceName ( const std::string &  s  ) 

Parses a string to extract a fully qualified interface name Expects an input string in the form of interface /component A null structure is returned if either one of the delimeters is absent.

Referenced by orcaifaceimpl::ConsumerImpl< orca::RangeScanner2d, orca::RangeScanner2dConsumer, orca::RangeScanner2dDataPtr >::subscribeWithString().

orca::Date orcaice::toOrcaDate ( const IceUtil::Time &  t  ) 

Converts from Ice standard time format to orca::Date. Unlike IceUtil::Time::toDateTime(), we use UTC time and not local time.

orca::Time orcaice::toOrcaTime ( double  seconds  ) 

Converts from number of seconds to orca::Time. Time can be negative, in which case both seconds and microseconds are returned as negatives, e.g. -10.1s will translate to -10s:-100000us, not -11s:900000us.

orca::TimeOfDay orcaice::toOrcaTimeOfDay ( const IceUtil::Time &  t  ) 

Converts from Ice standard time format to orca::TimeOfDay. Unlike IceUtil::Time::toDateTime(), we use UTC time and not local time.

std::string orcaice::toString ( const orca::Time &   ) 

Returns string in human readable format: MM/DD/YY HH:MM:SS.sss.

std::string orcaice::toString ( const orca::FQExecutableName &  name  ) 

Converts fully executable name to a string. i.e. executable

std::string orcaice::toString ( const orca::FQTopicName &   ) 

Converts fully qualified topic name to a string. i.e. interface/topic@platform/component

std::string orcaice::toString ( const orca::FQInterfaceName &   ) 

Converts fully qualified interface name to a string. e.i. interface@platform/component

See also:
toInterfaceName
std::string orcaice::toString ( const orca::FQComponentName &   ) 

Converts fully qualified component name to a string. e.i. platform/component

See also:
toComponentName

Referenced by connectToTopicWithTag(), orcaqcm::OcmModel::customEvent(), and orcasystemstatusutil::StatusConsumerImpl::subscribe().

std::string orcaice::toStringDuration ( const orca::Time &   ) 

For durations less than 24hrs returns string HH:MM:SS.sss. Otherwise, DD:HH:MM:SS.sss Negative times are supported but only if seconds and microseconds are both negative.

int orcaice::toTimeDuration ( const std::string &  ,
orca::Time &   
)

Parses result of the correspondinng toString(). Returns: 0 = parsing successful, non-zero = parsing failed. Negative durations are supported, but only if the very first character of the string is '-'.

orca::FQTopicName orcaice::toTopic ( const orca::FQComponentName &  fqCName,
const std::string &  iface,
const std::string &  subtopic = "*" 
)

Returns the fully-qualified topic name. No checks are performed.

orca::FQTopicName orcaice::toTopic ( const orca::FQInterfaceName &  fqIName,
const std::string &  subtopic = "*" 
)

Returns the fully-qualified topic name. No checks are performed.

std::string orcaice::toTopicAsString ( const orca::FQComponentName &  component,
const std::string &  iface,
const std::string &  subtopic = "*" 
)

Same as above but returns a string. Equivalent to calling:

orcaice::toString( orcaice::toTopic( component, ifaceName, subtopic ) );
template<class ConsumerPrxType , class DataType >
void orcaice::tryPushToIceStormWithReconnect ( orcaice::Context context,
ConsumerPrxType &  publisherPrx,
const DataType &  data,
IceStorm::TopicPrx &  topicPrx,
const std::string &  topicName 
) [inline]

Tries to push to IceStorm. If fails tries to reconnect to IceStorm once. If reconnects successfully, pushes the data, if not, ignores the problem until the next time. Catches all exceptions.

Works only for ConsumerPrxType which has a function setData( DataType ). For non-standard consumers, copy and modify this implementation. (In this case you probably do not need this function to be templated).

References orcaice::Context::communicator(), and orcaice::Context::tracer().

void orcaice::tryRemoveInterface ( orcaice::Context context,
const std::string &  interfaceName 
)

Remove the interface from the adapter if possible. If something goes wrong, fails silently.

std::string orcaice::warnMissingProperty ( const std::string &  info,
const std::string &  prop,
bool  fatal = false 
)

Returns standardized text which warns that certain information is missing because a configuration property is not defined or is null. If fatal is TRUE, the message adds that "operation cannot continue".

std::string orcaice::warnMissingProperty ( const std::string &  key,
bool  fatal = false 
)

Returns standardized text which warns that a configuration property is not defined or is null. If fatal is TRUE, the message adds that "operation cannot continue".

std::string orcaice::warnMissingPropertyWithDefault ( const std::string &  info,
const std::string &  prop,
const std::string &  defaultValue 
)

Returns standardized text which warns that certain information is missing because a configuration property is not defined or is null. Also informs that the specified default value is used instead.

std::string orcaice::warnMissingPropertyWithDefault ( const std::string &  key,
const std::string &  defaultValue 
)

Returns standardized text which warns that a configuration property is not defined or is null. Also informs that the specified default value is used instead.

 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5