From: <rus...@us...> - 2008-06-04 05:37:27
|
Revision: 154 http://gearbox.svn.sourceforge.net/gearbox/?rev=154&view=rev Author: russo2503v Date: 2008-06-03 22:37:33 -0700 (Tue, 03 Jun 2008) Log Message: ----------- promoted gbxutilacfr to the top level of src Modified Paths: -------------- gearbox/trunk/src/CMakeLists.txt gearbox/trunk/src/gbxsickacfr/CMakeLists.txt gearbox/trunk/src/gbxsickacfr/driver.cpp gearbox/trunk/src/gbxsickacfr/driver.h gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.cpp gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.h gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.cpp gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.h gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/buffertest.cpp gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/notifytest.cpp gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/safethreadtest.cpp gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/storetest.cpp gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/subsystemthreadtest.cpp gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/threadtest.cpp gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.cpp gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.h gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.cpp gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.h gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h gearbox/trunk/src/gbxsickacfr/messages.cpp gearbox/trunk/src/gbxsickacfr/test/test.cpp gearbox/trunk/src/gbxutilacfr/CMakeLists.txt gearbox/trunk/src/gbxutilacfr/exceptions.cpp gearbox/trunk/src/gbxutilacfr/exceptions.h gearbox/trunk/src/gbxutilacfr/gbxutilacfr.h gearbox/trunk/src/gbxutilacfr/status.h gearbox/trunk/src/gbxutilacfr/substatus.h gearbox/trunk/src/gbxutilacfr/test/mathtest.cpp gearbox/trunk/src/gbxutilacfr/tokenise.cpp gearbox/trunk/src/gbxutilacfr/tokenise.h gearbox/trunk/src/gbxutilacfr/tracer.h gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp gearbox/trunk/src/gbxutilacfr/trivialstatus.h gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp gearbox/trunk/src/gbxutilacfr/trivialtracer.h gearbox/trunk/submitted/gbxgarminacfr/driver.cpp gearbox/trunk/submitted/gbxgarminacfr/driver.h gearbox/trunk/submitted/gbxgarminacfr/nmea.cpp gearbox/trunk/submitted/gbxgarminacfr/test/test.cpp Added Paths: ----------- gearbox/trunk/src/gbxutilacfr/ gearbox/trunk/src/gbxutilacfr/doc.dox Removed Paths: ------------- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/ Modified: gearbox/trunk/src/CMakeLists.txt =================================================================== --- gearbox/trunk/src/CMakeLists.txt 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/CMakeLists.txt 2008-06-04 05:37:33 UTC (rev 154) @@ -8,5 +8,6 @@ ADD_SUBDIRECTORY( basicexample ) ADD_SUBDIRECTORY( gbxadvancedexample ) ADD_SUBDIRECTORY( gbxserialacfr ) +ADD_SUBDIRECTORY( gbxutilacfr ) ADD_SUBDIRECTORY( gbxsickacfr ) ADD_SUBDIRECTORY( urg_nz ) Modified: gearbox/trunk/src/gbxsickacfr/CMakeLists.txt =================================================================== --- gearbox/trunk/src/gbxsickacfr/CMakeLists.txt 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/CMakeLists.txt 2008-06-04 05:37:33 UTC (rev 154) @@ -8,15 +8,14 @@ INCLUDE( ${GBX_CMAKE_DIR}/FindIceUtil.cmake ) GBX_REQUIRE_VAR( build LIB ${lib_name} ICEUTIL_FOUND "libIceUtil not found" ) -SET( proj_libs GbxSerialAcfr ) -GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${proj_libs} ) +SET( int_libs GbxUtilAcfr GbxSerialAcfr ) +GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${int_libs} ) # these are built internally -SET( int_libs GbxUtilAcfr GbxIceUtilAcfr GbxSerialDeviceAcfr ) +SET( private_libs GbxIceUtilAcfr GbxSerialDeviceAcfr ) IF( build ) - ADD_SUBDIRECTORY( gbxutilacfr ) ADD_SUBDIRECTORY( gbxiceutilacfr ) ADD_SUBDIRECTORY( gbxserialdeviceacfr ) @@ -25,7 +24,7 @@ FILE( GLOB hdrs *.h ) FILE( GLOB srcs *.cpp ) - SET( dep_libs ${proj_libs} ${int_libs} ) + SET( dep_libs ${int_libs} ${private_libs} ) GBX_ADD_LIBRARY( ${lib_name} SHARED ${srcs} ) TARGET_LINK_LIBRARIES( ${lib_name} ${dep_libs} ) Modified: gearbox/trunk/src/gbxsickacfr/driver.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/driver.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/driver.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -11,7 +11,7 @@ #include <iostream> #include <cstring> -#include <gbxsickacfr/gbxutilacfr/gbxutilacfr.h> +#include <gbxutilacfr/gbxutilacfr.h> #include <gbxsickacfr/gbxiceutilacfr/gbxiceutilacfr.h> #include "driver.h" Modified: gearbox/trunk/src/gbxsickacfr/driver.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/driver.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/driver.h 2008-06-04 05:37:33 UTC (rev 154) @@ -12,8 +12,8 @@ #define GBX_SICK_ACFR_H #include <gbxsickacfr/serialhandler.h> -#include <gbxsickacfr/gbxutilacfr/tracer.h> -#include <gbxsickacfr/gbxutilacfr/status.h> +#include <gbxutilacfr/tracer.h> +#include <gbxutilacfr/status.h> #include <memory> namespace gbxsickacfr { Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h 2008-06-04 05:37:33 UTC (rev 154) @@ -12,13 +12,12 @@ #define GBXICEUTILACFR_BUFFER_H #include <queue> -#include <gbxsickacfr/gbxutilacfr/exceptions.h> +#include <gbxutilacfr/exceptions.h> #include <IceUtil/Monitor.h> #include <IceUtil/Mutex.h> #include <IceUtil/Time.h> -namespace gbxsickacfr { namespace gbxiceutilacfr { //! %Buffer type defines behavior when the buffer is full @@ -409,7 +408,6 @@ queue_.push_back( obj ); } -} } // end namespace #endif Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h 2008-06-04 05:37:33 UTC (rev 154) @@ -11,14 +11,13 @@ #ifndef GBXICEUTILACFR_NOTIFY_H #define GBXICEUTILACFR_NOTIFY_H -#include <gbxsickacfr/gbxutilacfr/exceptions.h> +#include <gbxutilacfr/exceptions.h> #include <iostream> // // note: this class can be libGbxUtilAcfr but we keep it with the other "data pattern" // classes: Store and Buffer. // -namespace gbxsickacfr { namespace gbxiceutilacfr { /*! @@ -64,7 +63,7 @@ bool hasNotifyHandler() { return hasNotifyHandler_; }; //! Forwards the @p obj to the data handler. - //! Raises gbxsickacfr::gbxutilacfr::Exception if the function is called when a notify handler has + //! Raises gbxutilacfr::Exception if the function is called when a notify handler has //! not been set. void set( const Type & obj ); @@ -96,7 +95,7 @@ void Notify<Type>::set( const Type & obj ) { if ( !hasNotifyHandler_ ) { - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO, "setting data when data handler has not been set" ); + throw gbxutilacfr::Exception( ERROR_INFO, "setting data when data handler has not been set" ); } internalSet( obj ); @@ -108,7 +107,6 @@ handler_->handleData( obj ); } -} } // end namespace #endif Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -13,11 +13,11 @@ #include "safethread.h" -using namespace gbxsickacfr::gbxiceutilacfr; +using namespace gbxiceutilacfr; using namespace std; -SafeThread::SafeThread( gbxsickacfr::gbxutilacfr::Tracer& tracer ) : +SafeThread::SafeThread( gbxutilacfr::Tracer& tracer ) : tracer_(tracer) { } Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.h 2008-06-04 05:37:33 UTC (rev 154) @@ -12,9 +12,8 @@ #define GBXICEUTILACFR_SAFE_THREAD_H #include <gbxsickacfr/gbxiceutilacfr/thread.h> -#include <gbxsickacfr/gbxutilacfr/tracer.h> +#include <gbxutilacfr/tracer.h> -namespace gbxsickacfr { namespace gbxiceutilacfr { /*! @@ -45,7 +44,7 @@ { public: //! Needs an implementation of Tracer to report possible exceptions. - SafeThread( gbxsickacfr::gbxutilacfr::Tracer& tracer ); + SafeThread( gbxutilacfr::Tracer& tracer ); // from IceUtil::Thread (from which HydroUtil::Thread is derived) //! This implementation calls walk(), catches all possible exceptions, prints out @@ -57,12 +56,11 @@ virtual void walk()=0; private: - gbxsickacfr::gbxutilacfr::Tracer& tracer_; + gbxutilacfr::Tracer& tracer_; }; //! A smart pointer to the SafeThread class. typedef IceUtil::Handle<SafeThread> SafeThreadPtr; -} } // end namespace #endif Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2008-06-04 05:37:33 UTC (rev 154) @@ -11,13 +11,12 @@ #ifndef GBXICEUTILACFR_STORE_H #define GBXICEUTILACFR_STORE_H -#include <gbxsickacfr/gbxutilacfr/exceptions.h> +#include <gbxutilacfr/exceptions.h> #include <IceUtil/Monitor.h> #include <IceUtil/Mutex.h> #include <IceUtil/Time.h> -namespace gbxsickacfr { namespace gbxiceutilacfr { /*! @@ -31,7 +30,7 @@ * is non-empty. * * Write to it with set(). Read its contents with get(). Trying to read from - * an empty Store raises an gbxsickacfr::gbxutilacfr::Exception. + * an empty Store raises an gbxutilacfr::Exception. * * @note Replaces the deprecated Proxy class. * @see Buffer, Notify @@ -57,7 +56,7 @@ //! Returns the contents of the Store. This operation makes the data in the Store //! "not new", i.e. @ref isNewData returns FALSE. Calls to get() when the Store is empty - //! raises an gbxsickacfr::gbxutilacfr::Exception exception. + //! raises an gbxutilacfr::Exception exception. void get( Type & obj ) const; /*! @@ -140,7 +139,7 @@ } else { - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO, "trying to read from an empty Store." ); + throw gbxutilacfr::Exception( ERROR_INFO, "trying to read from an empty Store." ); } } @@ -240,7 +239,6 @@ obj_ = obj; } -} } // end namespace #endif Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -13,7 +13,7 @@ #include "subsystemthread.h" -using namespace gbxsickacfr::gbxiceutilacfr; +using namespace gbxiceutilacfr; using namespace std; Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/subsystemthread.h 2008-06-04 05:37:33 UTC (rev 154) @@ -12,11 +12,10 @@ #define GBXICEUTILACFR_SUBSYSTEM_THREAD_H #include <gbxsickacfr/gbxiceutilacfr/thread.h> -#include <gbxsickacfr/gbxutilacfr/substatus.h> -#include <gbxsickacfr/gbxutilacfr/status.h> -#include <gbxsickacfr/gbxutilacfr/tracer.h> +#include <gbxutilacfr/substatus.h> +#include <gbxutilacfr/status.h> +#include <gbxutilacfr/tracer.h> -namespace gbxsickacfr { namespace gbxiceutilacfr { /*! @@ -72,7 +71,6 @@ //! A smart pointer to the SubsystemThread class. typedef IceUtil::Handle<SubsystemThread> SubsystemThreadPtr; -} } // end namespace #endif Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/buffertest.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/buffertest.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/buffertest.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -16,13 +16,13 @@ int main(int argc, char * argv[]) { - gbxsickacfr::gbxiceutilacfr::Buffer<double> buffer(-1, gbxsickacfr::gbxiceutilacfr::BufferTypeCircular); + gbxiceutilacfr::Buffer<double> buffer(-1, gbxiceutilacfr::BufferTypeCircular); double data = 20.0; double copy = -1.0; cout<<"testing default constructor and depth() and type() ... "; - if ( buffer.depth()!=-1 || buffer.type()!=gbxsickacfr::gbxiceutilacfr::BufferTypeCircular ) { - cout<<"failed. depth: exp=-1 got="<<buffer.depth()<<" type: exp="<<(int)gbxsickacfr::gbxiceutilacfr::BufferTypeCircular<<" got="<<(int)buffer.type()<<endl; + if ( buffer.depth()!=-1 || buffer.type()!=gbxiceutilacfr::BufferTypeCircular ) { + cout<<"failed. depth: exp=-1 got="<<buffer.depth()<<" type: exp="<<(int)gbxiceutilacfr::BufferTypeCircular<<" got="<<(int)buffer.type()<<endl; return EXIT_FAILURE; } cout<<"ok"<<endl; @@ -35,7 +35,7 @@ cout<<"failed. empty buffer, should've caught exception"<<endl; return EXIT_FAILURE; } - catch ( const gbxsickacfr::gbxutilacfr::Exception & ) + catch ( const gbxutilacfr::Exception & ) { ; // ok } @@ -48,7 +48,7 @@ cout<<"failed. empty buffer, should've caught exception"<<endl; return EXIT_FAILURE; } - catch ( const gbxsickacfr::gbxutilacfr::Exception & ) + catch ( const gbxutilacfr::Exception & ) { ; // ok } @@ -95,7 +95,7 @@ { buffer.get( copy ); } - catch ( const gbxsickacfr::gbxutilacfr::Exception & ) + catch ( const gbxutilacfr::Exception & ) { cout<<"failed. should be a non-empty buffer."<<endl; return EXIT_FAILURE; @@ -119,7 +119,7 @@ for ( int i=0; i < size; i++ ) buffer.getAndPop( data ); } - catch ( const gbxsickacfr::gbxutilacfr::Exception & ) + catch ( const gbxutilacfr::Exception & ) { cout<<"failed. should be a non-empty buffer."<<endl; return EXIT_FAILURE; @@ -131,7 +131,7 @@ cout<<"ok"<<endl; cout<<"testing circular buffer behavior ..."; - buffer.configure( 1, gbxsickacfr::gbxiceutilacfr::BufferTypeCircular ); + buffer.configure( 1, gbxiceutilacfr::BufferTypeCircular ); //this fills the buffer buffer.push( 0 ); // this should over-write @@ -144,7 +144,7 @@ cout<<"ok"<<endl; cout<<"testing queue buffer behavior ..."; - buffer.configure( 1, gbxsickacfr::gbxiceutilacfr::BufferTypeQueue ); + buffer.configure( 1, gbxiceutilacfr::BufferTypeQueue ); //this fills the buffer buffer.push( 0 ); // this should be ignored @@ -156,8 +156,8 @@ } cout<<"ok"<<endl; - cout<<"testing configure() with gbxsickacfr::gbxiceutilacfr::BufferTypeCircular ... "; - buffer.configure( 300, gbxsickacfr::gbxiceutilacfr::BufferTypeCircular ); + cout<<"testing configure() with gbxiceutilacfr::BufferTypeCircular ... "; + buffer.configure( 300, gbxiceutilacfr::BufferTypeCircular ); for ( int i=0; i<400; ++i ) { buffer.push( data ); } @@ -176,8 +176,8 @@ } cout<<"ok"<<endl; - cout<<"testing configure() with gbxsickacfr::gbxiceutilacfr::BufferTypeQueue ... "; - buffer.configure( 300, gbxsickacfr::gbxiceutilacfr::BufferTypeQueue ); + cout<<"testing configure() with gbxiceutilacfr::BufferTypeQueue ... "; + buffer.configure( 300, gbxiceutilacfr::BufferTypeQueue ); for ( int i=0; i<400; ++i ) { buffer.push( data ); } Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/notifytest.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/notifytest.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/notifytest.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -14,7 +14,7 @@ using namespace std; -class TestNotifyHandler : public gbxsickacfr::gbxiceutilacfr::NotifyHandler<double> +class TestNotifyHandler : public gbxiceutilacfr::NotifyHandler<double> { public: virtual void handleData( const double& obj ) @@ -27,10 +27,10 @@ int main(int argc, char * argv[]) { - gbxsickacfr::gbxiceutilacfr::Notify<double> notify; + gbxiceutilacfr::Notify<double> notify; double data = 2.0; - gbxsickacfr::gbxiceutilacfr::NotifyHandler<double>* emptyHandler = 0; + gbxiceutilacfr::NotifyHandler<double>* emptyHandler = 0; TestNotifyHandler testHandler; cout<<"testing set() ... "; @@ -41,7 +41,7 @@ cout<<"failed. empty notify handler, should've caught exception"<<endl; return EXIT_FAILURE; } - catch ( const gbxsickacfr::gbxutilacfr::Exception & ) + catch ( const gbxutilacfr::Exception & ) { ; // ok } @@ -72,7 +72,7 @@ { notify.set( data ); } - catch ( const gbxsickacfr::gbxutilacfr::Exception & ) + catch ( const gbxutilacfr::Exception & ) { cout<<"failed. shouldn't have caught exception"<<endl; return EXIT_FAILURE; Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/safethreadtest.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/safethreadtest.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/safethreadtest.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -13,15 +13,15 @@ #include <IceUtil/Time.h> #include <gbxsickacfr/gbxiceutilacfr/safethread.h> -#include <gbxsickacfr/gbxutilacfr/trivialtracer.h> +#include <gbxutilacfr/trivialtracer.h> using namespace std; -class TestThread : public gbxsickacfr::gbxiceutilacfr::SafeThread +class TestThread : public gbxiceutilacfr::SafeThread { public: // it's safe to pass zero pointers - TestThread( gbxsickacfr::gbxutilacfr::Tracer& tracer ) : + TestThread( gbxutilacfr::Tracer& tracer ) : SafeThread( tracer ) {}; virtual void walk() { @@ -31,11 +31,11 @@ }; }; -class TestThreadWithThrow : public gbxsickacfr::gbxiceutilacfr::SafeThread +class TestThreadWithThrow : public gbxiceutilacfr::SafeThread { public: // it's safe to pass zero pointers - TestThreadWithThrow( gbxsickacfr::gbxutilacfr::Tracer& tracer ) : + TestThreadWithThrow( gbxutilacfr::Tracer& tracer ) : SafeThread( tracer ) {}; virtual void walk() { @@ -45,11 +45,11 @@ int main(int argc, char * argv[]) { - gbxsickacfr::gbxutilacfr::TrivialTracer tracer; + gbxutilacfr::TrivialTracer tracer; cout<<"testing start() and stop()... "; { - gbxsickacfr::gbxiceutilacfr::Thread* t=0; + gbxiceutilacfr::Thread* t=0; try { t = new TestThread( tracer ); @@ -69,7 +69,7 @@ cout<<"testing SafeThread() with exceptions... "; { - gbxsickacfr::gbxiceutilacfr::Thread* t=0; + gbxiceutilacfr::Thread* t=0; try { t = new TestThreadWithThrow( tracer ); Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/storetest.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/storetest.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/storetest.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -16,7 +16,7 @@ int main(int argc, char * argv[]) { - gbxsickacfr::gbxiceutilacfr::Store<double> store; + gbxiceutilacfr::Store<double> store; double data = 20.0; double copy = -1.0; @@ -28,7 +28,7 @@ cout<<"failed. empty store, should've caught exception"<<endl; return EXIT_FAILURE; } - catch ( const gbxsickacfr::gbxutilacfr::Exception & ) + catch ( const gbxutilacfr::Exception & ) { ; // ok } @@ -63,7 +63,7 @@ { store.get( copy ); } - catch ( const gbxsickacfr::gbxutilacfr::Exception & ) + catch ( const gbxutilacfr::Exception & ) { cout<<"failed. should be a non-empty store."<<endl; return EXIT_FAILURE; Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/subsystemthreadtest.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/subsystemthreadtest.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/subsystemthreadtest.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -13,16 +13,16 @@ #include <IceUtil/Time.h> #include <gbxsickacfr/gbxiceutilacfr/subsystemthread.h> -#include <gbxsickacfr/gbxutilacfr/trivialtracer.h> -#include <gbxsickacfr/gbxutilacfr/trivialstatus.h> +#include <gbxutilacfr/trivialtracer.h> +#include <gbxutilacfr/trivialstatus.h> using namespace std; -class TestThread : public gbxsickacfr::gbxiceutilacfr::SubsystemThread +class TestThread : public gbxiceutilacfr::SubsystemThread { public: // it's safe to pass zero pointers - TestThread( gbxsickacfr::gbxutilacfr::Tracer& tracer, gbxsickacfr::gbxutilacfr::Status& status ) : + TestThread( gbxutilacfr::Tracer& tracer, gbxutilacfr::Status& status ) : SubsystemThread( tracer, status ) {}; virtual void walk() { @@ -32,11 +32,11 @@ }; }; -class TestThreadWithThrow : public gbxsickacfr::gbxiceutilacfr::SubsystemThread +class TestThreadWithThrow : public gbxiceutilacfr::SubsystemThread { public: // it's safe to pass zero pointers - TestThreadWithThrow( gbxsickacfr::gbxutilacfr::Tracer& tracer, gbxsickacfr::gbxutilacfr::Status& status ) : + TestThreadWithThrow( gbxutilacfr::Tracer& tracer, gbxutilacfr::Status& status ) : SubsystemThread( tracer, status ) {}; virtual void walk() { @@ -44,10 +44,10 @@ }; }; -class TestThreadWithTools : public gbxsickacfr::gbxiceutilacfr::SubsystemThread +class TestThreadWithTools : public gbxiceutilacfr::SubsystemThread { public: - TestThreadWithTools( gbxsickacfr::gbxutilacfr::Tracer& tracer, gbxsickacfr::gbxutilacfr::Status& status ) : + TestThreadWithTools( gbxutilacfr::Tracer& tracer, gbxutilacfr::Status& status ) : SubsystemThread( tracer, status, "MyName" ) { }; @@ -59,12 +59,12 @@ int main(int argc, char * argv[]) { - gbxsickacfr::gbxutilacfr::TrivialTracer tracer; - gbxsickacfr::gbxutilacfr::TrivialStatus status( tracer ); + gbxutilacfr::TrivialTracer tracer; + gbxutilacfr::TrivialStatus status( tracer ); cout<<"testing start() and stop()... "; { - gbxsickacfr::gbxiceutilacfr::Thread* t=0; + gbxiceutilacfr::Thread* t=0; try { t = new TestThread( tracer, status ); @@ -84,7 +84,7 @@ cout<<"testing SubsystemThread() with exceptions... "; { - gbxsickacfr::gbxiceutilacfr::Thread* t=0; + gbxiceutilacfr::Thread* t=0; try { t = new TestThreadWithThrow( tracer, status ); Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/threadtest.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/threadtest.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/threadtest.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -13,11 +13,11 @@ #include <IceUtil/Time.h> #include <gbxsickacfr/gbxiceutilacfr/thread.h> -#include <gbxsickacfr/gbxutilacfr/exceptions.h> +#include <gbxutilacfr/exceptions.h> using namespace std; -class TestThread : public gbxsickacfr::gbxiceutilacfr::Thread +class TestThread : public gbxiceutilacfr::Thread { public: virtual void run() @@ -28,7 +28,7 @@ }; }; -class TestThreadWithThrow : public gbxsickacfr::gbxiceutilacfr::Thread +class TestThreadWithThrow : public gbxiceutilacfr::Thread { public: TestThreadWithThrow( bool shouldIThrow ) @@ -46,7 +46,7 @@ }; }; -class TestThreadWithExit : public gbxsickacfr::gbxiceutilacfr::Thread +class TestThreadWithExit : public gbxiceutilacfr::Thread { public: TestThreadWithExit() : @@ -82,7 +82,7 @@ IceUtil::Mutex exitMutex_; }; -class TestThreadWithWait : public gbxsickacfr::gbxiceutilacfr::Thread +class TestThreadWithWait : public gbxiceutilacfr::Thread { public: virtual void run() @@ -91,12 +91,12 @@ }; }; -class TestThreadWithNap : public gbxsickacfr::gbxiceutilacfr::Thread +class TestThreadWithNap : public gbxiceutilacfr::Thread { public: virtual void run() { - gbxsickacfr::gbxiceutilacfr::checkedSleep( this, IceUtil::Time::seconds(5), 100 ); + gbxiceutilacfr::checkedSleep( this, IceUtil::Time::seconds(5), 100 ); }; }; @@ -104,7 +104,7 @@ { cout<<"testing start() and stop()... "; { - gbxsickacfr::gbxiceutilacfr::Thread* t=0; + gbxiceutilacfr::Thread* t=0; try { t = new TestThread; @@ -124,7 +124,7 @@ cout<<"testing start() and stop() with smart pointer ... "; { - gbxsickacfr::gbxiceutilacfr::ThreadPtr t; + gbxiceutilacfr::ThreadPtr t; try { t = new TestThread; @@ -162,7 +162,7 @@ { // works only with smart pointers because with dumb ones the threads self-destruct // and we can't examine their final state. - gbxsickacfr::gbxiceutilacfr::ThreadPtr t = new TestThreadWithExit; + gbxiceutilacfr::ThreadPtr t = new TestThreadWithExit; if ( t->isStopping()!=false || t->isAlive()!=false || t->isStarted()!=false ) { cout<<"failed"<<endl @@ -205,7 +205,7 @@ cout<<"testing waitForStop() ... "; { - gbxsickacfr::gbxiceutilacfr::ThreadPtr t = new TestThreadWithWait; + gbxiceutilacfr::ThreadPtr t = new TestThreadWithWait; t->start(); if ( t->isAlive()!=true ) { cout<<"failed"<<endl @@ -235,7 +235,7 @@ cout<<"testing stopAndJoin() with smart pointer ... "; { - gbxsickacfr::gbxiceutilacfr::ThreadPtr t = new TestThread; + gbxiceutilacfr::ThreadPtr t = new TestThread; t->start(); if ( t->isAlive()!=true ) { cout<<"failed"<<endl @@ -244,7 +244,7 @@ exit(EXIT_FAILURE); } - gbxsickacfr::gbxiceutilacfr::stopAndJoin( t ); + gbxiceutilacfr::stopAndJoin( t ); IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(150)); if ( t->isAlive()!=false ) { cout<<"failed"<<endl @@ -257,11 +257,11 @@ cout<<"testing checkedSleep() ... "; { - gbxsickacfr::gbxiceutilacfr::ThreadPtr t = new TestThreadWithNap; + gbxiceutilacfr::ThreadPtr t = new TestThreadWithNap; t->start(); IceUtil::Time stopTime = IceUtil::Time::now(); - gbxsickacfr::gbxiceutilacfr::stopAndJoin( t ); + gbxiceutilacfr::stopAndJoin( t ); IceUtil::Time joinTime = IceUtil::Time::now(); cout<<"time to stop = "<<(joinTime-stopTime).toDuration()<<endl; Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -9,11 +9,10 @@ */ #include <IceUtil/Time.h> -#include <gbxsickacfr/gbxutilacfr/exceptions.h> +#include <gbxutilacfr/exceptions.h> #include "thread.h" -namespace gbxsickacfr { namespace gbxiceutilacfr { Thread::Thread() : @@ -92,5 +91,4 @@ } } -} } // namespace Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.h 2008-06-04 05:37:33 UTC (rev 154) @@ -13,7 +13,6 @@ #include <IceUtil/Thread.h> -namespace gbxsickacfr { namespace gbxiceutilacfr { /*! @@ -115,7 +114,6 @@ //! this function will sleep for @ref checkIntervalMs. void checkedSleep( const gbxiceutilacfr::ThreadPtr& thread, IceUtil::Time duration, int checkIntervalMs=250 ); -} } // end namespace #endif Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -10,7 +10,6 @@ #include <gbxsickacfr/gbxiceutilacfr/timer.h> -namespace gbxsickacfr { namespace gbxiceutilacfr { Timer::Timer() @@ -38,5 +37,4 @@ return ( (IceUtil::Time::now() - time_).toSecondsDouble() ); } -} } // namespace Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.h 2008-06-04 05:37:33 UTC (rev 154) @@ -13,7 +13,6 @@ #include <IceUtil/Time.h> -namespace gbxsickacfr { namespace gbxiceutilacfr { /*! @@ -53,7 +52,6 @@ }; -} } // end namespace #endif Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h 2008-06-04 05:37:33 UTC (rev 154) @@ -11,7 +11,7 @@ #define GBXSERIALDEVICEACFR_SERIALDEVICEHANDLER_H #include <gbxserialacfr/serial.h> -#include <gbxsickacfr/gbxutilacfr/substatus.h> +#include <gbxutilacfr/substatus.h> #include <gbxsickacfr/gbxiceutilacfr/safethread.h> #include <gbxsickacfr/gbxiceutilacfr/buffer.h> #include <IceUtil/IceUtil.h> Modified: gearbox/trunk/src/gbxsickacfr/messages.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/messages.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/messages.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -14,7 +14,7 @@ #include <sstream> #include <iomanip> #include <IceUtil/Time.h> -#include <gbxsickacfr/gbxutilacfr/exceptions.h> +#include <gbxutilacfr/exceptions.h> #include <assert.h> using namespace std; Modified: gearbox/trunk/src/gbxsickacfr/test/test.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/test/test.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxsickacfr/test/test.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -17,9 +17,9 @@ #include <iostream> #include <sstream> #include <gbxsickacfr/driver.h> -#include <gbxsickacfr/gbxutilacfr/trivialtracer.h> -#include <gbxsickacfr/gbxutilacfr/trivialstatus.h> -#include <gbxsickacfr/gbxutilacfr/mathdefs.h> +#include <gbxutilacfr/trivialtracer.h> +#include <gbxutilacfr/trivialstatus.h> +#include <gbxutilacfr/mathdefs.h> using namespace std; @@ -75,8 +75,8 @@ cout << "Using configuration: " << config.toString() << endl; // Instantiate objects to handle messages from the driver - gbxsickacfr::gbxutilacfr::TrivialTracer tracer( debug ); - gbxsickacfr::gbxutilacfr::TrivialStatus status( tracer ); + gbxutilacfr::TrivialTracer tracer( debug ); + gbxutilacfr::TrivialStatus status( tracer ); // Instantiate the driver itself gbxsickacfr::Driver* device; Copied: gearbox/trunk/src/gbxutilacfr (from rev 153, gearbox/trunk/src/gbxsickacfr/gbxutilacfr) Modified: gearbox/trunk/src/gbxutilacfr/CMakeLists.txt =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/CMakeLists.txt 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/CMakeLists.txt 2008-06-04 05:37:33 UTC (rev 154) @@ -2,8 +2,7 @@ GBX_ADD_LICENSE( LGPL ) SET( build TRUE ) -# don't give user an option -# GBX_REQUIRE_OPTION( build LIB ${lib_name} ON ) +GBX_REQUIRE_OPTION( build LIB ${lib_name} ON ) IF( build ) @@ -17,7 +16,7 @@ GBX_ADD_LIBRARY( ${lib_name} SHARED ${srcs} ) - GBX_ADD_HEADERS( gbxsickacfr/gbxutilacfr ${hdrs} ) + GBX_ADD_HEADERS( gbxutilacfr ${hdrs} ) IF( GBX_BUILD_TESTS ) ADD_SUBDIRECTORY( test ) Added: gearbox/trunk/src/gbxutilacfr/doc.dox =================================================================== --- gearbox/trunk/src/gbxutilacfr/doc.dox (rev 0) +++ gearbox/trunk/src/gbxutilacfr/doc.dox 2008-06-04 05:37:33 UTC (rev 154) @@ -0,0 +1,52 @@ +/* + * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics + * http://gearbox.sf.net/ + * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp + * + * This distribution is licensed to you under the terms described in + * the LICENSE file included in this distribution. + * + */ + +/*! +@ingroup gbx_libs +@ingroup gbx_cpp +@ingroup gbx_linux +@defgroup gbx_library_gbxutilacfr GbxUtilAcfr +@brief ACFR driver for SICK laser range-finder. + +Utility functions and objects used accross ACFR libraries and drivers. + +@par Header file + +@verbatim +#include <gbxutilacfr/gbxutilacfr.h> +@endverbatim + +@par Style + See http://orca-robotics.sourceforge.net/orca/orca_doc_style.html + +@par Copyright + Alex Brooks, Alexei Makarenko, Tobias Kaupp + +@par Responsible Developer + Alex Makarenko + +@par License + LGPL + +@par Dependencies + +- none + +*/ + +/*! +@brief ACFR utilities +@namespace gbxutilacfr + +This namespace is part of a utility library. + +@see @ref gbx_library_gbxutilacfr + +*/ \ No newline at end of file Modified: gearbox/trunk/src/gbxutilacfr/exceptions.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/exceptions.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/exceptions.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -14,7 +14,6 @@ using namespace std; -namespace gbxsickacfr { namespace gbxutilacfr { Exception::Exception( const char *file, const char *line, const char *message ) @@ -53,5 +52,4 @@ message_ += +"): " + msgString + "\n"; } -} } // namespace Modified: gearbox/trunk/src/gbxutilacfr/exceptions.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/exceptions.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/exceptions.h 2008-06-04 05:37:33 UTC (rev 154) @@ -35,7 +35,6 @@ #include <exception> #include <string> -namespace gbxsickacfr { namespace gbxutilacfr { /*! @@ -80,7 +79,6 @@ : Exception( file, line, message ) {}; }; -} } // namespace Modified: gearbox/trunk/src/gbxutilacfr/gbxutilacfr.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/gbxutilacfr.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/gbxutilacfr.h 2008-06-04 05:37:33 UTC (rev 154) @@ -15,11 +15,11 @@ #ifndef GBXUTILACFR_GBXUTILACFRL_H #define GBXUTILACFR_GBXUTILACFRL_H -#include <gbxsickacfr/gbxutilacfr/tracer.h> -#include <gbxsickacfr/gbxutilacfr/status.h> -#include <gbxsickacfr/gbxutilacfr/exceptions.h> -#include <gbxsickacfr/gbxutilacfr/mathdefs.h> -// #include <gbxsickacfr/gbxutilacfr/stringutils.h> -// #include <gbxsickacfr/gbxutilacfr/sysutils.h> +#include <gbxutilacfr/tracer.h> +#include <gbxutilacfr/status.h> +#include <gbxutilacfr/exceptions.h> +#include <gbxutilacfr/mathdefs.h> +// #include <gbxutilacfr/stringutils.h> +// #include <gbxutilacfr/sysutils.h> #endif Modified: gearbox/trunk/src/gbxutilacfr/status.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/status.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/status.h 2008-06-04 05:37:33 UTC (rev 154) @@ -14,7 +14,6 @@ #include <string> #include <vector> -namespace gbxsickacfr { namespace gbxutilacfr { //! Possible subsystem status values @@ -47,7 +46,7 @@ float sinceHeartbeat; }; -/* +/*! @brief Local interface to component status. @par Overview @@ -89,7 +88,7 @@ virtual ~Status() {}; - /* + /*! Adds subsystem to the system status monitor. This command must be called before any other. I.e. all other status commands are ignored unless a subsystem with that name already exists. When trying to add a subsystem with an existing name, the existing @@ -103,50 +102,49 @@ */ virtual void addSubsystem( const std::string& subsystem, double maxHeartbeatIntervalSec=-1.0 )=0; - // Removes subsystem from the status monitor. This should be done for example, if one of - // the thread is shutting down or restarting. - // Throws gbxutilacfr::Exception if the subsystem does not exist. + //! Removes subsystem from the status monitor. This should be done for example, if one of + //! the thread is shutting down or restarting. + //! Throws gbxutilacfr::Exception if the subsystem does not exist. virtual void removeSubsystem( const std::string& subsystem )=0; - // Returns a list of subsystem names. + //! Returns a list of subsystem names. virtual std::vector<std::string> subsystems()=0; - // Returns status of subsystem with the given name. - // Throws gbxutilacfr::Exception when the specified subsystem does not exist. + //! Returns status of subsystem with the given name. + //! Throws gbxutilacfr::Exception when the specified subsystem does not exist. virtual SubsystemStatus subsystemStatus( const std::string& subsystem )=0; - // Modifies maximum expected interval between heartbeats (in seconds). - // When time since last heartbeat exceeds this, alarm is raised. - // Throws gbxutilacfr::Exception if the subsystem does not exist. + //! Modifies maximum expected interval between heartbeats (in seconds). + //! When time since last heartbeat exceeds this, alarm is raised. + //! Throws gbxutilacfr::Exception if the subsystem does not exist. virtual void setMaxHeartbeatInterval( const std::string& subsystem, double intervalSec )=0; - // Sets subsystem status to Initialising. Note that empty message is assumed if none is supplied. - // Throws gbxutilacfr::Exception if the subsystem does not exist. + //! Sets subsystem status to Initialising. Note that empty message is assumed if none is supplied. + //! Throws gbxutilacfr::Exception if the subsystem does not exist. virtual void initialising( const std::string& subsystem, const std::string& message="" )=0; - // Sets subsystem status to Ok. Note that empty message is assumed if none is supplied. - // Throws gbxutilacfr::Exception if the subsystem does not exist. + //! Sets subsystem status to Ok. Note that empty message is assumed if none is supplied. + //! Throws gbxutilacfr::Exception if the subsystem does not exist. virtual void ok( const std::string& subsystem, const std::string& message="" )=0; - // Sets subsystem status to Warning. - // Throws gbxutilacfr::Exception if the subsystem does not exist. + //! Sets subsystem status to Warning. + //! Throws gbxutilacfr::Exception if the subsystem does not exist. virtual void warning( const std::string& subsystem, const std::string& message )=0; - // Sets subsystem status to Fault. - // Throws gbxutilacfr::Exception if the subsystem does not exist. + //! Sets subsystem status to Fault. + //! Throws gbxutilacfr::Exception if the subsystem does not exist. virtual void fault( const std::string& subsystem, const std::string& message )=0; - // Record heartbeat from a subsystem: let Status know the subsystem is alive without - // modifying its status. - // Throws gbxutilacfr::Exception if the subsystem does not exist. + //! Record heartbeat from a subsystem: let Status know the subsystem is alive without + //! modifying its status. + //! Throws gbxutilacfr::Exception if the subsystem does not exist. virtual void heartbeat( const std::string& subsystem )=0; - // Some thread should call this function periodically in order for - // status publishing to happen. + //! Some thread should call this function periodically in order for + //! status publishing to happen. virtual void process()=0; }; -} } // namespace #endif Modified: gearbox/trunk/src/gbxutilacfr/substatus.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/substatus.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/substatus.h 2008-06-04 05:37:33 UTC (rev 154) @@ -11,9 +11,8 @@ #ifndef GBXUTILACFR_SUBSYSTEM_STATUS_H #define GBXUTILACFR_SUBSYSTEM_STATUS_H -#include <gbxsickacfr/gbxutilacfr/status.h> +#include <gbxutilacfr/status.h> -namespace gbxsickacfr { namespace gbxutilacfr { //! @@ -75,7 +74,6 @@ std::string subsysName_; }; -} } // namespace #endif Modified: gearbox/trunk/src/gbxutilacfr/test/mathtest.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/test/mathtest.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/test/mathtest.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -9,7 +9,7 @@ */ #include <iostream> -#include <gbxsickacfr/gbxutilacfr/mathdefs.h> +#include <gbxutilacfr/mathdefs.h> #include <iomanip> #include <assert.h> Modified: gearbox/trunk/src/gbxutilacfr/tokenise.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/tokenise.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/tokenise.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -13,7 +13,6 @@ using namespace std; -namespace gbxsickacfr { namespace gbxutilacfr { std::vector<string> tokenise( const string &str, const string &delimiter ) @@ -66,4 +65,3 @@ } } -} Modified: gearbox/trunk/src/gbxutilacfr/tokenise.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/tokenise.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/tokenise.h 2008-06-04 05:37:33 UTC (rev 154) @@ -14,7 +14,6 @@ #include <string> #include <vector> -namespace gbxsickacfr { namespace gbxutilacfr { //! Takes a string containing tokens separated by a delimiter @@ -23,6 +22,5 @@ const std::string &delimiter ); } -} #endif Modified: gearbox/trunk/src/gbxutilacfr/tracer.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/tracer.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/tracer.h 2008-06-04 05:37:33 UTC (rev 154) @@ -1,6 +1,6 @@ /* * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics - * http://gearbox.sf.net/ + * http://!gearbox.sf.net/ * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp * * This distribution is licensed to you under the terms described in @@ -13,127 +13,126 @@ #include <string> -namespace gbxsickacfr { namespace gbxutilacfr { -// -// @brief Local and remote tracing. -// -// Tracer is used to log human-readable trace statements, e.g. warnings, error messages, etc (not data). -// -// A single Tracer object is meant to be shared by multiple threads, so the -// implementation must be thread-safe. -// -// When the tracing message is cheap to generate, simply call one of the tracing functions. -// The routing to destinations will be performed internally. -// -// @verbatim -// std::string s = "something is wrong"; -// tracer->error( s ); -// @endverbatim -// -// If the tracing message is a result of an expensive operation, you -// many want to perform the tracing test yourself and then call the -// tracing function. You may test verbosity for specific TraceType / -// DestinationType combinations or use summary fields AnyTrace and -// ToAny. -// -// @verbatim -// Tracer* tracer = context().tracer(); -// if ( tracer.verbosity( gbxutilacfr::Tracer::ErrorTrace, gbxutilacfr::Tracer::ToAny ) > 0 ) { -// std::string s = expensiveOperation(); -// tracer.error( s ); -// } -// @endverbatim -// -// Enum gbxutilacfr::Tracer::TraceType defines types of traced -// information. Enum gbxutilacfr::Tracer::DestinationType defines possible -// tracer destinations are. Verbosity levels range from 0 (nothing) to -// 10 (everything). The built-in defaults are as follows: -// @verbatim -// ToDisplay ToNetwork ToLog ToFile -// Info 1 0 0 0 -// Warning 1 0 0 0 -// Error 10 0 0 0 -// Debug 0 0 0 0 -// @endverbatim -// -// @see Status -// +//! +//! @brief Local and remote tracing. +//! +//! Tracer is used to log human-readable trace statements, e.g. warnings, error messages, etc (not data). +//! +//! A single Tracer object is meant to be shared by multiple threads, so the +//! implementation must be thread-safe. +//! +//! When the tracing message is cheap to generate, simply call one of the tracing functions. +//! The routing to destinations will be performed internally. +//! +//! @verbatim +//! std::string s = "something is wrong"; +//! tracer->error( s ); +//! @endverbatim +//! +//! If the tracing message is a result of an expensive operation, you +//! many want to perform the tracing test yourself and then call the +//! tracing function. You may test verbosity for specific TraceType / +//! DestinationType combinations or use summary fields AnyTrace and +//! ToAny. +//! +//! @verbatim +//! Tracer* tracer = context().tracer(); +//! if ( tracer.verbosity( gbxutilacfr::Tracer::ErrorTrace, gbxutilacfr::Tracer::ToAny ) > 0 ) { +//! std::string s = expensiveOperation(); +//! tracer.error( s ); +//! } +//! @endverbatim +//! +//! Enum gbxutilacfr::Tracer::TraceType defines types of traced +//! information. Enum gbxutilacfr::Tracer::DestinationType defines possible +//! tracer destinations are. Verbosity levels range from 0 (nothing) to +//! 10 (everything). The built-in defaults are as follows: +//! @verbatim +//! ToDisplay ToNetwork ToLog ToFile +//! Info 1 0 0 0 +//! Warning 1 0 0 0 +//! Error 10 0 0 0 +//! Debug 0 0 0 0 +//! @endverbatim +//! +//! @see Status +//! class Tracer { public: virtual ~Tracer() {}; - // Types of traced information + //! Types of traced information enum TraceType { - // Information + //! Information InfoTrace=0, - // Warning + //! Warning WarningTrace, - // Error + //! Error ErrorTrace, - // Debug statement + //! Debug statement DebugTrace, - // Use this index to find out the maximum verbosity among all trace types to - // a particular destination. + //! Use this index to find out the maximum verbosity among all trace types to + //! a particular destination. AnyTrace, - // Number of trace types + //! Number of trace types NumberOfTraceTypes, - // Other - // (not used by orcaice tracers, so it's verbosity level is not stored in - // our matrix, so it's safe to have it larger than NumberOfTraceTypes) + //! Other + //! (not used by orcaice tracers, so it's verbosity level is not stored in + //! our matrix, so it's safe to have it larger than NumberOfTraceTypes) OtherTrace }; - // Types of destinations for traced information. + //! Types of destinations for traced information. enum DestinationType { - // Write to stardard display + //! Write to stardard display ToDisplay=0, - // Send over the network, details specific to Tracer implementation + //! Send over the network, details specific to Tracer implementation ToNetwork, - // Write to SysLog on Unix, EventLog on windows + //! Write to SysLog on Unix, EventLog on windows ToLog, - // Write to a file + //! Write to a file ToFile, - // Use this index to request the maximum verbosity of a particular type among - // all destinations + //! Use this index to request the maximum verbosity of a particular type among + //! all destinations ToAny, - // Number of destination types + //! Number of destination types NumberOfDestinationTypes }; struct Config { - // array of verbosity levels + //! array of verbosity levels int verbosity[NumberOfTraceTypes][NumberOfDestinationTypes]; - // affects only the printout to stdout. Remote messages always have a timestamp. + //! affects only the printout to stdout. Remote messages always have a timestamp. bool addTimestamp; }; - // LOCAL INTERFACE + //! LOCAL INTERFACE - // Prints out verbatim to stdout. It is never routed over the network. - // @see info + //! Prints out verbatim to stdout. It is never routed over the network. + //! @see info virtual void print( const std::string &message ) = 0; - // Routing is determined by InfoToXxx parameter. + //! Routing is determined by InfoToXxx parameter. virtual void info( const std::string &message, int level=1 ) = 0; - // Routing is determined by WarningToXxx parameter. + //! Routing is determined by WarningToXxx parameter. virtual void warning( const std::string &message, int level=1 ) = 0; - // Routing is determined by ErrorToXxx parameter. + //! Routing is determined by ErrorToXxx parameter. virtual void error( const std::string &message, int level=1 ) = 0; - // Routing is determined by DebugToXxx parameter. + //! Routing is determined by DebugToXxx parameter. virtual void debug( const std::string &message, int level=1 ) = 0; - // Returns the verbosity level for traceType to destType. This test is performed - // internally by all tracing functions, e.g. error(). You may want to call this - // function yourself @e before calling error() if there is a significant overhead - // in forming the tracing string. See class documentation for an example of such - // usage. + //! Returns the verbosity level for traceType to destType. This test is performed + //! internally by all tracing functions, e.g. error(). You may want to call this + //! function yourself @e before calling error() if there is a significant overhead + //! in forming the tracing string. See class documentation for an example of such + //! usage. virtual int verbosity( TraceType traceType, DestinationType destType ) const = 0; static std::string toString( Tracer::TraceType type ) @@ -168,20 +167,19 @@ }; - // @b EXPERIMENTAL. Sets debug level for an individual subsystem. - // Only debug-to-display is supported. + //! @b EXPERIMENTAL. Sets debug level for an individual subsystem. + //! Only debug-to-display is supported. virtual void setLevel( const std::string &subsystem, int level=0 ) {}; - // @b EXPERIMENTAL. Debug tracing for an individual subsystem. - // Only debug-to-display is supported. - // The maximum traceable level is set per-subsystem with setLevel(). + //! @b EXPERIMENTAL. Debug tracing for an individual subsystem. + //! Only debug-to-display is supported. + //! The maximum traceable level is set per-subsystem with setLevel(). virtual void debug( const std::string &subsystem, const std::string &message, int level=1 ) { debug( message, level ); }; }; -} -} // namespace +} //! namespace #endif Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/trivialstatus.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -15,7 +15,6 @@ using namespace std; -namespace gbxsickacfr { namespace gbxutilacfr { TrivialStatus::TrivialStatus( Tracer& tracer, @@ -103,4 +102,3 @@ } } -} Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/trivialstatus.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2008-06-04 05:37:33 UTC (rev 154) @@ -11,10 +11,9 @@ #ifndef GBXUTILACFR_TRIVIAL_STATUS_H #define GBXUTILACFR_TRIVIAL_STATUS_H -#include <gbxsickacfr/gbxutilacfr/status.h> -#include <gbxsickacfr/gbxutilacfr/tracer.h> +#include <gbxutilacfr/status.h> +#include <gbxutilacfr/tracer.h> -namespace gbxsickacfr { namespace gbxutilacfr { @@ -32,9 +31,9 @@ virtual void addSubsystem( const std::string& subsystem, double maxHeartbeatIntervalSec=-1.0 ); virtual void removeSubsystem( const std::string& subsystem ); - // does not keep track of subsystems, returns empty vector. + //! does not keep track of subsystems, returns empty vector. virtual std::vector<std::string> subsystems(); - // does not keep track of status, throws Exception on any query + //! does not keep track of status, throws Exception on any query virtual SubsystemStatus subsystemStatus( const std::string& subsystem ); virtual void setMaxHeartbeatInterval( const std::string& subsystem, double interval ); virtual void initialising( const std::string& subsystem, const std::string& message="" ); @@ -55,7 +54,6 @@ bool fault_; }; -} } // namespace #endif Modified: gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/trivialtracer.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/trivialtracer.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -13,7 +13,6 @@ using namespace std; -namespace gbxsickacfr { namespace gbxutilacfr { TrivialTracer::TrivialTracer( bool debug, bool info, bool warn, bool error ) : @@ -65,5 +64,3 @@ } } -} - Modified: gearbox/trunk/src/gbxutilacfr/trivialtracer.h =================================================================== --- gearbox/trunk/src/gbxsickacfr/gbxutilacfr/trivialtracer.h 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/src/gbxutilacfr/trivialtracer.h 2008-06-04 05:37:33 UTC (rev 154) @@ -11,9 +11,8 @@ #ifndef GBXUTILACFR_TRIVIAL_TRACER_H #define GBXUTILACFR_TRIVIAL_TRACER_H -#include <gbxsickacfr/gbxutilacfr/tracer.h> +#include <gbxutilacfr/tracer.h> -namespace gbxsickacfr { namespace gbxutilacfr { //! @@ -40,7 +39,6 @@ bool error_; }; -} } // namespace #endif Modified: gearbox/trunk/submitted/gbxgarminacfr/driver.cpp =================================================================== --- gearbox/trunk/submitted/gbxgarminacfr/driver.cpp 2008-06-04 02:02:30 UTC (rev 153) +++ gearbox/trunk/submitted/gbxgarminacfr/driver.cpp 2008-06-04 05:37:33 UTC (rev 154) @@ -10,7 +10,7 @@ #include <iostream> #include <sstream> -#include <gbxsickacfr/gbxutilacfr/gbxutilacfr.h> +#include <gbxutilacfr/gbxutilacfr.h> #include "nmea.h" #include <cstdlib> #include <sys/time.h> @@ -181,8 +181,8 @@ /////////////////////////////////////// Driver::Driver( const Config &config, - gbxsickacfr::gbxutilacfr::Tracer &tracer, - gbxsickacfr::gbxutilacfr::Status &status ) : + gbxutilacfr::Tracer &tracer, + gbxutilacfr::Status &status ) : config_(config), tracer_(tracer), status_(status) @@ -191,7 +191,7 @@ { stringstream ss; ss << "Invalid config: " << config_.toString(); - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO, ss.str() ); + throw gbxutilacfr::Exception( ERROR_INFO, ss.str() ); } stringstream ssDebug; @@ -224,7 +224,7 @@ stringstream ss; ss << "Driver: Caught SerialException: " << e.what(); tracer_.error( ss.str() ); - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO, ss.str() ); + throw gbxutilacfr::Exception( ERROR_INFO, ss.str() ); } } @@ -297,14 +297,14 @@ if ( gettimeofday( &now, 0 ) != 0 ) { stringstream ss; ss << "Pproblem getting timeofday: " << strerror(errno) << endl; - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO,ss.str() ); + throw gbxutilacfr::Exception( ERROR_INFO,ss.str() ); } // zero tolerance to serial errors if ( ret<0 ) - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO, "Driver: Timeout reading from serial port" ); + throw gbxutilacfr::Exception( ERROR_INFO, "Driver: Timeout reading from serial port" ); if ( ret==0 ) - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO,"Driver: Read 0 bytes from serial port"); + throw gbxutilacfr::Exception( ERROR_INFO,"Driver: Read 0 bytes from serial port"); // // We successfully read something from the serial port @@ -324,7 +324,7 @@ stringstream ss; ss << "Problem reading from GPS: " << e.what(); tracer_.error( ss.str() ); - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO,ss.str()); + throw gbxutilacfr::Exception( ERROR_INFO,ss.str()); } nmeaExceptionCount = 0; @@ -336,7 +336,7 @@ continue; } else { - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO,"More than 3 sequential messages failed the checksum"); + throw gbxutilacfr::Exception( ERROR_INFO,"More than 3 sequential messages failed the checksum"); } } nmeaFailChecksumCount = 0; @@ -346,7 +346,7 @@ // We should not get any messages with failed checksums, but just in case if( nmeaMessage.haveTestedChecksum() && (!nmeaMessage.haveValidChecksum()) ) { - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO,"Driver: Message fails checksum"); + throw gbxutilacfr::Exception( ERROR_INFO,"Driver: Message fails checksum"); } // And then find out which type of messge we have recieved... @@ -356,7 +356,7 @@ if ( config_.readGga ) tracer_.debug("got GPGGA message",4); else - throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO, "got unexpected GPGGA message" ); + throw gbxutilacfr::Exception( ERROR_INFO, "got unexpected GPGGA message" ); genericData.reset( extractGgaData( nmeaMessage, now.tv_sec, now.tv_usec ) ); break; } @@ -364,7 +364,7 @@ if ( co... [truncated message content] |