orca-robotics


INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

REPOSITORY
Interfaces
Components
Libraries
Utilities
Software Map

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard
Wiki
login/pass: orca/orca

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

context.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
00005  *
00006  * This copy of Orca is licensed to you under the terms described in
00007  * the LICENSE file included in this distribution.
00008  *
00009  */
00010 
00011 #ifndef ORCAICE_COMPONENT_CONTEXT_H
00012 #define ORCAICE_COMPONENT_CONTEXT_H
00013 
00014 #include <Ice/Ice.h>
00015 
00016 #include <orca/ocm.h>
00017 #include <orcaice/home.h>
00018 #include <gbxsickacfr/gbxutilacfr/tracer.h>
00019 #include <gbxsickacfr/gbxutilacfr/status.h>
00020 #include <hydroutil/history.h>
00021 #include <hydroutil/context.h>
00022 
00023 namespace orcaice
00024 {
00025 
00026 class Component;
00027 
00051 class Context
00052 {
00053 friend class Component;
00054 
00055 public:
00056     // We need the empty constructor because the original one is constucted a bit at a time
00057     // during component initialization.
00058     // We don't document this constuctor because the user typically only sees the copy constructor.
00059     Context();
00060 
00062     const std::string&     tag() const { return tag_; };
00063 
00065     const orca::FQComponentName& name() const { return name_; };
00066 
00070     bool                   isApplication() const { return isApplication_; };
00071 
00073     Ice::CommunicatorPtr   communicator() const { return communicator_; };
00074 
00076     Ice::ObjectAdapterPtr  adapter() const { return adapter_; };
00077 
00080     Ice::PropertiesPtr     properties() const { return communicator_->getProperties(); };
00081 
00083     orcaice::Home&         home() const { return *home_; };
00085     gbxsickacfr::gbxutilacfr::Tracer&     tracer() const { return *tracer_; };
00087     gbxsickacfr::gbxutilacfr::Status&     status() const { return *status_; };
00089     hydroutil::History&    history() const { return *history_; };
00090 
00091 
00095     void activate();
00096 
00098     void shutdown();
00099 
00100     // WARNING to internal developers:
00101     // Do not call these functions before the context is fully initialized, i.e.
00102     // before Component::start() is called.
00108     hydroutil::Context toHydroContext( const std::string &prefixToStrip ) const;
00109 
00112     hydroutil::Context toHydroContext() const;
00113 
00114 private:
00115 
00116     // this function should only be called by Component (it can because it's a friend)
00117     void init( const orca::FQComponentName& name,
00118                const bool isApp,
00119                const Ice::ObjectAdapterPtr& adapter,
00120                orcaice::Component* comp  );
00121 
00122     std::string            tag_;
00123     orca::FQComponentName  name_;
00124     bool                   isApplication_;
00125     Ice::CommunicatorPtr   communicator_;
00126     Ice::ObjectAdapterPtr  adapter_;
00127 
00128     // need this pointer to call activate()
00129     Component*             component_; 
00130 
00131     // these could be auto_ptr's
00132     orcaice::Home*         home_;
00133     gbxsickacfr::gbxutilacfr::Tracer*     tracer_;
00134     gbxsickacfr::gbxutilacfr::Status*     status_;
00135     hydroutil::History*    history_;
00136 };
00137 
00138 } // end namespace
00139 
00140 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5