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::Context Class Reference

Component's naming and networking information. More...

#include <context.h>

List of all members.

Public Member Functions

const std::string & tag () const
 Component's tag used in configuration files.
const orca::FQComponentName & name () const
 Component's fully-qualified name given to the Registry.
bool isApplication () const
 Is this component executed inside and application or a service? Returns TRUE if this instance of the Component is used in a stand-alone application. Otherwise, returns FALSE, meaning that it's used inside an IceBox service.
Ice::CommunicatorPtr communicator () const
 Returns smart pointer to the component's communicator.
Ice::ObjectAdapterPtr adapter () const
 Returns smart pointer to the component's adapter.
Ice::PropertiesPtr properties () const
orcaice::Homehome () const
 Access to setting home information.
gbxutilacfr::Tracer & tracer () const
 Access tracing functions.
gbxutilacfr::Status & status () const
 Access status functions.
hydroutil::Historyhistory () const
 Access history functions.
void activate ()
bool isDeactivating ()
void shutdown () const
hydroutil::Context toHydroContext (const std::string &prefixToStrip) const
hydroutil::Context toHydroContext () const
std::string toString () const
 Returns debugging string describing all contents.

Detailed Description

Component's naming and networking information.

Contains pointers to component's registered name plus its communicator, adapter, etc. It makes it easy to pass all this information to the network and hardware handlers from the class derived from Component.

A note on thread safety. None of access functions are thread-safe. However, all object which are referenced (with pointers and smart pointers) are themselves thread-safe.

This means that once a copy of of Context is created, it is safe to use it from different threads. Pass context by const reference and store a copy, e.g. a class definition would look like this:

class MyClass
{
public:
    MyClass( const orcaice::Context & context )
        : context_(context) {};
private:
    orcaice::Context context_;
}

Member Function Documentation

void orcaice::Context::activate (  ) 

Actiates server functionality of the component. This function is useful when component activation (technically Ice::ObjectAdapter activation) must be delayed until after something is initialized in the child thread.

It is safe to call this function multiple times (activating an active adapter has no effect, sees Ice Manual sec. 32.4.5 Adapter States).

References properties().

Referenced by orcaice::Component::activate().

bool orcaice::Context::isDeactivating (  ) 

Returns TRUE if the component is in the process of deactivating itself (the communicator is already destroyed).

References adapter().

Ice::PropertiesPtr orcaice::Context::properties (  )  const [inline]

Convenience function which returns smart pointer to the component's properties. Same as calling communicator()->getProperties()

Referenced by activate(), toHydroContext(), and toString().

void orcaice::Context::shutdown (  )  const

Triggers component shutdown.

Do not call this from inside functions implementing Ice remote calls. (alexm: this restriction may be outdated since we now call Communicator::shutdown() instead of destroy().)

References communicator(), isApplication(), and tracer().

hydroutil::Context orcaice::Context::toHydroContext (  )  const

Conveniance function which is a shortcut for the function above with prefixToStrip = tag()+".Config."

References tag().

hydroutil::Context orcaice::Context::toHydroContext ( const std::string &  prefixToStrip  )  const

Repackages itself into the form useful for initializing Hydro drivers. Strips 'prefixToStrip' from the front of all properties. Does not copy properties which do not begin with prefixToStrip. Transfers the following config parameters from Orca configs to Hydro configs:

  • Orca.Warn.DefaultProperty

References properties(), status(), tracer(), and hydroutil::Properties::Config::warnDefaultProperty.


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

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


Generated for Orca Robotics by  doxygen 1.4.5