Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::Property Class Referencefinal

Represents a property. More...

#include <property.h>

Public Member Functions

 Property (PropertySpec spec, Private notUsable)
 ~Property ()=default
std::string_view getName () const noexcept
 The name of the property.
std::string_view getDescription () const noexcept
 The documentation of the property.
MemberHash getId () const noexcept
 The propety id.
PropertyCategory getCategory () const noexcept
 Gets the property category.
ConstTypeHandle getType () const noexcept
 Gets the return type of the method (nullptr means void).
TransportMode getTransportMode () const noexcept
 Gets the transport mode for this property.
const MethodgetGetterMethod () const noexcept
 The getter method.
const MethodgetSetterMethod () const noexcept
 The setter method.
const EventgetChangeEvent () const noexcept
 The change notification event.
const std::vector< std::string > & getTags () const noexcept
 Any user-defined tags.
bool getCheckedSet () const noexcept
 If true, the user will validate sets to the property value.
bool operator== (const Property &other) const noexcept
 Compares if it is equivalent to another property.
bool operator!= (const Property &other) const noexcept
 Compares if it is not equivalent to another property.
MemberHash getHash () const noexcept
 Returns a unique hash for the Property computed at compile time.

Static Public Member Functions

static std::shared_ptr< Propertymake (PropertySpec spec)
 Factory function that validates the spec and creates a property. Throws std::exception if the spec is not valid.
static std::string makeGetterMethodName (const PropertySpec &spec)
 Utility function that creates the name of a getter method. Throws std::exception if the spec has an empty name.
static std::string makeSetterMethodName (const PropertySpec &spec)
 Utility function that creates the name of a setter method. Throws std::exception if the spec has an empty name.
static std::string makeChangeNotificationEventName (const PropertySpec &spec)
 Utility function that creates the name of a change notification event. Throws std::exception if the spec has an empty name.

Detailed Description

Represents a property.

Constructor & Destructor Documentation

◆ Property()

sen::Property::Property ( PropertySpec spec,
Private notUsable )

◆ ~Property()

sen::Property::~Property ( )
default

Member Function Documentation

◆ make()

std::shared_ptr< Property > sen::Property::make ( PropertySpec spec)
staticnodiscard

Factory function that validates the spec and creates a property. Throws std::exception if the spec is not valid.

◆ getName()

std::string_view sen::Property::getName ( ) const
nodiscardnoexcept

The name of the property.

◆ getDescription()

std::string_view sen::Property::getDescription ( ) const
nodiscardnoexcept

The documentation of the property.

◆ getId()

MemberHash sen::Property::getId ( ) const
nodiscardnoexcept

The propety id.

◆ getCategory()

PropertyCategory sen::Property::getCategory ( ) const
nodiscardnoexcept

Gets the property category.

◆ getType()

ConstTypeHandle sen::Property::getType ( ) const
nodiscardnoexcept

Gets the return type of the method (nullptr means void).

◆ getTransportMode()

TransportMode sen::Property::getTransportMode ( ) const
nodiscardnoexcept

Gets the transport mode for this property.

◆ getGetterMethod()

const Method & sen::Property::getGetterMethod ( ) const
nodiscardnoexcept

The getter method.

◆ getSetterMethod()

const Method & sen::Property::getSetterMethod ( ) const
nodiscardnoexcept

The setter method.

◆ getChangeEvent()

const Event & sen::Property::getChangeEvent ( ) const
nodiscardnoexcept

The change notification event.

◆ getTags()

const std::vector< std::string > & sen::Property::getTags ( ) const
nodiscardnoexcept

Any user-defined tags.

◆ getCheckedSet()

bool sen::Property::getCheckedSet ( ) const
nodiscardnoexcept

If true, the user will validate sets to the property value.

◆ makeGetterMethodName()

std::string sen::Property::makeGetterMethodName ( const PropertySpec & spec)
staticnodiscard

Utility function that creates the name of a getter method. Throws std::exception if the spec has an empty name.

◆ makeSetterMethodName()

std::string sen::Property::makeSetterMethodName ( const PropertySpec & spec)
staticnodiscard

Utility function that creates the name of a setter method. Throws std::exception if the spec has an empty name.

◆ makeChangeNotificationEventName()

std::string sen::Property::makeChangeNotificationEventName ( const PropertySpec & spec)
staticnodiscard

Utility function that creates the name of a change notification event. Throws std::exception if the spec has an empty name.

◆ operator==()

bool sen::Property::operator== ( const Property & other) const
nodiscardnoexcept

Compares if it is equivalent to another property.

◆ operator!=()

bool sen::Property::operator!= ( const Property & other) const
nodiscardnoexcept

Compares if it is not equivalent to another property.

◆ getHash()

MemberHash sen::Property::getHash ( ) const
nodiscardnoexcept

Returns a unique hash for the Property computed at compile time.


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