ActiveLib
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
active::setting::ValueBase< T > Class Template Reference

#include <ValueBase.h>

Inheritance diagram for active::setting::ValueBase< T >:
Inheritance graph
[legend]
Collaboration diagram for active::setting::ValueBase< T >:
Collaboration graph
[legend]

Public Member Functions

 ValueBase ()
 
 ValueBase (const T &val, Status stat=good)
 
 ValueBase (const Value &value)
 
 ValueBase (const utility::String &stringVal)
 
 ValueBase (const ValueBase &source)=default
 
virtual ValueclonePtr () const override
 
virtual bool operator== (const Value &ref) const override
 
bool operator!= (const Value &ref) const
 
virtual bool operator< (const Value &ref) const override
 
virtual Valueoperator= (const Value &val) override
 
virtual Valueoperator= (bool val) override
 
virtual Valueoperator= (int32_t val) override
 
virtual Valueoperator= (uint32_t val) override
 
virtual Valueoperator= (int64_t val) override
 
virtual Valueoperator= (double val) override
 
virtual Valueoperator= (const active::utility::String &val) override
 
virtual Valueoperator= (const char *val) override
 
virtual Valueoperator= (const active::utility::Guid &val) override
 
virtual Valueoperator= (const active::utility::Time &val) override
 
virtual operator bool () const override
 
virtual operator int32_t () const override
 
virtual operator uint32_t () const override
 
virtual operator int64_t () const override
 
virtual operator double () const override
 
virtual operator active::utility::String () const override
 
virtual operator active::utility::Guid () const override
 
virtual operator active::utility::Time () const override
 
virtual bool isNull () const override
 
virtual Type getType () const override
 
virtual void setDefault () override
 
Valueoperator= (const Value &val)
 
- Public Member Functions inherited from active::setting::Value
 Value (Status stat=good)
 
virtual ~Value ()=default
 
bool operator!= (const Value &ref) const
 
virtual bool isGood () const
 
- Public Member Functions inherited from active::utility::Cloner
virtual ~Cloner ()=default
 

Public Attributes

data = T()
 The value data.
 
- Public Attributes inherited from active::setting::Value
Status status
 The value status.
 

Additional Inherited Members

- Public Types inherited from active::setting::Value
enum class  Status { undefined = 0 , bad , good }
 The value status (defines whether a value has been explicitly set and (if so) if it's meaningful.
 
enum class  Type {
  null = 0 , boolType , idType , intType ,
  floatType , stringType , timeType
}
 Supported value types (broad groups, e.g. int32_t and int64_t are both intType)
 
using Unique = std::unique_ptr<Value>
 Unique pointer.
 
using Shared = std::shared_ptr<Value>
 Shared pointer.
 
using Option = std::optional<Value>
 Optional.
 
- Static Public Member Functions inherited from active::setting::Value
static std::optional< TypetypeFromName (const utility::String &text)
 
static utility::String nameForType (Type type)
 

Detailed Description

template<class T>
class active::setting::ValueBase< T >

Template class for all single-item setting values, implementing some of the base Value functions

Refer to the base Value class for more information about the purpose of this class

Constructor & Destructor Documentation

◆ ValueBase() [1/4]

template<class T >
active::setting::ValueBase< T >::ValueBase ( )
inline

Default constructor

◆ ValueBase() [2/4]

template<class T >
active::setting::ValueBase< T >::ValueBase ( const T & val,
Status stat = good )
inline

Constructor

Parameters
valThe value to assign
statThe value status

◆ ValueBase() [3/4]

template<class T >
active::setting::ValueBase< T >::ValueBase ( const Value & value)
inline

Constructor

Parameters
valueA value to assign

◆ ValueBase() [4/4]

template<class T >
active::setting::ValueBase< T >::ValueBase ( const utility::String & stringVal)
inline

Constructor (for all non-string types)

Parameters
stringValA string value to assign

Member Function Documentation

◆ clonePtr()

template<class T >
virtual Value * active::setting::ValueBase< T >::clonePtr ( ) const
inlineoverridevirtual

Clone method

Returns
A clone of this object

Implements active::setting::Value.

◆ getType()

Value::Type active::setting::UInt32Value::getType ( ) const
inlineoverridevirtual

Get the value type

Returns
The value type

Implements active::setting::Value.

◆ isNull()

bool active::setting::UInt32Value::isNull ( ) const
inlineoverridevirtual

Determine if the value is null, e.g. zero, empty, undefined

Returns
True if the value is null

Implements active::setting::Value.

◆ operator active::utility::Guid()

template<class T >
virtual active::setting::ValueBase< T >::operator active::utility::Guid ( ) const
inlineoverridevirtual

Get a guid value

Returns
A guid value

Implements active::setting::Value.

◆ operator active::utility::String()

template<class T >
virtual active::setting::ValueBase< T >::operator active::utility::String ( ) const
inlineoverridevirtual

Get a string value

Returns
A string value

Implements active::setting::Value.

◆ operator active::utility::Time()

template<class T >
virtual active::setting::ValueBase< T >::operator active::utility::Time ( ) const
inlineoverridevirtual

Get a time value

Returns
A time value

Implements active::setting::Value.

◆ operator bool()

active::setting::UInt32Value::operator bool ( ) const
inlineoverridevirtual

Get a boolean value

Returns
A boolean value

Implements active::setting::Value.

◆ operator double()

active::setting::UInt32Value::operator double ( ) const
inlineoverridevirtual

Get a double precision value

Returns
A double precision value

Implements active::setting::Value.

◆ operator int32_t()

active::setting::UInt32Value::operator int32_t ( ) const
inlineoverridevirtual

Get a 32-bit integer value

Returns
A 32-bit integer value

Implements active::setting::Value.

◆ operator int64_t()

active::setting::UInt32Value::operator int64_t ( ) const
inlineoverridevirtual

Get a 64-bit integer value

Returns
A 64-bit integer value

Implements active::setting::Value.

◆ operator uint32_t()

active::setting::UInt32Value::operator uint32_t ( ) const
inlineoverridevirtual

Get an unsigned 32-bit integer value

Returns
An unsigned 32-bit integer value

Implements active::setting::Value.

◆ operator!=()

template<class T >
bool active::setting::ValueBase< T >::operator!= ( const Value & ref) const
inline

Inequality operator

Parameters
refA value to compare with this
Returns
True if this is not identical to ref

◆ operator<()

template<class T >
virtual bool active::setting::ValueBase< T >::operator< ( const Value & ref) const
inlineoverridevirtual

Less-than operator

Parameters
refA value to compare with this
Returns
True if this is less than ref

Implements active::setting::Value.

◆ operator=() [1/11]

Value & active::setting::UInt32Value::operator= ( bool val)
inlineoverridevirtual

Assignment operator

Parameters
valA boolean value to assign
Returns
A reference to this

Implements active::setting::Value.

Reimplemented in active::setting::MeasuredValue< T >, and active::setting::MeasuredValue< active::measure::AngleUnit >.

◆ operator=() [2/11]

Value & active::setting::StringValue::operator= ( const active::utility::Guid & val)
inlineoverridevirtual

Assignment operator

Parameters
valA guid value to assign
Returns
A reference to this

Implements active::setting::Value.

Reimplemented in active::setting::MeasuredValue< T >, and active::setting::MeasuredValue< active::measure::AngleUnit >.

◆ operator=() [3/11]

Value & active::setting::UInt32Value::operator= ( const active::utility::String & val)
inlineoverridevirtual

◆ operator=() [4/11]

Value & active::setting::UInt32Value::operator= ( const active::utility::Time & val)
inlineoverridevirtual

Assignment operator

Parameters
valA time value to assign
Returns
A reference to this

Implements active::setting::Value.

Reimplemented in active::setting::MeasuredValue< T >, and active::setting::MeasuredValue< active::measure::AngleUnit >.

◆ operator=() [5/11]

Value & active::setting::DoubleValue::operator= ( const char * val)
inlineoverridevirtual

Assignment operator

Parameters
valA string value to assign
Returns
A reference to this

Reimplemented from active::setting::Value.

Reimplemented in active::setting::MeasuredValue< T >, and active::setting::MeasuredValue< active::measure::AngleUnit >.

Here is the call graph for this function:

◆ operator=() [6/11]

Value & active::setting::ValueBase< utility::Guid >::operator= ( const Value & val)
inlinevirtual

Assignment operator

Parameters
valA value to assign
Returns
A reference to this

Implements active::setting::Value.

◆ operator=() [7/11]

template<class T >
virtual Value & active::setting::ValueBase< T >::operator= ( const Value & val)
inlineoverridevirtual

◆ operator=() [8/11]

Value & active::setting::UInt32Value::operator= ( double val)
inlineoverridevirtual

Assignment operator

Parameters
valA double precision value to assign
Returns
A reference to this

Implements active::setting::Value.

Reimplemented in active::setting::MeasuredValue< T >, and active::setting::MeasuredValue< active::measure::AngleUnit >.

◆ operator=() [9/11]

Value & active::setting::UInt32Value::operator= ( int32_t val)
inlineoverridevirtual

Assignment operator

Parameters
valA 32-bit integer value to assign
Returns
A reference to this

Assignment operator

Parameters
valA boolean value to assign
Returns
A reference to this

Implements active::setting::Value.

Reimplemented in active::setting::MeasuredValue< T >, and active::setting::MeasuredValue< active::measure::AngleUnit >.

◆ operator=() [10/11]

Value & active::setting::UInt32Value::operator= ( int64_t val)
inlineoverridevirtual

Assignment operator

Parameters
valA 64-bit integer value to assign
Returns
A reference to this

Implements active::setting::Value.

Reimplemented in active::setting::MeasuredValue< T >, and active::setting::MeasuredValue< active::measure::AngleUnit >.

◆ operator=() [11/11]

Value & active::setting::UInt32Value::operator= ( uint32_t val)
inlineoverridevirtual

Assignment operator

Parameters
valAn unsigned 32-bit integer value to assign
Returns
A reference to this

Implements active::setting::Value.

Reimplemented in active::setting::MeasuredValue< T >, and active::setting::MeasuredValue< active::measure::AngleUnit >.

◆ operator==()

template<class T >
virtual bool active::setting::ValueBase< T >::operator== ( const Value & ref) const
inlineoverridevirtual

Equality operator

Parameters
refA value to compare with this
Returns
True if this is identical to ref

Implements active::setting::Value.

◆ setDefault()

template<class T >
virtual void active::setting::ValueBase< T >::setDefault ( )
inlineoverridevirtual

Set a default value

Implements active::setting::Value.


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