Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::Parameter Class Reference

Parameter object. More...

Inheritance diagram for gem::Parameter:
Collaboration diagram for gem::Parameter:

Public Member Functions

 Parameter ()=default
 Construct a parameter object with empty (key,value,name).
template<typename T>
 Parameter (const String &key, T v, const String &name=String())
 Construct a parameter object with key & value & name ( optional ).
 Parameter (const String &key, const String &v, const String &name=String())
 Construct a parameter object with key & string value & name ( optional ).
 Parameter (const String &key, const ParameterList &v, const String &name=String())
 Construct a parameter object with key & ParameterList value & name ( optional ).
 Parameter (const Parameter &parameter)=default
 Default copy constructor.
 Parameter (Parameter &&parameter)=default
 Default move constructor noexcept is deduced.
Parameteroperator= (const Parameter &parameter)=default
 Default copy assignment.
Parameteroperator= (Parameter &&parameter)=default
 Default move assignment noexcept is deduced.
bool operator== (const Parameter &obj) const noexcept
 Comparison operator equal ( will check key & value & name ).
bool operator!= (const Parameter &obj) const noexcept
 Comparison operator not equal ( will check key & value & name ).
bool operator! () const noexcept
 Check if this object is invalid.
 operator bool () const noexcept
 Check if this object is valid.
EValueType getType () const noexcept
 Get the original type of the value ( i.e.
const StringRef getKey () const noexcept
 Get the parameter key.
const StringRef getName () const noexcept
 Get the parameter name.
template<typename T>
std::enable_if< std::is_same< T, bool >::value, T >::type getValue () const noexcept
 Get the value as bool.
template<typename T>
std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value, T >::type getValue () const noexcept
 Get the value as 64 bit integer.
template<typename T>
std::enable_if< std::is_same< T, double >::value, T >::type getValue () const noexcept
 Get the value as double.
template<typename T>
std::enable_if< std::is_same< T, String >::value, T >::type getValue () const noexcept
 Get the value as string.
template<typename T>
std::enable_if< std::is_same< T, DataBuffer >::value, T >::type getValue () const noexcept
 Get the value as blob data buffer.
template<typename T>
std::enable_if< std::is_same< T, SearchableParameterList >::value||std::is_same< T, ParameterList >::value, T >::type getValue () const noexcept
 Get the value as searchable parameter list.

Detailed Description

Parameter object.

A parameter is a tuple ( key, value, name ).

Key is the string parameter identifier

Value is the parameter variant value. Use getType to get the native value storage

Name is the string parameter name. When parameters are returned from SDK the name is translated in the SDK language

Implements share-read / copy-on-write Api object over IParameter. Container for different types of values.

Constructor & Destructor Documentation

◆ Parameter() [1/5]

template<typename T>
gem::Parameter::Parameter ( const String & key,
T v,
const String & name = String() )
inline

Construct a parameter object with key & value & name ( optional ).

The value type is deduced from the input parameter

Parameters
[in]keyParameter key
[in]vParameter value
[in]nameParameter name
Template Parameters
TType of the value

◆ Parameter() [2/5]

gem::Parameter::Parameter ( const String & key,
const String & v,
const String & name = String() )
inline

Construct a parameter object with key & string value & name ( optional ).

Parameters
[in]keyParameter key
[in]vParameter value
[in]nameParameter name

◆ Parameter() [3/5]

gem::Parameter::Parameter ( const String & key,
const ParameterList & v,
const String & name = String() )
inline

Construct a parameter object with key & ParameterList value & name ( optional ).

Parameters
[in]keyParameter key
[in]vParameter value
[in]nameParameter name

◆ Parameter() [4/5]

gem::Parameter::Parameter ( const Parameter & parameter)
default

Default copy constructor.

Parameters
[in]parameterParameter object to copy

◆ Parameter() [5/5]

gem::Parameter::Parameter ( Parameter && parameter)
default

Default move constructor noexcept is deduced.

Parameters
[in]parameterParameter object to move

Member Function Documentation

◆ getKey()

const StringRef gem::Parameter::getKey ( ) const
inlinenoexcept

Get the parameter key.

Returns
The parameter key

◆ getName()

const StringRef gem::Parameter::getName ( ) const
inlinenoexcept

Get the parameter name.

If not available, the key value is returned

Returns
The parameter name

◆ getType()

EValueType gem::Parameter::getType ( ) const
inlinenoexcept

Get the original type of the value ( i.e.

the value type used to create the Parameter object )

Returns
The original type of the value

◆ getValue() [1/6]

template<typename T>
std::enable_if< std::is_same< T, SearchableParameterList >::value||std::is_same< T, ParameterList >::value, T >::type gem::Parameter::getValue ( ) const
noexcept

Get the value as searchable parameter list.

Returns
The value as searchable parameter list

◆ getValue() [2/6]

template<typename T>
std::enable_if< std::is_same< T, DataBuffer >::value, T >::type gem::Parameter::getValue ( ) const
inlinenoexcept

Get the value as blob data buffer.

Returns
The value as blob data buffer

◆ getValue() [3/6]

template<typename T>
std::enable_if< std::is_same< T, String >::value, T >::type gem::Parameter::getValue ( ) const
inlinenoexcept

Get the value as string.

Returns
The value as string

◆ getValue() [4/6]

template<typename T>
std::enable_if< std::is_same< T, double >::value, T >::type gem::Parameter::getValue ( ) const
inlinenoexcept

Get the value as double.

Returns
The value as double

◆ getValue() [5/6]

template<typename T>
std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value, T >::type gem::Parameter::getValue ( ) const
inlinenoexcept

Get the value as 64 bit integer.

Returns
The value as 64 bit integer

◆ getValue() [6/6]

template<typename T>
std::enable_if< std::is_same< T, bool >::value, T >::type gem::Parameter::getValue ( ) const
inlinenoexcept

Get the value as bool.

Returns
The value as bool

◆ operator bool()

gem::Parameter::operator bool ( ) const
inlinenoexcept

Check if this object is valid.

Returns
True if the object is valid

◆ operator!()

bool gem::Parameter::operator! ( ) const
inlinenoexcept

Check if this object is invalid.

Invalid is considered if key is empty.

Returns
True if the object is invalid

◆ operator!=()

bool gem::Parameter::operator!= ( const Parameter & obj) const
inlinenoexcept

Comparison operator not equal ( will check key & value & name ).

Parameters
[in]objParameter object to compare
Returns
True if the objects are not equal

◆ operator=() [1/2]

Parameter & gem::Parameter::operator= ( const Parameter & parameter)
default

Default copy assignment.

Parameters
[in]parameterParameter object to copy
Returns
Reference to this object

◆ operator=() [2/2]

Parameter & gem::Parameter::operator= ( Parameter && parameter)
default

Default move assignment noexcept is deduced.

Parameters
[in]parameterParameter object to move
Returns
Reference to this object

◆ operator==()

bool gem::Parameter::operator== ( const Parameter & obj) const
inlinenoexcept

Comparison operator equal ( will check key & value & name ).

Parameters
[in]objParameter object to compare
Returns
True if the objects are equal