libcyberradio 22.01.24
RadioComponent.h
1/***************************************************************************
2 * \file RadioComponent.h
3 * \brief Defines the basic component interface for an NDR-class radio.
4 * \author DA
5 * \author NH
6 * \author MN
7 * \copyright (c) 2017 CyberRadio Solutions, Inc. All rights reserved.
8 *
9 ***************************************************************************/
10
11#ifndef INCLUDED_LIBCYBERRADIO_DRIVER_RADIOCOMPONENT_H
12#define INCLUDED_LIBCYBERRADIO_DRIVER_RADIOCOMPONENT_H
13
14#include "LibCyberRadio/Driver/Configurable.h"
15#include <string>
16
17
21namespace LibCyberRadio
22{
26 namespace Driver
27 {
28 // Forward declaration for RadioHandler
29 class RadioHandler;
30
45 {
46 public:
55 RadioComponent(const std::string& name = "<unknown>",
56 int index = 0,
57 RadioHandler* parent = NULL,
58 bool debug = false);
62 virtual ~RadioComponent();
67 RadioComponent(const RadioComponent& other);
73 virtual RadioComponent& operator=(const RadioComponent& other);
78 virtual int getIndex() const;
83 virtual void setIndex(int index);
88 virtual RadioHandler* getParent() const;
93 virtual void setParent(RadioHandler* parent);
98 virtual bool disable();
104 virtual bool enable(bool enabled = true);
109 virtual bool isEnabled() const;
115 virtual bool setConfiguration(ConfigurationDict& cfg);
120 virtual void queryConfiguration();
121
122 protected:
127 virtual void initConfigurationDict();
131 virtual void updateConfigurationDict();
132
133 protected:
134 // Index number of the component
135 int _index;
136 // Parent radio handler object
137 RadioHandler* _parent;
138 // Whether or not the component is enabled
139 bool _enabled;
140
141 }; // class RadioComponent
142
143 } // namespace Driver
144
145} // namespace LibCyberRadio
146
147
148#endif // INCLUDED_LIBCYBERRADIO_DRIVER_RADIOCOMPONENT_H
virtual int debug(const char *format,...)
Outputs debug information.
Configurable(const std::string &name="<unknown>", bool debug=false)
Constructs a Configurable object.
A configuration dictionary.
virtual bool enable(bool enabled=true)
Enables this component.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this component.
virtual int getIndex() const
Gets the index number of the component.
virtual void setIndex(int index)
Sets the index number of the component.
virtual void queryConfiguration()
Tells the component to query its hardware configuration in order to create its configuration dictiona...
virtual bool isEnabled() const
Gets whether or not the component is enabled.
virtual ~RadioComponent()
Destroys a RadioComponent object.
virtual void updateConfigurationDict()
Updates the configuration dictionary from component settings.
virtual RadioComponent & operator=(const RadioComponent &other)
Assignment operator for RadioComponent objects.
RadioComponent(const std::string &name="<unknown>", int index=0, RadioHandler *parent=NULL, bool debug=false)
Constructs a RadioComponent object.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual RadioHandler * getParent() const
Gets the "parent" radio handler for this component.
virtual bool disable()
Disables this component.
virtual void setParent(RadioHandler *parent)
Sets the "parent" radio handler for this component.
Generic radio handler class.
Provides programming elements for driving CRS NDR-class radios.
Defines functionality for LibCyberRadio applications.
Definition App.h:24