Instrument Neutral Distributed Interface INDI  1.9.5
indiproperty_p.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 #include "indiproperty.h"
23 #include <memory>
24 namespace INDI
25 {
26 
27 #ifdef INDI_PROPERTY_BACKWARD_COMPATIBILE
28 template <typename T>
29 static inline std::shared_ptr<T> make_shared_weak(T *object)
30 {
31  return std::shared_ptr<T>(object, [](T*){});
32 }
33 #endif
34 
35 class BaseDevice;
36 class PropertyPrivate
37 {
38 public:
39  void *property = nullptr;
40  BaseDevice *baseDevice = nullptr;
42  bool registered = false;
43  bool dynamic = false;
44 
51 
52  virtual ~PropertyPrivate();
53 
54 #ifdef INDI_PROPERTY_BACKWARD_COMPATIBILE
55  Property self {make_shared_weak(this)};
56 #endif
57 };
58 
59 }
indibase.h
_ILightVectorProperty
Light vector property descriptor.
Definition: indiapi.h:415
INDI::PropertyPrivate::baseDevice
BaseDevice * baseDevice
Definition: indiproperty_p.h:56
_IBLOBVectorProperty
BLOB (Binary Large Object) vector property descriptor.
Definition: indiapi.h:469
INDI_PROPERTY_TYPE
INDI_PROPERTY_TYPE
Definition: indibasetypes.h:22
INDI::PropertyPrivate::property
void * property
Definition: indiproperty_p.h:55
INDI::Property
Provides generic container for INDI properties.
Definition: indiproperty.h:43
_ITextVectorProperty
Text vector property descriptor.
Definition: indiapi.h:244
INDI::PropertyPrivate::registered
bool registered
Definition: indiproperty_p.h:58
_INumberVectorProperty
Number vector property descriptor.
Definition: indiapi.h:317
INDI::PropertyPrivate::dynamic
bool dynamic
Definition: indiproperty_p.h:59
INDI::PropertyPrivate::~PropertyPrivate
virtual ~PropertyPrivate()
Definition: indiproperty.cpp:115
INDI_UNKNOWN
@ INDI_UNKNOWN
Definition: indidriver.c:62
INDI::PropertyPrivate::PropertyPrivate
PropertyPrivate(void *property, INDI_PROPERTY_TYPE type)
Definition: indiproperty.cpp:44
indiproperty.h
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
INDI::PropertyPrivate::type
INDI_PROPERTY_TYPE type
Definition: indiproperty_p.h:57
_ISwitchVectorProperty
Switch vector property descriptor.
Definition: indiapi.h:365