ci_controller.cpp
Go to the documentation of this file.
1 
7 #include "ci_controller.h"
8 
9 namespace argos {
10 
11  /****************************************/
12  /****************************************/
13 
15  /* Delete actuators*/
16  for(CCI_Actuator::TMap::iterator itActuators = m_mapActuators.begin();
17  itActuators != m_mapActuators.end();
18  ++itActuators) {
19  delete itActuators->second;
20  }
21  m_mapActuators.clear();
22 
23  /* Delete sensors */
24  for(CCI_Sensor::TMap::iterator itSensors = m_mapSensors.begin();
25  itSensors != m_mapSensors.end();
26  ++itSensors) {
27  delete itSensors->second;
28  }
29  m_mapSensors.clear();
30  }
31 
32  /****************************************/
33  /****************************************/
34 
35  bool CCI_Controller::HasActuator(const std::string& str_actuator_type) const {
36  CCI_Actuator::TMap::const_iterator it = m_mapActuators.find(str_actuator_type);
37  return (it != m_mapActuators.end());
38  }
39 
40  /****************************************/
41  /****************************************/
42 
43  bool CCI_Controller::HasSensor(const std::string& str_sensor_type) const {
44  CCI_Sensor::TMap::const_iterator it = m_mapSensors.find(str_sensor_type);
45  return (it != m_mapSensors.end());
46  }
47 
48  /****************************************/
49  /****************************************/
50 
51 }
CCI_Sensor::TMap m_mapSensors
A map containing all the sensors associated to this controller.
virtual ~CCI_Controller()
Class destructor.
bool HasActuator(const std::string &str_actuator_type) const
Returns true if an actuator with the passed type is associated to this controller.
CCI_Actuator::TMap m_mapActuators
A map containing all the actuators associated to this controller.
bool HasSensor(const std::string &str_sensor_type) const
Returns true if an sensor with the passed type is associated to this controller.
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12