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 Project Download Mailing lists
|
hydrolibs/hydroutil/context.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This distribution is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef HYDROUTIL_CONTEXT_H 00012 #define HYDROUTIL_CONTEXT_H 00013 00014 #include <string> 00015 #include <hydroutil/properties.h> 00016 #include <gbxutilacfr/tracer.h> 00017 #include <gbxutilacfr/status.h> 00018 #include <hydroportability/sharedlib.h> 00019 00020 namespace hydroutil 00021 { 00022 00045 class SOEXPORT Context 00046 { 00047 00048 public: 00050 Context( const hydroutil::Properties& props, gbxutilacfr::Tracer& tr, gbxutilacfr::Status& st ) : 00051 properties_(props), 00052 tracer_(&tr), 00053 status_(&st) {}; 00054 00056 const hydroutil::Properties& properties() const { return properties_; }; 00058 hydroutil::Properties& properties() { return properties_; }; 00060 gbxutilacfr::Tracer& tracer() const { return *tracer_; }; 00062 gbxutilacfr::Status& status() const { return *status_; }; 00063 00064 private: 00065 // this is our own copy of properties (they are not shared) 00066 hydroutil::Properties properties_; 00067 // Tracer and Status objects are shared 00068 // we store pointers but return references. 00069 // it's possible to store references but then a custom copy constructor needs to be defined 00070 // see http://www.dbforums.com/archive/index.php/t-660589.html 00071 gbxutilacfr::Tracer* tracer_; 00072 gbxutilacfr::Status* status_; 00073 }; 00074 00075 } // end namespace 00076 00077 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)