47 #ifndef _MIRA_PROPERTYNODE_H_ 48 #define _MIRA_PROPERTYNODE_H_ 50 #include <boost/interprocess/sync/scoped_lock.hpp> 53 #include <serialization/adapters/std/pair> 65 class PropertySerializer;
66 class RootPropertyNode;
107 template<
typename Reflector>
111 r.member(
"ID",
mID,
"");
112 r.member(
"Name",
mName,
"");
114 r.member(
"Type",
mType,
"The typename");
120 template<
typename Reflector>
128 template<
typename Reflector>
142 const std::string&
id()
const {
return mID; }
158 template <
typename T>
159 T
getHint(
const std::string& attribute,
const T& defaultValue = T())
const {
160 return mHint.
get(attribute, defaultValue);
164 bool hasHint(
const std::string& attribute)
const {
256 std::size_t level = 0)
const;
263 std::size_t level = 0);
295 std::string s =
id();
296 boost::algorithm::replace_all(s,
".",
"\\");
298 s = boost::algorithm::replace_all_copy(n->id(),
".",
"\\") +
"." + s;
341 template <
typename T>
348 template <
typename T>
389 void removeChild(
int index, NodeList::iterator it);
410 moveChild(index, std::next(mChildren.begin(), index),
411 destination, std::next(mChildren.begin(), destination)); }
418 void moveChild(
int index, NodeList::iterator it,
int destination, NodeList::iterator destIt);
476 void removeChild(
int index, NodeList::iterator it);
485 void synchronize()
override;
508 using LockType = boost::interprocess::scoped_lock<MutexType>;
547 template <
typename T>
559 assert(info.
type()==typeName<value_type>());
600 template<
typename Type = T>
613 template <
typename NodeType,
typename ValueType>
622 if (
p->isVolatile()) {
623 if (
auto root = parent->getRootNode()) {
625 lock = root->tryGetLock();
637 boost::interprocess::scoped_lock<RootPropertyNode::MutexType>
lock;
640 template <
typename NodeType,
typename ValueType,
641 bool ValueTypePointer =
false,
bool UseBackup =
false>
658 MIRA_THROW(XIO,
"Property is not available (yet?)")
665 MIRA_THROW(XIO,
"PropertyNode is locked by another thread");
667 return const_cast<ValueType&
>(this->
r);
672 template <
typename NodeType,
typename ValueType>
674 static_assert(
sizeof(ValueType)==0,
675 "LockedPropertyNodeAccess: combination ValueTypePointer=false, UseBackup=true not implemented");
679 template <
typename NodeType,
typename ValueType>
700 MIRA_THROW(XIO,
"Property is not available (yet?)")
707 MIRA_THROW(XIO,
"PropertyNode is locked by another thread");
709 return const_cast<ValueType&
>(*this->
r);
714 template <
typename NodeType,
typename ValueType>
735 if (this->
p->mBackupValue)
736 return *this->
p->mBackupValue;
738 MIRA_THROW(XIO,
"Property is not available (yet?)")
741 this->
p->mBackupValue.reset(
new ValueType(*this->
r));
747 MIRA_THROW(XIO,
"PropertyNode is locked by another thread");
749 return const_cast<ValueType&
>(*this->
r);
755 template <
typename T>
776 return LockedAccess(const_cast<TypedPropertyNodeImplGetSetMixinBase*>(
this), mValue);
784 return LockedAccess(const_cast<TypedPropertyNodeImplGetSetMixinBase*>(
this), mValue,
NoLock());
794 nodeValue = newValue;
810 std::unique_ptr<value_type> mBackupValue;
818 template <
typename T,
bool >
850 template <
typename T>
865 MIRA_THROW(XLogical,
"Cannot set value of property, since the underlying class does not provide an assignment operator");
871 MIRA_THROW(XLogical,
"Cannot get value of property, since the underlying class does not provide an assignment operator");
879 template <
typename T>
895 MIRA_THROW(XLogical,
"Cannot set value of read-only property.");
907 if (root && !lock.owns())
908 MIRA_THROW(XIO,
"PropertyNode is locked by another thread");
924 void set(
const value_type& newValue,
const Duration& timeout)
override{
926 MIRA_THROW(XLogical,
"Cannot set value of read-only property.");
936 if (root && !lock.owns())
937 MIRA_THROW(XIO,
"PropertyNode is locked by another thread");
970 template <
typename T>
978 const std::string& comment,
const value_type& value,
979 bool isReadOnly,
bool isVolatile) :
980 Base(id, name, comment, isReadOnly, isVolatile), mPointer(value) {}
989 return LockedAccess(const_cast<TypedPropertyNodeImpl*>(
this), mPointer);
1006 if(this->isReadOnly())
1007 MIRA_THROW(XLogical,
"Cannot set value of read-only property.");
1012 if constexpr(!Base::template mayHaveChildNodes<T>()) {
1017 auto root = this->getRootNode();
1018 auto lock = this->tryGetLock(root, timeout);
1019 if (root && !lock.owns())
1020 MIRA_THROW(XIO,
"PropertyNode is locked by another thread");
1022 auto nodePointerAccess = pointerAccess(
NoLock());
1024 synchronize(*nodePointerAccess);
1034 if(this->isReadOnly())
1035 MIRA_THROW(XLogical,
"Cannot set value of read-only property.");
1038 if constexpr(!Base::template mayHaveChildNodes<T>()) {
1039 *pointerAccess() = newPointer;
1043 auto root = this->getRootNode();
1044 auto lock = this->tryGetLock(root, timeout);
1045 if (root && !lock.owns())
1046 MIRA_THROW(XIO,
"PropertyNode is locked by another thread");
1048 auto nodePointerAccess = pointerAccess(
NoLock());
1049 *nodePointerAccess = newPointer;
1050 synchronize(*nodePointerAccess);
1055 return *pointerAccess();
1070 auto lock = this->getLock();
1071 return synchronize(*this->pointerAccess(
NoLock()));
1074 void synchronize(value_type& nodePointer);
1076 value_type mPointer;
1085 template <
typename Getter,
typename Setter>
1107 return LockedAccess(const_cast<TypedPropertyNodeImpl*>(
this), mAccessor);
1126 MIRA_THROW(XLogical,
"Cannot set value of read-only property.");
1131 if constexpr(!Base::template mayHaveChildNodes<T>()) {
1138 if (root && !lock.owns())
1139 MIRA_THROW(XIO,
"PropertyNode is locked by another thread");
1141 auto nodeAccessorAccess = accessorAccess(
NoLock());
1157 MIRA_THROW(XLogical,
"Cannot set value of read-only property.");
1160 if constexpr(!Base::template mayHaveChildNodes<T>()) {
1161 (*accessorAccess()).
set(newValue);
1167 if (root && !lock.owns())
1168 MIRA_THROW(XIO,
"PropertyNode is locked by another thread");
1170 auto nodeAccessorAccess = accessorAccess(
NoLock());
1171 (*nodeAccessorAccess).set(newValue);
1178 return (*accessorAccess()).
get();
1200 AccessorType mAccessor;
1246 template <
typename T>
1276 template <
typename T>
1286 Base(*node), mNode(node) {}
1302 MIRA_THROW(XNotImplemented,
"TypedRemotePropertyNode::synchronize() not implemented!");
1315 }
catch(std::exception& ex) {
1316 MIRA_THROW(XIO,
"Failed to convert value to json: " << ex.what())
1330 }
catch(std::exception& ex) {
1331 MIRA_THROW(XIO,
"Failed to obtain remote value: " << ex.what())
1343 template <
typename T>
1353 if(remoteNode!=NULL)
1354 return remoteNode->
toTyped<T>();
1357 MIRA_THROW(XBadCast,
"Cannot cast PropertyNode which is of " 1358 "type '" <<
mType <<
"' to requested type '" 1359 << typeName<T>() <<
"'");
1362 template <
typename T>
1370 template <
typename T>
1376 MIRA_THROW(XBadCast,
"Cannot cast PropertyNode which is of " 1377 "type '" <<
mType <<
"' to requested type '" 1378 << typeName<T>() <<
"'");
1381 if(
mType != typeName<T>())
1382 MIRA_THROW(XBadCast,
"Cannot cast remote PropertyNode which is of " 1383 "type '" <<
mType <<
"' to requested type '" 1384 << typeName<T>() <<
"'");
virtual void endAddChildren(PropertyNodeListenerList &listeners)
Serializer for serializing objects in JSON format.
Definition: JSONSerializer.h:95
This object can use object tracking internally, but the object tracking system's state remains unchan...
Definition: ReflectControlFlags.h:82
RootPropertyNode::LockType getLock()
Definition: PropertyNode.h:587
virtual void endRemoveChildren()=0
void deserialize(T &value)
Definition: JSONSerializer.h:436
const LockedAccess valueAccess() const
Definition: PropertyNode.h:775
LockedPropertyNodeAccess(NodeType *parent, const ValueType &ref)
Definition: PropertyNode.h:649
void fromList(const AttributeValueList &list)
Sets the property hints from the specified list of attribute/value pairs.
Definition: PropertyHint.h:115
const ValueType & operator*() const
Definition: PropertyNode.h:698
boost::interprocess::scoped_lock< RootPropertyNode::MutexType > lock
Definition: PropertyNode.h:637
Abstract base class for all derived property node classes.
Definition: PropertyNode.h:212
Base::value_type value_type
Definition: PropertyNode.h:1093
void removeAllChildren()
Removes all child nodes (without deleting them).
virtual ~PropertyNodeListener()
Definition: PropertyNode.h:448
Definition: PropertyNode.h:756
void setFromJSON(const json::Value &node, const Duration &timeout) override
Sets the value of the property, where the value is described as JSON value.
Definition: PropertyNode.h:1291
bool needLock
Definition: PropertyNode.h:636
std::string mID
the unique id of the property
Definition: PropertyNode.h:188
void registerListener(PropertyNodeListener *listener)
typename LockedAccess::NoLock NoLock
Definition: PropertyNode.h:1104
const PropertyNode * parent() const override
Returns the parent property node (or NULL, if this is a root node)
Definition: PropertyNode.h:1298
std::vector< PropertyNode * > NodeList
Definition: PropertyNode.h:217
Base::value_type value_type
Definition: PropertyNode.h:760
virtual void beginMoveChildren(PropertyNodeListenerList &listeners, int index, NodeList::iterator it, int count, int destination)
Caller must ensure to keep listeners locked between beginMoveChildren and endMoveChildren! ...
virtual PropertyNode * parent()
Returns the parent property node (or NULL, if this is a root node)
Definition: PropertyNode.h:234
tick_type milliseconds() const
Returns normalized number of milliseconds (0..999)
Definition: Time.h:285
Type trait that evaluates to true if a type is copy assignable, false otherwise.
Definition: IsCopyAssignable.h:71
Definition: PropertyNode.h:74
virtual void beginRemoveChildren(const PropertyNode *node, int index, int count)=0
LockedPropertyNodeAccess(NodeType *parent, const ValueType &ref, NoLock)
Definition: PropertyNode.h:652
virtual const PropertyNode * parent() const
Returns the parent property node (or NULL, if this is a root node)
Definition: PropertyNode.h:237
const PropertyNode * findChildNode(const std::vector< std::string > &ids, std::size_t level=0) const
Searches for a child property node (which may also be a child of a child of a child, etc).
Special derived class of PropertyNode, that allows to handle "remote properties" transparently.
Definition: PropertyNode.h:1226
virtual void setFromString(const std::string &value, const Duration &timeout=Duration::milliseconds(100))
Sets the value of the property, where the value is given as string.
ValueType * PointerType
Definition: PropertyNode.h:719
typename Base::NoLock NoLock
Definition: PropertyNode.h:688
ValueType & operator*()
Definition: PropertyNode.h:745
const ValueType & operator*() const
Definition: PropertyNode.h:732
PropertyNode * parent() override
Returns the parent property node (or NULL, if this is a root node)
Definition: PropertyNode.h:1297
LockedPropertyNodeAccess(NodeType *parent, const PointerType &ref, NoLock)
Definition: PropertyNode.h:694
TypedPropertyNode(const std::string &id, const std::string &name, const std::string &comment, bool isReadOnly, bool isVolatile)
Definition: PropertyNode.h:562
TypedPropertyNodeImpl(const std::string &id, const std::string &name, const std::string &comment, const value_type &value, bool isReadOnly, bool isVolatile)
Definition: PropertyNode.h:977
LockedPropertyNodeAccess< TypedPropertyNodeImplGetSetMixinBase< T >, value_type, true, IsCopyAssignable< value_type >::value > LockedAccess
Definition: PropertyNode.h:771
json::Value getAsJSON() const override
Returns the value of the property as JSON value.
Definition: PropertyNode.h:1148
void reflectCommon(Reflector &r)
Definition: PropertyNode.h:108
LockedPropertyNodeAccess(NodeType *parent, const PointerType &ref)
Definition: PropertyNode.h:691
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
typename LockedAccess::NoLock NoLock
Definition: PropertyNode.h:773
std::string Typename
Definition: Typename.h:60
void setName(const std::string &name)
For internal use by PropertySerializer only: Overrides the name of the property.
Definition: PropertyNode.h:179
typename Base::NoLock NoLock
Definition: PropertyNode.h:722
virtual void beginMoveChildren(const PropertyNode *node, int index, int count, int destination)=0
Base::value_type value_type
Definition: PropertyNode.h:884
typename LockedAccess::NoLock NoLock
Definition: PropertyNode.h:986
virtual ~AbstractRemotePropertyNode()
Definition: PropertyNode.h:1232
#define MIRA_SPLIT_REFLECT_MEMBER
Macro that insert a class member reflect() method just splitting reflection into a reflectRead() and ...
Definition: SplitReflect.h:189
const LockedAccess pointerAccess() const
Definition: PropertyNode.h:988
const LockedAccess pointerAccess(NoLock) const
Definition: PropertyNode.h:996
LockedAccess valueAccess()
Definition: PropertyNode.h:779
boost::recursive_timed_mutex MutexType
Definition: PropertyNode.h:507
Type trait to check if a class is copy assignable.
Provides property hints and attributes.
LockedAccess pointerAccess(NoLock)
Definition: PropertyNode.h:1000
json::Value getAsJSON() const override
Returns the value of the property as JSON value.
Definition: PropertyNode.h:1292
Definition: PropertyNode.h:445
virtual NodeList & children()
Returns a vector with all child property nodes.
Definition: PropertyNode.h:240
virtual void synchronize()=0
Synchronize with the reflected object (update PropertyNode when reflected content changes) ...
Grants thread-safe access to an object (the Protectee) that should be protected from concurrent acces...
Definition: ScopedAccess.h:119
const ValueType & r
Definition: PropertyNode.h:635
Holds a boost::function object to a special setter function that must meet the signature "void method...
Definition: GetterSetter.h:395
Definition: PropertyNode.h:642
std::list< std::pair< std::string, std::string > > AttributeValueList
Definition: PropertyHint.h:86
typename Base::NoLock NoLock
Definition: PropertyNode.h:646
json::Value getAsJSON() const override
Returns the value of the property as JSON value.
Definition: PropertyNode.h:917
virtual void endRemoveChildren(PropertyNodeListenerList &listeners)
Get compiler and platform independent typenames.
Definition: PropertyNode.h:617
Provides MIRA_SPLIT_REFLECT macros.
void removeChild(int index)
Removes child at specific index (without deleting it).
Definition: PropertyNode.h:376
NodeType * p
Definition: PropertyNode.h:634
bool has(const std::string &attribute) const
Returns true if the specified attribute exists.
Definition: PropertyHint.h:158
AttributeValueList toList() const
Returns the attributes/value list containing the property hints.
Definition: PropertyHint.h:110
void serialize(const std::string &name, const T &value, const std::string &comment="")
Serializes the specified object value under the given name.
Definition: Serializer.h:204
PropertyNode(const std::string &id, const std::string &name, const std::string &comment, const Typename &type, bool isReadOnly, bool isVolatile)
Definition: PropertyNode.h:223
void addChild(PropertyNode *child, int index=-1)
Adds the specified property node as child node.
Definition: PropertyNode.h:1239
uint8 VersionType
Definition: ReflectorInterface.h:72
#define MIRA_THROW(ex, msg)
Macro for throwing an exception.
Definition: Exception.h:78
void setVolatile(bool isVolatile)
Definition: PropertyNode.h:183
A property hint gives optional instructions to the property editor, i.e.
Definition: PropertyHint.h:82
void moveChild(int index, int destination)
Moves a child node from index to before element at destination.
Definition: PropertyNode.h:409
PropertyNode::NodeList & children() override
Returns a vector with all child property nodes.
Definition: PropertyNode.h:1299
LockedPropertyNodeAccessCommon(NodeType *parent, const ValueType &ref)
Definition: PropertyNode.h:619
LockedPropertyNodeAccess< TypedPropertyNodeImpl< T * >, value_type > LockedAccess
Definition: PropertyNode.h:985
LockType tryGetLock(const Duration &timeout=Duration::milliseconds(10))
In constrast to getLock(), this will return after a defined time even if the lock cannot be acquired ...
LockedAccess accessorAccess()
Definition: PropertyNode.h:1110
PropertyNodeInfo & operator=(const PropertyNodeInfo &info)
Definition: PropertyNode.h:92
void addChild(PropertyNode *child, int index=-1)
PropertyNodeInfo()
Definition: PropertyNode.h:77
LockedAccess accessorAccess(NoLock)
Definition: PropertyNode.h:1118
const PropertyNode::NodeList & children() const override
Returns a vector with all child property nodes.
Definition: PropertyNode.h:1300
const Typename & type() const
Returns the type of this property as Typename.
Definition: PropertyNode.h:151
Special TypedPropertyNode for remote properties.
Definition: PropertyNode.h:1277
Deserializer for serializing objects from JSON format.
Definition: JSONSerializer.h:406
T getHint(const std::string &attribute, const T &defaultValue=T()) const
Returns the specified value for the given property hint attribute.
Definition: PropertyNode.h:159
LockType getLock()
Create lock on the PropertyNode tree.
Base::value_type value_type
Definition: PropertyNode.h:855
const LockedAccess accessorAccess(NoLock) const
Definition: PropertyNode.h:1114
Base::value_type value_type
Definition: PropertyNode.h:823
json::Value getAsJSON() const override
Returns the value of the property as JSON value.
Definition: PropertyNode.h:1028
Use this class to represent time durations.
Definition: Time.h:106
A special node that acts only as (empty) root node for a property tree.
Definition: PropertyNode.h:463
friend LockedAccess
Definition: PropertyNode.h:772
typename Base::NoLock NoLock
Definition: PropertyNode.h:885
PropertyNodeInfo(const PropertyNodeInfo &info)
Definition: PropertyNode.h:86
LockedPropertyNodeAccess(NodeType *parent, const PointerType &ref)
Definition: PropertyNode.h:725
static constexpr bool mayHaveChildNodes()
Definition: PropertySerializer.h:306
boost::interprocess::scoped_lock< MutexType > LockType
Definition: PropertyNode.h:508
void synchronize() override
Synchronize with the reflected object (update PropertyNode when reflected content changes) ...
Definition: PropertyNode.h:1068
Implementation of TypedPropertyNode.
Definition: PropertyNode.h:880
std::string fullID(PropertyNode *p=NULL) const
Returns the full qualified ID of this property, including the names of the parent properties separate...
Definition: PropertyNode.h:293
LockedAccess valueAccess(NoLock)
Definition: PropertyNode.h:787
void update(T &value)
Is called by PropertySerializer to update the internal representation of the value of the property...
Definition: PropertyNode.h:804
void update(AccessorType &value)
Is called by PropertySerializer to update the internal representation of the value of the property...
Definition: PropertyNode.h:1188
bool isReadOnly() const
Returns true, if this property is read-only and hence, can not be modified.
Definition: PropertyNode.h:169
A special PropertyReflector that creates a PropertyNode for each reflected property.
Definition: PropertySerializer.h:68
void update(T *value)
Is called by PropertySerializer to update the internal representation of the value of the property...
Definition: PropertyNode.h:1064
const LockedAccess accessorAccess() const
Definition: PropertyNode.h:1106
virtual RootPropertyNode * getRootNode()
PropertyNode(const PropertyNodeInfo &info)
Definition: PropertyNode.h:220
void setFromJSON(const json::Value &json, const Duration &timeout) override
Sets the value of the property, where the value is described as JSON value.
Definition: PropertyNode.h:1005
Base::value_type value_type
Definition: PropertyNode.h:1281
TypedPropertyNodeImpl(const std::string &id, const std::string &name, const std::string &comment, const AccessorType &value, bool isReadOnly, bool isVolatile)
Definition: PropertyNode.h:1095
bool mIsVolatile
indicates whether the property is volatile
Definition: PropertyNode.h:194
RootPropertyNode::LockType tryGetLock(RootPropertyNode *root, const Duration &timeout)
Definition: PropertyNode.h:591
virtual void beginRemoveChildren(PropertyNodeListenerList &listeners, int index, NodeList::iterator it, int count)
Caller must ensure to keep listeners locked between beginRemoveChildren and endRemoveChildren! ...
TypedPropertyNodeImplGetSetMixin(const std::string &id, const std::string &name, const std::string &comment, value_type &value, bool isReadOnly, bool isVolatile)
Definition: PropertyNode.h:857
RootPropertyNode::LockType tryGetLock(const Duration &timeout)
Definition: PropertyNode.h:595
LockedPropertyNodeAccessCommon(NodeType *parent, const ValueType &ref, NoLock)
Definition: PropertyNode.h:630
ProtecteeMixin< PropertyNodeListenerList > ProtectedListenerList
Definition: PropertyNode.h:499
json_spirit::mValue Value
A value is an abstract description of data in JSON (underlying data can either be one of the JSON bas...
Definition: JSON.h:174
The Accessor class is used as an adapter to reduce the code bloat within the reflection and serializa...
Definition: Accessor.h:244
Partial Implementations of the get/set of TypedPropertyNode specialized for normal classes / for clas...
Definition: PropertyNode.h:819
const std::string & comment() const
Returns the comment that is associated with this property.
Definition: PropertyNode.h:148
void setFromJSON(const json::Value &json, const Duration &timeout) override
Sets the value of the property, where the value is described as JSON value.
Definition: PropertyNode.h:1124
void synchronize() override
Synchronize with the reflected object (update PropertyNode when reflected content changes) ...
Definition: PropertyNode.h:1301
ScopedAccess< ProtectedListenerList > getListeners(bool alreadyLocked=false)
void setFromJSON(const json::Value &json, const Duration &timeout) override
Sets the value of the property, where the value is described as JSON value.
Definition: PropertyNode.h:893
void setValue(value_type &nodeValue, const value_type &newValue)
Definition: PropertyNode.h:832
Base::value_type value_type
Definition: PropertyNode.h:975
Holds a boost::function object to a special getter function that must meet the signature "T method()"...
Definition: GetterSetter.h:87
void removeChildren(int index, int count)
Removes contiguous children, starting at index (without deleting them).
Definition: PropertyNode.h:382
void synchronize() override
Synchronize with the reflected object (update PropertyNode when reflected content changes) ...
Definition: PropertyNode.h:1192
void addChild(PropertyNode *child, int index=-1)
Adds the specified property node as child node.
virtual void beginAddChildren(PropertyNodeListenerList &listeners, int index, int count)
Caller must ensure to keep listeners locked between beginAddChildren and endAddChildren! ...
void synchronize() override
Synchronizes this node and its children with the the actual underlying data representation.
Definition: PropertyNode.h:954
T value_type
The type of the property.
Definition: PropertyNode.h:553
std::string mComment
the comment that is associated to the property
Definition: PropertyNode.h:190
virtual void setFromJSON(const json::Value &value, const Duration &timeout=Duration::milliseconds(100))=0
Sets the value of the property, where the value is described as JSON value.
bool mIsReadOnly
indicates whether the property is read-only
Definition: PropertyNode.h:193
void setValue(value_type &nodeValue, const value_type &newValue)
Definition: PropertyNode.h:793
ValueType & operator*()
Definition: PropertyNode.h:663
ValueType & operator*()
Definition: PropertyNode.h:705
LockedAccess pointerAccess()
Definition: PropertyNode.h:992
std::string mName
the name of the property (mostly equal to mID)
Definition: PropertyNode.h:189
TypedPropertyNodeImplGetSetMixinBase(const std::string &id, const std::string &name, const std::string &comment, value_type &value, bool isReadOnly, bool isVolatile)
Definition: PropertyNode.h:762
PropertyHint mHint
the specified property hints
Definition: PropertyNode.h:191
Typename mType
the type of the property
Definition: PropertyNode.h:192
AbstractRemotePropertyNode(const PropertyNodeInfo &info)
Definition: PropertyNode.h:1229
Grants thread-safe access to an object that should be protected from concurrent access.
TypedPropertyNode(const PropertyNodeInfo &info)
Definition: PropertyNode.h:557
virtual const NodeList & children() const
Returns a vector with all child property nodes.
Definition: PropertyNode.h:243
void removeChild(int index, NodeList::iterator it)
bool isVolatile() const
Returns true, if this property is volatile and hence, must be locked for access.
Definition: PropertyNode.h:172
RootPropertyNode::LockType getLock(RootPropertyNode *root)
Definition: PropertyNode.h:583
LockedPropertyNodeAccess< TypedPropertyNodeImpl< Accessor< Getter, Setter > >, AccessorType > LockedAccess
Definition: PropertyNode.h:1103
virtual void endMoveChildren(PropertyNodeListenerList &listeners)
virtual void endAddChildren()=0
void reflectWrite(Reflector &r)
Definition: PropertyNode.h:129
TypedPropertyNode< T > Base
Definition: PropertyNode.h:1280
PropertyNodeInfo(const std::string &id, const std::string &name, const std::string &comment, const Typename &type, bool isReadOnly, bool isVolatile)
Definition: PropertyNode.h:78
const std::string & name() const
Returns the name of this property as specified in the reflect() method.
Definition: PropertyNode.h:145
virtual std::string getAsString() const
Returns the value of the property as string.
TypedPropertyNode< T > * toTyped()
Casts this property node to a typed property node, or returns NULL if the types do not match...
Definition: PropertyNode.h:1344
TypedRemotePropertyNode(AbstractRemotePropertyNode *node)
Definition: PropertyNode.h:1285
bool hasHint(const std::string &attribute) const
Returns true if a hint with the specified attribute exists.
Definition: PropertyNode.h:164
void setValue(value_type &nodeValue, const value_type &newValue)
Definition: PropertyNode.h:864
Proxy class that is returned/set by the getter and setter methods of ChannelProperty.
Definition: ChannelProperty.h:154
RootPropertyNode * getRootNode() override
PropertyHint clone() const
Creates an explicit copy as replacement for the copy constructor.
Definition: PropertyHint.h:145
TypedPropertyNodeImpl(const std::string &id, const std::string &name, const std::string &comment, value_type &value, bool isReadOnly, bool isVolatile)
Definition: PropertyNode.h:887
TypedPropertyNode< T > * toTyped()
Specialized method that creates a TypedRemotePropertyNode.
Definition: PropertyNode.h:1371
T get(const std::string &attribute, const T &defaultValue=T()) const
Returns the specified value for the given attribute.
Definition: PropertyHint.h:175
virtual void beginAddChildren(const PropertyNode *node, int index, int count)=0
std::set< PropertyNodeListener * > PropertyNodeListenerList
Definition: PropertyNode.h:68
Typename typeName(bool cvqualify=true)
Returns a compiler and platform independent typename of T.
Definition: Typename.h:103
void unregisterListener(PropertyNodeListener *listener)
ValueType * PointerType
Definition: PropertyNode.h:684
Abstract base class for all typed property nodes.
Definition: PropertyNode.h:72
Serializer and Deserializer for JSON format.
const LockedAccess valueAccess(NoLock) const
Definition: PropertyNode.h:783
const ValueType & operator*() const
Definition: PropertyNode.h:656
virtual void endMoveChildren()=0
void reflectRead(Reflector &r)
Definition: PropertyNode.h:121
LockedPropertyNodeAccess(NodeType *parent, const PointerType &ref, NoLock)
Definition: PropertyNode.h:728
virtual json::Value getAsJSON() const =0
Returns the value of the property as JSON value.
const std::string & id() const
Returns the unique id of this property.
Definition: PropertyNode.h:142
Definition: PropertyNode.h:614
TypedPropertyNodeImplGetSetMixin(const std::string &id, const std::string &name, const std::string &comment, value_type &value, bool isReadOnly, bool isVolatile)
Definition: PropertyNode.h:825