openDAQ
Open data acquisition platform
PropertyObjectClassPtr Class Reference

Container of properties that can be used as a base class when instantiating a Property object. More...

+ Inheritance diagram for PropertyObjectClassPtr:
+ Collaboration diagram for PropertyObjectClassPtr:

Detailed Description

Container of properties that can be used as a base class when instantiating a Property object.

A Property object class is defined via a name and a list of properties. For a Property object to be created, using a class as its base, a class must be added to the Type manager.

The name of the class must be unique within a given Type manager instance. The name of the Class is used when choosing a template class for a Property object, as well as to define a class hierarchy. A class with the Parent name configured will inherit the properties of the class with said name.

The properties of a Property object class are, by default, sorted in insertion order. The order can, however, be overridden by specifying a Property object order - a list containing the names of properties. If specified, when retrieving the list of properties, they will be in the provided order.

All Property object class objects are created as Property object class builder objects that allow for customization and building of the class.

Public Member Functions

daq::StringPtr getParentName () const
 Gets the name of the parent of the property class. More...
 
daq::PropertyPtr getProperty (const daq::StringPtr &propertyName) const
 Gets the class's property with the given name. More...
 
daq::Bool hasProperty (const daq::StringPtr &propertyName) const
 Checks if the property is registered. More...
 
daq::ListPtr< daq::IProperty > getProperties (daq::Bool includeInherited) const
 Gets the list of properties added to the class. More...
 
- Public Member Functions inherited from GenericTypePtr< IPropertyObjectClass >
StringPtr getName () const
 Gets the name of the Type. More...
 

Member Function Documentation

◆ getParentName()

daq::StringPtr getParentName ( ) const
inline

Gets the name of the parent of the property class.

Returns
The parent class's name.

◆ getProperties()

daq::ListPtr<daq::IProperty> getProperties ( daq::Bool  includeInherited) const
inline

Gets the list of properties added to the class.

Parameters
includeInheritedIf true, the returned list of properties also includes the properties of the class's ancestors.
Returns
The list of properties.
Exceptions
OpendaqErrExceptionif the parent name is set, but the Type manager is not available.

The properties are sorted in insertion order, unless a custom sorting order is specified for the class. Any properties not listed in the custom sorting order are listed at the end of the properties list, sorted in insertion order.

◆ getProperty()

daq::PropertyPtr getProperty ( const daq::StringPtr &  propertyName) const
inline

Gets the class's property with the given name.

Parameters
propertyNameThe property's name.
Returns
The property.
Exceptions
NotFoundExceptionif the Property with name propertyName is not added to the class.
OpendaqErrExceptionif the parent name is set, but the Type manager is not available.

◆ hasProperty()

daq::Bool hasProperty ( const daq::StringPtr &  propertyName) const
inline

Checks if the property is registered.

Parameters
propertyNameThe property's name.
Returns
True if the property is registered, false otherwise.
Exceptions
OpendaqErrExceptionif the parent name is set, but the Type manager is not available.