diff --git a/src/liboncilla/Supervisor.cpp b/src/liboncilla/Supervisor.cpp index 4c324fb..729d6b5 100644 --- a/src/liboncilla/Supervisor.cpp +++ b/src/liboncilla/Supervisor.cpp @@ -1,44 +1,45 @@ /* * Supervisor.cpp * * Created on: Jan 21, 2013 * Author: tuleu */ #include "Supervisor.h" #include #include "Oncilla.h" namespace rci { namespace oncilla { -Supervisor::Supervisor(OncillaBackend & backend) : - d_l4s(4, SupervisorL4::Ptr()), d_world(backend.CreateSupervisorWorld()), - d_trunk(backend.CreateSupervisorTrunk()) { - LIBONCILLA_FOREACH_LEG(l) { - d_l4s[l] = backend.CreateSupervisorL4(l, - Oncilla::nameOfLeg(l) + " Oncilla Supervised L4"); - } +Supervisor::Supervisor(OncillaBackend & backend) + : d_l4s(4,SupervisorL4::Ptr()) + , d_trunk(backend.CreateSupervisorTrunk()) + , d_world(backend.CreateSupervisorWorld()){ + LIBONCILLA_FOREACH_LEG(l) { + d_l4s[l] = backend.CreateSupervisorL4(l, + Oncilla::nameOfLeg(l) + " Oncilla Supervised L4"); + } } -Supervisor::~Supervisor() { +Supervisor::~Supervisor(){ } -const SupervisorTrunk::Ptr & Supervisor::getTrunk() { - return d_trunk; +const SupervisorTrunk::Ptr & Supervisor::getTrunk(){ + return d_trunk; } -const SupervisorL4::Ptr & Supervisor::getL4(Leg l) { - if (l >= NUM_LEGS) { - std::ostringstream os; - os << "Leg " << l << "is out of range [0 3]."; - throw std::out_of_range(os.str()); - } - return d_l4s[l]; +const SupervisorL4::Ptr & Supervisor::getL4(Leg l){ + if (l >= NUM_LEGS){ + std::ostringstream os; + os << "Leg " << l << "is out of range [0 3]."; + throw std::out_of_range(os.str()); + } + return d_l4s[l]; } -const SupervisorWorld::Ptr & Supervisor::getWorld() { - return d_world; +const SupervisorWorld::Ptr & Supervisor::getWorld(){ + return d_world; } } /* namespace oncilla */ } /* namespace rci */ diff --git a/src/liboncilla/Supervisor.h b/src/liboncilla/Supervisor.h index e847de8..697e012 100644 --- a/src/liboncilla/Supervisor.h +++ b/src/liboncilla/Supervisor.h @@ -1,41 +1,41 @@ /* * Supervisor.h * * Created on: Jan 21, 2013 * Author: tuleu */ #ifndef SUPERVISOR_H_ #define SUPERVISOR_H_ #include #include "common.h" #include class OncillaBackend; namespace rci { namespace oncilla { class Supervisor { public: - typedef boost::shared_ptr Ptr; - Supervisor(OncillaBackend & backend); - virtual ~Supervisor(); + typedef boost::shared_ptr Ptr; + Supervisor(OncillaBackend & backend); + virtual ~Supervisor(); - const SupervisorTrunk::Ptr & getTrunk(); + const SupervisorTrunk::Ptr & getTrunk(); - const SupervisorL4::Ptr & getL4(Leg l); + const SupervisorL4::Ptr & getL4(Leg l); - const SupervisorWorld::Ptr & getWorld(); + const SupervisorWorld::Ptr & getWorld(); private: - std::vector d_l4s; - SupervisorTrunk::Ptr d_trunk; - SupervisorWorld::Ptr d_world; + std::vector d_l4s; + SupervisorTrunk::Ptr d_trunk; + SupervisorWorld::Ptr d_world; }; } /* namespace oncilla */ } /* namespace rci */ #endif /* SUPERVISOR_H_ */ diff --git a/src/liboncilla/nodes/SupervisorWorld.cpp b/src/liboncilla/nodes/SupervisorWorld.cpp index 5f0ffca..be52f91 100644 --- a/src/liboncilla/nodes/SupervisorWorld.cpp +++ b/src/liboncilla/nodes/SupervisorWorld.cpp @@ -1,14 +1,14 @@ #include "SupervisorWorld.h" namespace rci { namespace oncilla { -SupervisorWorld::SupervisorWorld() : - rci::ResourceNode("Supervised Oncilla World") { +SupervisorWorld::SupervisorWorld() + : rci::ResourceNode("Supervised Oncilla World") { } SupervisorWorld::~SupervisorWorld() { } } /* namespace oncilla */ } /* namespace rci */ diff --git a/src/liboncilla/nodes/SupervisorWorld.h b/src/liboncilla/nodes/SupervisorWorld.h index ae6bab0..62f1207 100644 --- a/src/liboncilla/nodes/SupervisorWorld.h +++ b/src/liboncilla/nodes/SupervisorWorld.h @@ -1,19 +1,19 @@ #pragma once #include namespace rci { namespace oncilla { class SupervisorWorld: public rci::ResourceNode { public: - typedef boost::shared_ptr Ptr; + typedef boost::shared_ptr Ptr; - SupervisorWorld(); - virtual ~SupervisorWorld(); + SupervisorWorld(); + virtual ~SupervisorWorld(); - virtual void reset() = 0; + virtual void reset() = 0; }; } /* namespace oncilla */ } /* namespace rci */ diff --git a/src/liboncilla/utils/OncillaBackend.h b/src/liboncilla/utils/OncillaBackend.h index 4e256db..044a390 100644 --- a/src/liboncilla/utils/OncillaBackend.h +++ b/src/liboncilla/utils/OncillaBackend.h @@ -1,62 +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; -} -} + 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); + BIOROB_CPP_DECLARE_PLUGIN (OncillaBackend); + DISABLE_ASSIGNEMENT (OncillaBackend); + DISABLE_COPY (OncillaBackend); public: - typedef std::tr1::shared_ptr Ptr; - OncillaBackend(); - virtual ~OncillaBackend(); - virtual boost::shared_ptr CreateSynchronizer() = 0; + typedef std::tr1::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 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 CreateTrunk() = 0; - virtual boost::shared_ptr CreateSupervisorWorld() = 0; + virtual boost::shared_ptr CreateSupervisorWorld() = 0; - virtual boost::shared_ptr CreateSupervisorTrunk() = 0; + virtual boost::shared_ptr CreateSupervisorTrunk() = 0; - virtual boost::shared_ptr CreateSupervisorL4( - rci::oncilla::Leg l, const std::string & name) = 0; + virtual boost::shared_ptr CreateSupervisorL4(rci::oncilla::Leg l, + const std::string & name) = 0; }; #endif /* LIBONCILLA_ONCILLABACKEND_H_ */