File properties.hpp¶
Typedefs
A
Propertythat is backed by a shared pointer.
-
template<typename T>
struct ReadableProperty¶ - #include <properties.hpp>
Provides access to a property via a getter function.
- Template Parameters:
T – The type of the property
Subclassed by Property< T, std::shared_ptr< T > >, Property< T, Ptr >
Public Functions
-
inline explicit ReadableProperty(GetterFunction getterFunction)¶
- Parameters:
getterFunction – The getter function
Public Members
-
const GetterFunction get¶
The getter function.
-
template<typename T, typename Ptr = std::unique_ptr<T>>
struct WritableProperty¶ - #include <properties.hpp>
Provides access to a property via a setter function.
- Template Parameters:
T – The type of the property
Ptr – The type of the pointer that is backing the property
Subclassed by Property< T, std::shared_ptr< T > >, Property< T, Ptr >
Public Functions
-
inline explicit WritableProperty(SetterFunction setterFunction)¶
- Parameters:
setterFunction – The setter function
Public Members
-
const SetterFunction set¶
The setter function.
-
template<typename T, typename Ptr = std::unique_ptr<T>>
struct Property : public ReadableProperty<T>, public WritableProperty<T, std::unique_ptr<T>>¶ - #include <properties.hpp>
Provides access to a property via a getter and setter function.
- Template Parameters:
T – The type of the property
Ptr – The type of the pointer that is backing the property
Public Functions
-
inline Property(typename ReadableProperty<T>::GetterFunction getterFunction, typename WritableProperty<T, Ptr>::SetterFunction setterFunction)¶
- Parameters:
getterFunction – The getter function
setterFunction – The setter function
-
namespace util
Functions
-
template<typename T>
static inline ReadableProperty<T>::GetterFunction getterFunction(const std::unique_ptr<T> &uniquePtr)¶ Creates and returns a
GetterFunctionthat is backed by an unique pointer.- Template Parameters:
T – The return type of the
GetterFunction- Parameters:
uniquePtr – A reference to the unique pointer
- Returns:
The
GetterFunctionthat has been created
Creates and returns a
GetterFunctionthat is backed by a shared pointer.- Template Parameters:
T – The return type of the
GetterFunction- Parameters:
sharedPtr – A reference to the shared pointer
- Returns:
The
GetterFunctionthat has been created
Creates and returns a
GetterFunctionthat is backed by two shared pointers.- Template Parameters:
T – The return type of the
GetterFunctionS1 – The type of the first shared pointer. Must be a supertype of
TS2 – The type of the second shared pointer. Must be a supertype of
T
- Parameters:
sharedPtr1 – A reference to the first shared pointer
sharedPtr2 – A reference to the second shared pointer
- Returns:
The
GetterFunctionthat has been created
-
template<typename T>
static inline WritableProperty<T>::SetterFunction setterFunction(std::unique_ptr<T> &uniquePtr)¶ Creates and returns a
SetterFunctionthat is backed by an unique pointer.- Template Parameters:
T – The argument type of the
SetterFunction- Parameters:
uniquePtr – A reference to the unique pointer
- Returns:
The
SetterFunctionthat has been created
Creates and returns a
SetterFunctionthat is backed by a shared pointer.- Template Parameters:
T – The argument type of the
SetterFunction- Parameters:
sharedPtr – A reference to the shared pointer
- Returns:
The
SetterFunctionthat has been created
-
template<typename T>
static inline ReadableProperty<T> readableProperty(const std::unique_ptr<T> &uniquePtr)¶ Creates and returns a
ReadablePropertythat is backed by an unique pointer.- Template Parameters:
T – The type of the
ReadableProperty- Parameters:
uniquePtr – A reference to the unique pointer
- Returns:
The
ReadablePropertythat has been created
Creates and returns a
ReadablePropertythat is backed by a shared pointer.- Template Parameters:
T – The type of the
ReadablePropertyS – The type of the shared pointer. Must be a supertype of
T
- Parameters:
sharedPtr – A reference to the shared pointer
- Returns:
The
ReadablePropertythat has been created
Creates and returns a
ReadablePropertythat is backed by two shared pointers.- Template Parameters:
T – The type of the
ReadablePropertyS1 – The type of the first shared pointer. Must be a supertype of
TS2 – The type of the second shared pointer. Must be a supertype of
T
- Parameters:
sharedPtr1 – A reference to the first shared pointer
sharedPtr2 – A reference to the second shared pointer
- Returns:
The
ReadablePropertythat has been created
-
template<typename T>