libcyberradio  22.01.24
NbddcGroupComponent.h
1 /***************************************************************************
2  * \file NbddcGroupComponent.h
3  * \brief Defines the basic NBDDC group interface for an NDR-class radio.
4  * \author DA
5  * \author NH
6  * \author MN
7  * \copyright (c) 2018 CyberRadio Solutions, Inc. All rights reserved.
8  *
9  ***************************************************************************/
10 
11 #ifndef INCLUDED_LIBCYBERRADIO_DRIVER_NBDDCCOMPONENTGROUP_H
12 #define INCLUDED_LIBCYBERRADIO_DRIVER_NBDDCCOMPONENTGROUP_H
13 
14 #include "LibCyberRadio/Driver/RadioComponent.h"
15 #include "LibCyberRadio/Common/BasicDict.h"
16 #include "LibCyberRadio/Common/BasicList.h"
17 
18 
22 namespace LibCyberRadio
23 {
27  namespace Driver
28  {
29 
45  {
46  public:
59  NbddcGroupComponent(const std::string& name = "NBG",
60  int index = 1,
61  RadioHandler* parent = NULL,
62  bool debug = false,
63  int numGroupMembers = 0,
64  int groupMemberIndexBase = 1);
68  virtual ~NbddcGroupComponent();
79  virtual NbddcGroupComponent& operator=(const NbddcGroupComponent& other);
80  // RadioComponent interface
86  virtual bool enable(bool enabled = true);
92  virtual bool setConfiguration(ConfigurationDict& cfg);
97  virtual void queryConfiguration();
98  // NbddcGroupComponent extensions
103  virtual BasicIntList getMembers() const;
109  virtual bool setMembers(const BasicIntList& groupMembers);
115  virtual bool addMember(int member);
121  virtual bool removeMember(int member);
122 
123 
124  protected:
125  // RadioComponent interface
130  virtual void initConfigurationDict();
134  virtual void updateConfigurationDict();
135  // NbddcGroupComponent extensions
140  virtual std::string getMembersString();
150  virtual bool executeNbddcGroupEnableQuery(int index,
151  bool& enabled);
158  virtual bool executeNbddcGroupEnableCommand(int index,
159  bool& enabled);
169  virtual bool executeNbddcGroupQuery(int index,
170  BasicIntList& groupMembers);
177  virtual bool executeNbddcGroupCommand(int index,
178  BasicIntList& groupMembers);
189  virtual bool executeNbddcGroupMemberQuery(int index, int groupMember,
190  bool& isMember);
198  virtual bool executeNbddcGroupMemberCommand(int index, int groupMember,
199  bool& isMember);
200 
201  protected:
202  // Number of potential members in this group
203  int _numGroupMembers;
204  // Index that group members start with
205  int _groupMemberIndexBase;
206  // Group members
207  BasicIntList _groupMembers;
208 
209  }; // class NbddcGroupComponent
210 
214  typedef BASIC_DICT_CONTAINER<int, NbddcGroupComponent*> NbddcGroupComponentDict;
215 
216  } // namespace Driver
217 
218 } // namespace LibCyberRadio
219 
220 #endif /* INCLUDED_LIBCYBERRADIO_DRIVER_NBDDCCOMPONENTGROUP_H */
virtual bool executeNbddcGroupMemberQuery(int index, int groupMember, bool &isMember)
Executes the NBDDC group member query command.
virtual bool executeNbddcGroupEnableCommand(int index, bool &enabled)
Executes the NBDDC group enable command.
Base hardware component class.
virtual bool executeNbddcGroupMemberCommand(int index, int groupMember, bool &isMember)
Executes the NBDDC group member set command.
Base NBDDC group component class.
NbddcGroupComponent(const std::string &name="NBG", int index=1, RadioHandler *parent=NULL, bool debug=false, int numGroupMembers=0, int groupMemberIndexBase=1)
Constructs a NbddcGroupComponent object.
virtual bool enable(bool enabled=true)
Enables this component.
virtual void queryConfiguration()
Tells the component to query its hardware configuration in order to create its configuration dictiona...
virtual bool executeNbddcGroupCommand(int index, BasicIntList &groupMembers)
Executes the NBDDC group configuration set command.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this component.
virtual bool addMember(int member)
Adds a NBDDC to the list of group members.
virtual bool executeNbddcGroupQuery(int index, BasicIntList &groupMembers)
Executes the NBDDC group configuration query command.
virtual bool setMembers(const BasicIntList &groupMembers)
Sets the list of group members.
virtual void updateConfigurationDict()
Updates the configuration dictionary from component settings.
Generic radio handler class.
Definition: RadioHandler.h:54
virtual int debug(const char *format,...)
Outputs debug information.
Definition: Debuggable.cpp:95
virtual std::string getMembersString()
Gets the string representation of the member list.
Defines functionality for LibCyberRadio applications.
Definition: App.h:23
A configuration dictionary.
Definition: Configurable.h:51
virtual BasicIntList getMembers() const
Gets the list of group members.
virtual NbddcGroupComponent & operator=(const NbddcGroupComponent &other)
Assignment operator for NbddcGroupComponent objects.
BASIC_LIST_CONTAINER< int > BasicIntList
Type representing a list of integers.
Definition: BasicList.h:27
BASIC_DICT_CONTAINER< int, NbddcGroupComponent * > NbddcGroupComponentDict
A dictionary of NBDDC group components, keyed by index.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual bool executeNbddcGroupEnableQuery(int index, bool &enabled)
Executes the NBDDC group enable query command.
virtual ~NbddcGroupComponent()
Destroys a NbddcGroupComponent object.
virtual bool removeMember(int member)
Removes a NBDDC from the list of group members.