OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::PropertyDirectory Class Reference

#include "PropertyDirectory.h"

Inheritance diagram for ot::PropertyDirectory:
ot::Property ot::PropertyBase ot::Serializable

Public Member Functions

 PropertyDirectory (const PropertyDirectory *_other)
 
 PropertyDirectory (const PropertyBase &_base)
 
 PropertyDirectory (PropertyFlags _flags=PropertyFlags(NoFlags))
 
 PropertyDirectory (const std::string &_path, PropertyFlags _flags=PropertyFlags(NoFlags))
 
 PropertyDirectory (const std::string &_name, const std::string &_path, PropertyFlags _flags=PropertyFlags(NoFlags))
 
virtual ~PropertyDirectory ()
 
virtual std::string getPropertyType (void) const override
 
virtual PropertycreateCopy (void) const override
 Creates a copy of this property.
 
void setPath (const std::string &_path)
 
const std::string & getPath (void) const
 
- Public Member Functions inherited from ot::Property
 Property (const Property *_other)
 
 Property (const PropertyBase &_base)
 
 Property (PropertyFlags _flags=PropertyFlags(NoFlags))
 
 Property (const std::string &_name, PropertyFlags _flags=PropertyFlags(NoFlags))
 
virtual ~Property ()
 Destructor. Destroys the parent group if set.
 
PropertycreateCopyWithParents (void) const
 brief Creates a copy of this property and all parent groups excluding other properties and group paths. The created property will have all the parent groups set up to the root group.
 
virtual void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const override
 Add the object contents to the provided JSON object.
 
virtual void setFromJsonObject (const ot::ConstJsonObject &_object) override
 Will set the object contents from the provided JSON object.
 
void setParentGroup (PropertyGroup *_group)
 
PropertyGroupgetParentGroup (void) const
 
PropertyGroupgetRootGroup (void) const
 Returns the root group. If this item has no parent group returns 0.
 
std::string getPropertyPath (char _delimiter='/') const
 Returns the property path. The property path is a string containing all parent groups and the property name (e.g. "RootGroup/ChildGroup/ThisItem").
 
- Public Member Functions inherited from ot::PropertyBase
 PropertyBase (PropertyFlags _flags=PropertyFlags(NoFlags))
 Default constructor.
 
 PropertyBase (const std::string &_name, PropertyFlags _flags=PropertyFlags(NoFlags))
 Assignment constructor.
 
 PropertyBase (const PropertyBase &_other)
 Copy constructor.
 
virtual ~PropertyBase ()
 Destructor.
 
PropertyBaseoperator= (const PropertyBase &_other)
 Assignment operator.
 
void setPropertyName (const std::string &_name)
 
const std::string & getPropertyName (void) const
 
void setPropertyTitle (const std::string &_title)
 Set the property title If no title set the name will be used as title.
 
const std::string & getPropertyTitle (void) const
 Property title If no title set the name will be used as title.
 
void setPropertyTip (const std::string &_tip)
 
std::string & getPropertyTip (void)
 
const std::string & getPropertyTip (void) const
 
void setPropertyFlag (PropertyFlag _flag, bool _active=true)
 
void setPropertyFlags (PropertyFlags _flags)
 
PropertyFlagsgetPropertyFlags (void)
 
const PropertyFlagsgetPropertyFlags (void) const
 
void setSpecialType (const std::string &_type)
 
const std::string & getSpecialType (void) const
 
void addAdditionalPropertyData (const std::string &_key, const std::string &_data)
 
void setAdditionalPropertyData (const std::map< std::string, std::string > &_data)
 
const std::map< std::string, std::string > & getAllAdditionalPropertyData (void) const
 
std::string getAdditionalPropertyData (const std::string &_key) const
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Static Public Member Functions

static std::string propertyTypeString (void)
 
- Static Public Member Functions inherited from ot::PropertyBase
static std::string toString (PropertyFlag _flag)
 Creates a string representation of the provided PropertyFlag.
 
static PropertyFlag stringToFlag (const std::string &_flag)
 Returns the PropertyFlag that is represented by the string.
 
static std::list< std::string > toStringList (PropertyFlags _flags)
 Creates a list containing strings that represent the set PropertyFlags.
 
static PropertyFlags stringListToFlags (const std::list< std::string > &_flags)
 Returns the PropertyFlags that are represented by the string list.
 

Protected Member Functions

virtual void getPropertyData (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const override
 Add the property data to the provided JSON object The property type is already added.
 
virtual void setPropertyData (const ot::ConstJsonObject &_object) override
 Set the property data from the provided JSON object.
 

Additional Inherited Members

- Public Types inherited from ot::PropertyBase
enum  PropertyFlag {
  NoFlags = 0x0000 , IsReadOnly = 0x0001 , IsProtected = 0x0002 , IsHidden = 0x0004 ,
  HasMultipleValues = 0x0008 , HasInputError = 0x0010 , IsDeletable = 0x0020 , AllowCustomValues = 0x1000 ,
  AllowMultiselection = 0x2000
}
 The PropertyFlag enum contains different settings for properties. More...
 
typedef Flags< PropertyFlagPropertyFlags
 The PropertyFlag enum contains different settings for properties.
 

Constructor & Destructor Documentation

◆ PropertyDirectory() [1/5]

ot::PropertyDirectory::PropertyDirectory ( const PropertyDirectory * _other)

◆ PropertyDirectory() [2/5]

ot::PropertyDirectory::PropertyDirectory ( const PropertyBase & _base)

◆ PropertyDirectory() [3/5]

ot::PropertyDirectory::PropertyDirectory ( PropertyFlags _flags = PropertyFlags(NoFlags))
inline

◆ PropertyDirectory() [4/5]

ot::PropertyDirectory::PropertyDirectory ( const std::string & _path,
PropertyFlags _flags = PropertyFlags(NoFlags) )
inline

◆ PropertyDirectory() [5/5]

ot::PropertyDirectory::PropertyDirectory ( const std::string & _name,
const std::string & _path,
PropertyFlags _flags = PropertyFlags(NoFlags) )
inline

◆ ~PropertyDirectory()

virtual ot::PropertyDirectory::~PropertyDirectory ( )
inlinevirtual

Member Function Documentation

◆ createCopy()

ot::Property * ot::PropertyDirectory::createCopy ( void ) const
overridevirtual

Creates a copy of this property.

Implements ot::Property.

◆ getPath()

const std::string & ot::PropertyDirectory::getPath ( void ) const
inline

◆ getPropertyData()

void ot::PropertyDirectory::getPropertyData ( ot::JsonValue & _object,
ot::JsonAllocator & _allocator ) const
overrideprotectedvirtual

Add the property data to the provided JSON object The property type is already added.

Parameters
_objectJson object reference
_allocatorAllocator

Implements ot::Property.

◆ getPropertyType()

virtual std::string ot::PropertyDirectory::getPropertyType ( void ) const
inlineoverridevirtual

Implements ot::Property.

◆ propertyTypeString()

static std::string ot::PropertyDirectory::propertyTypeString ( void )
inlinestatic

◆ setPath()

void ot::PropertyDirectory::setPath ( const std::string & _path)
inline

◆ setPropertyData()

void ot::PropertyDirectory::setPropertyData ( const ot::ConstJsonObject & _object)
overrideprotectedvirtual

Set the property data from the provided JSON object.

Parameters
_objectThe JSON object containing the information
Exceptions
Willthrow an exception if the provided object is not valid (members missing or invalid types)

Implements ot::Property.


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