Instrument Neutral Distributed Interface INDI 2.2.5
Public Types | Public Member Functions | Protected Member Functions | List of all members
INDI::ParentDevice Class Reference

The class is used to create device instances. Class copying is not allowed. When an object is destroyed, the property list (INDI::Property) is cleared to prevent a circular reference along with the properties. The base INDI::BaseDevice class and its INDI::Properties exist as long as they are used by other objects. More...

#include <parentdevice.h>

Inheritance diagram for INDI::ParentDevice:
INDI::BaseDevice INDI::DefaultDevice ALTO ArduinoST4 AstrometryDriver AvalonUPAS CelestronDewPower CheapoDC DeepSkyDadFP DeltaT Dome DragonLIGHT DustCoverSimulator Excalibur FlipFlat GIOTTO GPUSB GeminiFlatpanel GeminiPBH INDI::CCD INDI::Dome INDI::FilterWheel INDI::Focuser INDI::GPS INDI::IMU INDI::Rotator INDI::SensorInterface INDI::Telescope INDI::Weather INDIAlpacaServer IPX800 IPX800 Imager IndiAstroLink4mini2 IndiAstrolink4 JoyStick LPM LightPanelSimulator MLAstroRPA MyDCP4ESP OAPA PACSimulator PegasusFlatMaster PegasusFlatMasterNeo PegasusFlatMasterWifi PegasusPPB PegasusPPBA PegasusSPB PegasusUCH PegasusUPB PegasusUPB3 RainDetector SQM SQMSimulator STAR2000 SVBONYPowerBox SafetyMonitor ShelyakDriver SimpleDevice SimpleSkeleton SimulatorIO SkySafari SnapCap SpectraCyber StarTechHub TerransPowerBoxGoV2 TerransPowerBoxProV2 UPS USBDewpoint WakeOnLAN WandererBoxPlusV3 WandererBoxProV3 WandererCover WandererCoverV4EC WandererCoverV4ProEC WandererDewTerminator WandererETA WandererEclipse WatchDog WaveshareRelay WeatherMeta myDewControllerPro

Public Types

enum  Type { Valid , Invalid }
 
- Public Types inherited from INDI::BaseDevice
enum  INDI_ERROR { INDI_DEVICE_NOT_FOUND = -1 , INDI_PROPERTY_INVALID = -2 , INDI_PROPERTY_DUPLICATED = -3 , INDI_DISPATCH_ERROR = -4 }
 
enum  { INDI_ENABLED , INDI_DISABLED }
 
enum  WATCH { WATCH_NEW = 0 , WATCH_UPDATE , WATCH_NEW_OR_UPDATE }
 
enum  DRIVER_INTERFACE {
  GENERAL_INTERFACE = 0 , TELESCOPE_INTERFACE = (1 << 0) , CCD_INTERFACE = (1 << 1) , GUIDER_INTERFACE = (1 << 2) ,
  FOCUSER_INTERFACE = (1 << 3) , FILTER_INTERFACE = (1 << 4) , DOME_INTERFACE = (1 << 5) , GPS_INTERFACE = (1 << 6) ,
  WEATHER_INTERFACE = (1 << 7) , AO_INTERFACE = (1 << 8) , DUSTCAP_INTERFACE = (1 << 9) , LIGHTBOX_INTERFACE = (1 << 10) ,
  DETECTOR_INTERFACE = (1 << 11) , ROTATOR_INTERFACE = (1 << 12) , SPECTROGRAPH_INTERFACE = (1 << 13) , CORRELATOR_INTERFACE = (1 << 14) ,
  AUX_INTERFACE = (1 << 15) , OUTPUT_INTERFACE = (1 << 16) , INPUT_INTERFACE = (1 << 17) , POWER_INTERFACE = (1 << 18) ,
  IMU_INTERFACE = (1 << 19) , PAC_INTERFACE = (1 << 20) , SENSOR_INTERFACE = SPECTROGRAPH_INTERFACE | DETECTOR_INTERFACE | CORRELATOR_INTERFACE
}
 The DRIVER_INTERFACE enum defines the class of devices the driver implements. A driver may implement one or more interfaces. More...
 
typedef INDI::Properties Properties
 

Public Member Functions

 ParentDevice (Type type)
 
 ~ParentDevice ()
 
 ParentDevice (ParentDevice &&other)=default
 
ParentDevice & operator= (ParentDevice &&other)=default
 
- Public Member Functions inherited from INDI::BaseDevice
 BaseDevice ()
 
virtual ~BaseDevice ()
 
void registerProperty (const INDI::Property &property)
 Register the property to be able to observe and update.
 
void registerProperty (const INDI::Property &property, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property.
 
void watchProperty (const char *name, const std::function< void(INDI::Property)> &callback, WATCH watch=WATCH_NEW)
 Call the callback function if property is available.
 
Property getProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN) const
 Return a property and its type given its name.
 
Properties getProperties ()
 Return a list of all properties in the device.
 
const Properties getProperties () const
 
INDI::PropertyNumber getNumber (const char *name) const
 
INDI::PropertyText getText (const char *name) const
 
INDI::PropertySwitch getSwitch (const char *name) const
 
INDI::PropertyLight getLight (const char *name) const
 
INDI::PropertyBlob getBLOB (const char *name) const
 
IPState getPropertyState (const char *name) const
 
IPerm getPropertyPermission (const char *name) const
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN) const
 Return a property and its type given its name.
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue.
 
void checkMessage (XMLEle *root)
 
void doMessage (XMLEle *msg)
 
const std::string & messageQueue (size_t index) const
 
const std::string & lastMessage () const
 
bool isValid () const
 
bool isSameDevice (const BaseDevice &other) const
 
bool isConnected () const
 
void attach ()
 indicates that the device is ready
 
void detach ()
 indicates that the device is being removed
 
void setMediator (INDI::BaseMediator *mediator)
 Set the driver's mediator to receive notification of news devices and updated property values.
 
INDI::BaseMediator * getMediator () const
 
void setDeviceName (const char *dev)
 Set the device name.
 
const char * getDeviceName () const
 
bool isDeviceNameMatch (const char *otherName) const
 Check that the device name matches the argument.
 
bool isDeviceNameMatch (const std::string &otherName) const
 Check that the device name matches the argument.
 
const char * getDriverName () const
 
const char * getDriverExec () const
 
const char * getDriverVersion () const
 
uint16_t getDriverInterface () const
 getDriverInterface returns ORed values of DRIVER_INTERFACE. It presents the device classes supported by the driver.
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file.
 
int buildProp (const INDI::LilXmlElement &root, char *errmsg, bool isDynamic=false)
 Build a property given the supplied XML element (defXXX)
 
int setValue (const INDI::LilXmlElement &root, char *errmsg)
 handle SetXXX commands from client
 
 operator BaseDevice * ()
 
BaseDevice * operator-> ()
 
bool operator!= (std::nullptr_t) const
 
bool operator== (std::nullptr_t) const
 
 operator bool () const
 
 operator bool ()
 

Protected Member Functions

 ParentDevice (const std::shared_ptr< ParentDevicePrivate > &dd)
 
- Protected Member Functions inherited from INDI::BaseDevice
 BaseDevice (BaseDevicePrivate &dd)
 
 BaseDevice (const std::shared_ptr< BaseDevicePrivate > &dd)
 

Additional Inherited Members

- Static Public Member Functions inherited from INDI::BaseDevice
static std::string getSharedFilePath (std::string fileName)
 
- Protected Attributes inherited from INDI::BaseDevice
std::shared_ptr< BaseDevicePrivate > d_ptr
 

Detailed Description

The class is used to create device instances. Class copying is not allowed. When an object is destroyed, the property list (INDI::Property) is cleared to prevent a circular reference along with the properties. The base INDI::BaseDevice class and its INDI::Properties exist as long as they are used by other objects.

Definition at line 17 of file parentdevice.h.

Member Enumeration Documentation

◆ Type

Enumerator
Valid 
Invalid 

Definition at line 25 of file parentdevice.h.

Constructor & Destructor Documentation

◆ ParentDevice() [1/3]

INDI::ParentDevice::ParentDevice ( Type  type)
explicit

◆ ~ParentDevice()

INDI::ParentDevice::~ParentDevice ( )

Definition at line 50 of file parentdevice.cpp.

◆ ParentDevice() [2/3]

INDI::ParentDevice::ParentDevice ( ParentDevice &&  other)
default

◆ ParentDevice() [3/3]

INDI::ParentDevice::ParentDevice ( const std::shared_ptr< ParentDevicePrivate > &  dd)
protected

Definition at line 43 of file parentdevice.cpp.

Member Function Documentation

◆ operator=()

ParentDevice & INDI::ParentDevice::operator= ( ParentDevice &&  other)
default

The documentation for this class was generated from the following files: