Instrument Neutral Distributed Interface INDI  2.0.2
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 DeepSkyDadFP1 DeltaT Dome Excalibur FlipFlat GIOTTO GPUSB INDI::CCD INDI::Dome INDI::FilterWheel INDI::Focuser INDI::GPS INDI::Rotator INDI::SensorInterface INDI::Telescope INDI::Weather Imager JoyStick LPM LightPanelSimulator MyDCP4ESP PegasusFlatMaster PegasusPPB PegasusPPBA PegasusUCH PegasusUPB RainDetector SQM SQMSimulator STAR2000 ShelyakDriver SimpleDevice SimpleSkeleton SkySafari SnapCap USBDewpoint WandererCover WatchDog 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) , 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
 
ParentDeviceoperator= (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. More...
 
void registerProperty (const INDI::Property &property, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void watchProperty (const char *name, const std::function< void(INDI::Property)> &callback, WATCH watch=WATCH_NEW)
 Call the callback function if property is available. More...
 
Property getProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN) const
 Return a property and its type given its name. More...
 
Properties getProperties ()
 Return a list of all properties in the device. More...
 
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. More...
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue. More...
 
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 isConnected () const
 
void attach ()
 indicates that the device is ready More...
 
void detach ()
 indicates that the device is being removed More...
 
void setMediator (INDI::BaseMediator *mediator)
 Set the driver's mediator to receive notification of news devices and updated property values. More...
 
INDI::BaseMediatorgetMediator () const
 
void setDeviceName (const char *dev)
 Set the device name. More...
 
const char * getDeviceName () const
 
bool isDeviceNameMatch (const char *otherName) const
 Check that the device name matches the argument. More...
 
bool isDeviceNameMatch (const std::string &otherName) const
 Check that the device name matches the argument. More...
 
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. More...
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
int buildProp (const INDI::LilXmlElement &root, char *errmsg, bool isDynamic=false)
 Build a property given the supplied XML element (defXXX) More...
 
int setValue (const INDI::LilXmlElement &root, char *errmsg)
 handle SetXXX commands from client More...
 
 operator BaseDevice * ()
 
BaseDeviceoperator-> ()
 
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< BaseDevicePrivated_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: