diff --git a/src/liboncilla/Oncilla.h b/src/liboncilla/Oncilla.h index e406862..2127982 100644 --- a/src/liboncilla/Oncilla.h +++ b/src/liboncilla/Oncilla.h @@ -1,98 +1,98 @@ /* * Oncilla.h * * Created on: 15 dec. 2011 * Author: Alexandre Tuleu, Arne Nordmann */ #pragma once #include #include #include #include "common.h" #include "Supervisor.h" #include #include #include #include namespace rci { namespace oncilla { class BackendLoader; class Oncilla { public: typedef boost::shared_ptr Ptr; /** * When an Oncilla object is created, it will initialize all the resources * corresponding to node regarding the backend. At the backend level, if * some error happens, it will results by an Exception beeing thrown, for * example if one of the motor device is not available. User can change the * behavior by masking this exception, and defer them to the point where * they actually use the non-initialized node. This allow a finer control * of the robot, if an user want to drive only a leg and does not care if the * rest of the robot is online. By default throwing on initialization is * enabled. * @param throwOn if \true, Oncilla object will throw exception on initialization. */ static void throwExceptionOnInitialization(bool throwOn); static bool willThrowOnInitialization(); static std::string nameOfLeg(Leg l); Oncilla(); Oncilla(const OncillaBackend::Ptr & backend); virtual ~Oncilla(); const L0::Ptr & getL0(Leg l) const; const L1::Ptr & getL1(Leg l) const; const L2::Ptr & getL2(Leg l) const; const L3::Ptr & getL3(Leg l) const; const Trunk::Ptr & getTrunk() const; const rci::oncilla::Synchronizer::Ptr & getSynchronizer() const; const rci::oncilla::Supervisor::Ptr & getSupervisor() const; private : typedef std::vector LegNames; typedef std::set SetOfBackend; - typedef std::tr1::shared_ptr RuntimeErrPtr; + typedef std::shared_ptr RuntimeErrPtr; typedef std::vector ListOfErrors; void init(); static SetOfBackend s_backends; static bool s_throwExceptionOnInitialization; rci::oncilla::Synchronizer::Ptr d_synchronizer; //object cerated with teh backend depend on the backen existance, so this // pointer should be first (even if we save the backends in the static set) OncillaBackend::Ptr d_backend; std::vector d_L0s; std::vector d_L1s; std::vector d_L2s; std::vector d_L3s; ListOfErrors d_L0Errors; ListOfErrors d_L1Errors; ListOfErrors d_L2Errors; ListOfErrors d_L3Errors; Trunk::Ptr d_trunk; RuntimeErrPtr d_trunkError; Supervisor::Ptr d_supervisor; }; } } diff --git a/src/liboncilla/Supervisor.h b/src/liboncilla/Supervisor.h index a6c1dc9..adb7734 100644 --- a/src/liboncilla/Supervisor.h +++ b/src/liboncilla/Supervisor.h @@ -1,48 +1,48 @@ /* * Supervisor.h * * Created on: Jan 21, 2013 * Author: tuleu */ #ifndef SUPERVISOR_H_ #define SUPERVISOR_H_ #include #include "common.h" -#include +#include #include class OncillaBackend; namespace rci { namespace oncilla { class Supervisor { public: typedef boost::shared_ptr Ptr; Supervisor(OncillaBackend & backend); virtual ~Supervisor(); const SupervisorTrunk::Ptr & getTrunk(); const SupervisorL4::Ptr & getL4(Leg l); const SupervisorWorld::Ptr & getWorld(); private: - typedef std::tr1::shared_ptr RuntimeErrPtr; + typedef std::shared_ptr RuntimeErrPtr; typedef std::vector ListOfError; std::vector d_l4s; ListOfError d_l4Errors; SupervisorTrunk::Ptr d_trunk; RuntimeErrPtr d_trunkError; SupervisorWorld::Ptr d_world; RuntimeErrPtr d_worldError; }; } /* namespace oncilla */ } /* namespace rci */ #endif /* SUPERVISOR_H_ */ diff --git a/src/liboncilla/utils/OncillaBackend.h b/src/liboncilla/utils/OncillaBackend.h index 044a390..26d227d 100644 --- a/src/liboncilla/utils/OncillaBackend.h +++ b/src/liboncilla/utils/OncillaBackend.h @@ -1,63 +1,63 @@ /* * Backend.h * * Created on: Jan 18, 2013 * Author: tuleu */ #ifndef LIBONCILLA_ONCILLABACKEND_H_ #define LIBONCILLA_ONCILLABACKEND_H_ #include #include #include #include namespace rci { namespace oncilla { class Synchronizer; class L0; class L1L2; class L3; typedef L1L2 L1; typedef L1L2 L2; class Trunk; class SupervisorWorld; class SupervisorTrunk; class SupervisorL4; } /* namespace oncilla */ } /* namespace rci */ class OncillaBackend { BIOROB_CPP_DECLARE_PLUGIN (OncillaBackend); DISABLE_ASSIGNEMENT (OncillaBackend); DISABLE_COPY (OncillaBackend); public: - typedef std::tr1::shared_ptr Ptr; + typedef std::shared_ptr Ptr; OncillaBackend(); virtual ~OncillaBackend(); virtual boost::shared_ptr CreateSynchronizer() = 0; virtual boost::shared_ptr CreateL0(rci::oncilla::Leg l, const std::string & name) = 0; virtual boost::shared_ptr CreateL1(rci::oncilla::Leg l, const std::string & name) = 0; virtual boost::shared_ptr CreateL2(rci::oncilla::Leg l, const std::string & name) = 0; virtual boost::shared_ptr CreateL3(rci::oncilla::Leg l, const std::string & name) = 0; virtual boost::shared_ptr CreateTrunk() = 0; virtual boost::shared_ptr CreateSupervisorWorld() = 0; virtual boost::shared_ptr CreateSupervisorTrunk() = 0; virtual boost::shared_ptr CreateSupervisorL4(rci::oncilla::Leg l, const std::string & name) = 0; }; #endif /* LIBONCILLA_ONCILLABACKEND_H_ */