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 Project Download Mailing lists
|
tracerI.h00001 /* 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_TRACER_I_H 00012 #define ORCAICE_TRACER_I_H 00013 00014 #include <orca/tracer.h> 00015 #include <hydroiceutil/localtracer.h> 00016 #include "networktracesender.h" 00017 #include <IceStorm/IceStorm.h> 00018 00019 namespace orcaice 00020 { 00021 namespace detail 00022 { 00023 00024 class TracerI : public virtual orca::Tracer, public hydroiceutil::LocalTracer 00025 { 00026 public: 00027 TracerI( const orcaice::Context & context ); 00028 virtual ~TracerI(); 00029 00030 // orca::Tracer interface 00031 00032 virtual ::orca::TracerVerbosityConfig getVerbosity( const ::Ice::Current& = ::Ice::Current()) const; 00033 00034 virtual void setVerbosity( const ::orca::TracerVerbosityConfig&, const ::Ice::Current& = ::Ice::Current()); 00035 00036 // subscribe/unsubscribe functions. 00037 virtual void subscribeForComponentMessages(const ::orca::TracerConsumerPrx &subscriber, 00038 const ::Ice::Current& = ::Ice::Current()) 00039 { subscribe( componentTraceSender_, subscriber ); } 00040 virtual void unsubscribeForComponentMessages(const ::orca::TracerConsumerPrx &subscriber, 00041 const ::Ice::Current& = ::Ice::Current()) 00042 { unsubscribe( componentTraceSender_, subscriber ); } 00043 virtual void subscribeForPlatformInfoMessages(const ::orca::TracerConsumerPrx &subscriber, 00044 const ::Ice::Current& = ::Ice::Current()) 00045 { subscribe( platformInfoSender_, subscriber ); } 00046 virtual void unsubscribeForPlatformInfoMessages(const ::orca::TracerConsumerPrx &subscriber, 00047 const ::Ice::Current& = ::Ice::Current()) 00048 { unsubscribe( platformInfoSender_, subscriber ); } 00049 virtual void subscribeForPlatformWarningMessages(const ::orca::TracerConsumerPrx &subscriber, 00050 const ::Ice::Current& = ::Ice::Current()) 00051 { subscribe( platformWarningSender_, subscriber ); } 00052 virtual void unsubscribeForPlatformWarningMessages(const ::orca::TracerConsumerPrx &subscriber, 00053 const ::Ice::Current& = ::Ice::Current()) 00054 { unsubscribe( platformWarningSender_, subscriber ); } 00055 virtual void subscribeForPlatformErrorMessages(const ::orca::TracerConsumerPrx &subscriber, 00056 const ::Ice::Current& = ::Ice::Current()) 00057 { subscribe( platformErrorSender_, subscriber ); } 00058 virtual void unsubscribeForPlatformErrorMessages(const ::orca::TracerConsumerPrx &subscriber, 00059 const ::Ice::Current& = ::Ice::Current()) 00060 { unsubscribe( platformErrorSender_, subscriber ); } 00061 00062 // gbxsickacfr::gbxutilacfr::Tracer interface 00063 // reimplement from LocalTracer because we are adding toNetwork() option 00064 00065 virtual void info( const std::string &message, int level=1 ); 00066 00067 virtual void warning( const std::string &message, int level=1 ); 00068 00069 virtual void error( const std::string &message, int level=1 ); 00070 00071 virtual void debug( const std::string &message, int level=1 ); 00072 00073 private: 00074 00075 void subscribe( NetworkTraceSender *&sender, const ::orca::TracerConsumerPrx &subscriber ); 00076 void unsubscribe( NetworkTraceSender *sender, const ::orca::TracerConsumerPrx &subscriber ); 00077 00078 // to network 00079 void toNetwork( gbxsickacfr::gbxutilacfr::Tracer::TraceType traceType, 00080 const std::string& message, 00081 int level ); 00082 void setupAndConnectNetworkSenders(); 00083 void trySetupNetworkTraceSender( NetworkTraceSender *&sender, 00084 std::string topic, 00085 bool isTracerTopicRequired ); 00086 void icestormConnectFailed( const std::string &topicName, 00087 bool isTracerTopicRequired ); 00088 std::string categoryToString( gbxsickacfr::gbxutilacfr::Tracer::TraceType category ); 00089 00090 // Responsible for sending messages to the component's tracer topic 00091 NetworkTraceSender *componentTraceSender_; 00092 00093 // Responsible for sending messages to the platform's info/warning/error topics 00094 NetworkTraceSender *platformInfoSender_; 00095 NetworkTraceSender *platformWarningSender_; 00096 NetworkTraceSender *platformErrorSender_; 00097 00098 orcaice::Context context_; 00099 }; 00100 00101 } // namespace 00102 } // namespace 00103 00104 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)