Instrument Neutral Distributed Interface INDI  1.6.0
indiproperty.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright(c) 2011 Jasem Mutlaq. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 *******************************************************************************/
18 
19 #pragma once
20 
21 #include "indibase.h"
22 
23 namespace INDI
24 {
25 class BaseDevice;
26 
33 class Property
34 {
35  public:
36  Property();
37  ~Property();
38 
39  void setProperty(void *);
41  void setRegistered(bool r);
42  void setDynamic(bool d);
43  void setBaseDevice(BaseDevice *idp);
44 
45  void *getProperty() { return pPtr; }
46  INDI_PROPERTY_TYPE getType() { return pType; }
47  bool getRegistered() { return pRegistered; }
48  bool isDynamic() { return pDynamic; }
49  BaseDevice *getBaseDevice() { return dp; }
50 
51  // Convenience Functions
52  const char *getName() const;
53  const char *getLabel() const;
54  const char *getGroupName() const;
55  const char *getDeviceName() const;
56  const char *getTimestamp() const;
57  IPState getState() const;
58  IPerm getPermission() const;
59 
65 
66  private:
67  void *pPtr;
68  BaseDevice *dp;
69  INDI_PROPERTY_TYPE pType;
70  bool pRegistered;
71  bool pDynamic;
72 };
73 
74 } // namespace INDI
const char * getLabel() const
Light vector property descriptor.
Definition: indiapi.h:397
INDI_PROPERTY_TYPE
Definition: indibasetypes.h:22
IPState
Property state.
Definition: indiapi.h:143
bool getRegistered()
Definition: indiproperty.h:47
void setProperty(void *)
const char * getGroupName() const
ILightVectorProperty * getLight()
IPerm getPermission() const
void * getProperty()
Definition: indiproperty.h:45
Provides generic container for INDI properties.
Definition: indiproperty.h:33
void setDynamic(bool d)
const char * getName() const
ISwitchVectorProperty * getSwitch()
Class to provide basic INDI device functionality.
Definition: basedevice.h:44
void setType(INDI_PROPERTY_TYPE t)
Switch vector property descriptor.
Definition: indiapi.h:347
Namespace to encapsulate INDI client, drivers, and mediator classes. Developers can subclass the base...
INDI_PROPERTY_TYPE getType()
Definition: indiproperty.h:46
const char * getTimestamp() const
void setBaseDevice(BaseDevice *idp)
bool isDynamic()
Definition: indiproperty.h:48
BLOB (Binary Large Object) vector property descriptor.
Definition: indiapi.h:451
BaseDevice * getBaseDevice()
Definition: indiproperty.h:49
void setRegistered(bool r)
Number vector property descriptor.
Definition: indiapi.h:299
ITextVectorProperty * getText()
IPerm
Permission hint, with respect to client.
Definition: indiapi.h:164
const char * getDeviceName() const
IPState getState() const
Text vector property descriptor.
Definition: indiapi.h:226
INumberVectorProperty * getNumber()
IBLOBVectorProperty * getBLOB()