radio_equipped_entity.h
Go to the documentation of this file.
1 
7 #ifndef RADIO_EQUIPPED_ENTITY_H
8 #define RADIO_EQUIPPED_ENTITY_H
9 
10 namespace argos {
11  class CRadioEquippedEntity;
12  class CRadioEntity;
13 }
14 
15 #include <argos3/core/simulator/entity/composable_entity.h>
16 #include <argos3/plugins/simulator/entities/radio_entity.h>
17 #include <vector>
18 
19 namespace argos {
20 
31 
32  public:
33 
35 
36  public:
37 
38  struct SInstance {
42  SInstance(CRadioEntity& c_radio,
43  SAnchor& s_anchor,
44  const CVector3& c_offset);
45  using TVector = std::vector<SInstance>;
46  };
47 
48  public:
49 
55 
62  const std::string& str_id);
63 
64  virtual ~CRadioEquippedEntity() {}
65 
66  virtual void Init(TConfigurationNode& t_tree);
67 
68  virtual void Enable();
69 
70  virtual void Disable();
71 
81  void AddRadio(const std::string& str_id,
82  const CVector3& c_offset,
83  SAnchor& s_anchor,
84  Real f_transmit_range);
85 
92  CRadioEntity& GetRadio(UInt32 un_index);
93 
101  return m_vecInstances;
102  }
103 
110  inline const SInstance::TVector& GetInstances() const {
111  return m_vecInstances;
112  }
113 
119  void SetMedium(CRadioMedium& c_medium);
120 
121  virtual std::string GetTypeDescription() const {
122  return "radios";
123  }
124 
125  protected:
126 
127  virtual void UpdateComponents();
128 
129  protected:
130 
133  };
134 
135 }
136 
137 #endif
unsigned int UInt32
32-bit unsigned integer.
Definition: datatypes.h:97
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
Basic class for an entity that contains other entities.
An anchor related to the body of an entity.
Definition: physics_model.h:38
A 3D vector class.
Definition: vector3.h:31
A container of CRadioEntity.
SInstance::TVector m_vecInstances
List of the radios managed by this entity.
SInstance::TVector & GetInstances()
Returns the radios.
const SInstance::TVector & GetInstances() const
Returns the radios as a const reference.
CRadioEntity & GetRadio(UInt32 un_index)
Returns a radio by numeric index.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
virtual std::string GetTypeDescription() const
Returns a string label for this class.
void AddRadio(const std::string &str_id, const CVector3 &c_offset, SAnchor &s_anchor, Real f_transmit_range)
Programmatically creates a new radio.
void SetMedium(CRadioMedium &c_medium)
Sets the medium associated to this entity.
CRadioEquippedEntity(CComposableEntity *pc_parent)
Class constructor.
virtual void UpdateComponents()
Calls the Update() method on all the components.
SInstance(CRadioEntity &c_radio, SAnchor &s_anchor, const CVector3 &c_offset)