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
|
tracerImpl.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 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_TRACER_IMPL_H 00012 #define ORCAICE_TRACER_IMPL_H 00013 00014 #include <memory> 00015 #include <hydroiceutil/localtracer.h> 00016 #include <gbxsickacfr/gbxiceutilacfr/store.h> 00017 00018 #include <orca/tracer.h> 00019 #include <orcaice/topichandler.h> 00020 00021 // class gbxiceutilacfr::Thread; 00022 00023 namespace orcaice 00024 { 00025 namespace detail 00026 { 00027 00028 class TracerImpl : public hydroiceutil::LocalTracer, public IceUtil::Shared 00029 { 00030 friend class TracerI; 00031 00032 public: 00033 TracerImpl( const orcaice::Context & context ); 00034 ~TracerImpl(); 00035 00036 void updateContext( const orcaice::Context& context ) { context_ = context; }; 00037 void initInterface(); 00038 // void initInterface( gbxutilacfr::Stoppable* activity, const std::string& subsysName="", int retryInterval=2 ); 00039 00040 private: 00041 00042 // from LocalTracer 00043 virtual void toNetwork( gbxutilacfr::TraceType traceType, const std::string& message, int level ); 00044 00045 // remote call implementations, mimic (but do not inherit) the orca interface 00046 ::orca::TracerVerbosityConfig internalGetVerbosity(); 00047 void internalSetVerbosity( const ::orca::TracerVerbosityConfig& config ); 00048 IceStorm::TopicPrx internalSubscribe(const ::orca::TracerConsumerPrx&); 00049 00050 // tracer service is special: it can be self-referencial, i.e. errors during initialization 00051 // will produce traces which will lead to more errors. 00052 // With this thread-safe flag, traces will not be published to the network until full initialization. 00053 gbxiceutilacfr::Store<bool> isInitialized_; 00054 00055 typedef TopicHandler<orca::TracerConsumerPrx,orca::TracerData> TracerTopicHandler; 00056 std::auto_ptr<TracerTopicHandler> topicHandler_; 00057 void initTopicHandler(); 00058 00059 // Hang onto this so we can remove from the adapter and control when things get deleted 00060 Ice::ObjectPtr ptr_; 00061 const std::string interfaceName_; 00062 orcaice::Context context_; 00063 }; 00064 00065 typedef IceUtil::Handle<TracerImpl> TracerImplPtr; 00066 00067 } // namespace 00068 } // namespace 00069 00070 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)