Web Analytics Made Easy - Statcounter
Skip to content

Class SBCMetaValue#

ClassList > SBCMetaValue

This class represents values. More...

  • #include <SBCMetaValue.hpp>

Classes#

Type Name
class ValueFactory< true, U > <typename U>
Partial specialization for values with proxies.

Public Static Attributes#

Type Name
const SBCMetaValue empty
An empty, non-valid, SBValue.

Public Functions#

Type Name
SBCMetaValue (U u)
Generic constructor.
SBCMetaValue (SBCMetaValueType< U > * u)
Constructs a value.
SBCMetaValue (SBCMetaValueHolder< U > * u)
Constructs a value.
SBCMetaValue (SBCMetaValueBase * u)
Constructs a value.
SBCMetaValue (const SBCMetaValue & u)
Constructs a value.
SBCMetaValue () noexcept
Constructs an empty value.
virtual SBCMetaValue call (const std::string & functionName, const SBCMetaValue & t0=SBCMetaValue(), const SBCMetaValue & t1=SBCMetaValue(), const SBCMetaValue & t2=SBCMetaValue(), const SBCMetaValue & t3=SBCMetaValue(), const SBCMetaValue & t4=SBCMetaValue(), const SBCMetaValue & t5=SBCMetaValue(), const SBCMetaValue & t6=SBCMetaValue(), const SBCMetaValue & t7=SBCMetaValue(), const SBCMetaValue & t8=SBCMetaValue(), const SBCMetaValue & t9=SBCMetaValue(), const SBCMetaValue & t10=SBCMetaValue(), const SBCMetaValue & t11=SBCMetaValue(), const SBCMetaValue & t12=SBCMetaValue(), const SBCMetaValue & t13=SBCMetaValue(), const SBCMetaValue & t14=SBCMetaValue(), const SBCMetaValue & t15=SBCMetaValue()) const
Calls the function functionName of the value with argumentst0 ,t1 , ...,t15 .
virtual void clear (const std::string & attributeName) const
Clears attribute attributeName from the value when possible.
virtual SBCMetaValue constCall (const std::string & functionName, const SBCMetaValue & t0=SBCMetaValue(), const SBCMetaValue & t1=SBCMetaValue(), const SBCMetaValue & t2=SBCMetaValue(), const SBCMetaValue & t3=SBCMetaValue(), const SBCMetaValue & t4=SBCMetaValue(), const SBCMetaValue & t5=SBCMetaValue(), const SBCMetaValue & t6=SBCMetaValue(), const SBCMetaValue & t7=SBCMetaValue(), const SBCMetaValue & t8=SBCMetaValue(), const SBCMetaValue & t9=SBCMetaValue(), const SBCMetaValue & t10=SBCMetaValue(), const SBCMetaValue & t11=SBCMetaValue(), const SBCMetaValue & t12=SBCMetaValue(), const SBCMetaValue & t13=SBCMetaValue(), const SBCMetaValue & t14=SBCMetaValue(), const SBCMetaValue & t15=SBCMetaValue()) const
Calls the const function functionName of the value with argumentst0 ,t1 , ...,t15 .
virtual SBCMetaValue get (const std::string & attributeName) const
Returns the value of attribute attributeName for this value.
SBCMetaValue getBaseType () const
Returns the base type.
std::string getBaseTypeName () const
Returns the base type name.
SBCMetaValue getClassType () const
Returns the class type.
std::string getClassTypeName () const
Returns the class type name.
unsigned int getNumberOfParameters () const
Returns the number of parameters of a function type.
SBCMetaValue getOutputType () const
Returns the output type.
std::string getOutputTypeName () const
Returns the output type name.
SBCMetaValue getParameterType (unsigned int i) const
Returns the type of parameter i .
std::string getParameterTypeName (unsigned int i) const
Returns the type name of parameter i .
SBCMetaValue getParentType () const
Returns the parent type.
std::string getParentTypeName () const
Returns the parent type name.
virtual SBCClassProxy * getProxy () const
Returns the proxy of the value.
SBCMetaValue getRootType () const
Returns the root type.
std::string getRootTypeName () const
Returns the root type name.
std::string getShortBaseTypeName () const
Returns the short base type name.
std::string getShortClassTypeName () const
Returns the short class type name.
std::string getShortOutputTypeName () const
Returns the short output type name.
std::string getShortParameterTypeName (unsigned int i) const
Returns the short type name of parameter i .
std::string getShortParentTypeName () const
Returns the short parent type name.
std::string getShortRootTypeName () const
Returns the short root type name.
std::string getShortTypeName () const
Returns the short type name.
virtual unsigned int getSize (const std::string & attributeName) const
Returns the size of attribute attributeName in the value when relevant.
std::string getTypeName () const
Returns the type name.
SBCContainerUUID getTypeUUID () const
Returns the type UUID .
SBCMetaValueBase * getValue () noexcept const
Returns the value.
virtual bool has (const std::string & attributeName) const
Returns whether attribute attributeName exists in the value and has a value.
bool hasBaseType () const
Returns true if the value is of a type that has a base type.
bool isArrayType () const
Returns true if the value is of an array type.
bool isClassType () const
Returns true if the value is of a class type.
bool isConstType () const
Returns true if the value is of a const type.
bool isEnumType () const
Returns true if the value is of an enum type.
bool isFunctionType () const
Returns true if the value is of a function type.
bool isFundamentalType () const
Returns true if the value is of a fundamental type.
bool isPointerToFunctionType () const
Returns true if the value is of a pointer to function type.
bool isPointerToMemberFunctionType () const
Returns true if the value is of a pointer to member function type.
bool isPointerToMemberType () const
Returns true if the value is of a pointer to member type.
bool isPointerType () const
Returns true if the value is of a pointer type.
bool isReferenceType () const
Returns true if the value is of a reference type.
bool isRegisteredType () const
Returns true if the value is of a registered type.
bool isValid () noexcept const
Returns whether the value is valid and can be dereferenced with getValue .
bool isVolatileType () const
Returns true if the value is of a volatile type.
operator U () const
SBCMetaValue & operator= (const SBCMetaValue & value)
Assignment operator.
virtual void set (const std::string & attributeName, const SBCMetaValue & value, const SBCMetaValue & size=0) const
Sets the value of attribute attributeName for this value tovalue .
~SBCMetaValue ()
Destructs the value.

Public Static Functions#

Type Name
SBCMetaValue buildType ()
SBCMetaValue buildValue ()
SBCMetaValue buildValue (U u)
bool canCastFrom (const SBCMetaValue & fromValue)
U castFrom (const SBCMetaValue & fromValue)

Detailed Description#

This class is the base class of value holders, and a key component of the introspection mechanism.

In particular, it is the direct base class of the template class SBCMetaValueType, used to contain type information, which is itself the direct base class of the template class SBCMetaValueHolder, used to hold values.

Assume a SAMSON Extension called SEElement defines a class A, and another Extension called SEOtherElement wants to use it. If the Extension called SEOtherElement does not have access to the declaration of class A (typically provided in a header file included in SEElement), it cannot use the symbol A in its source code. For example, if the source code of SEOtherElement contained the line:

A* a = new A();
the compiler would complain that the symbol A is not defined.

In order to provide access to exposed classes, SAMSON uses a mechanism to hold values (for example, pointers to objects) in a uniform way. In the example above, the constructor exposed in the Extension SEElement returns a value holder that stores a pointer to the new instance of class A:

return new SBValueHolder<A*>(new A());
and the Extension SEOtherElement sees it as an SBValue that stores this value holder as a pointer to a SBValueBase (the base class of SBValueHolder<A*>):
SBValue classInstance = classProxy->createInstance();

This class is able to provide information about a hold type or a hold value.

Short name: SBValue

See also: SBCMetaType, SBCMetaValueType, SBCMetaValueHolder

See also: Introspection

Public Static Attributes Documentation#

variable empty#

An empty, non-valid, SBValue.

const SBCMetaValue SBCMetaValue::empty;


Public Functions Documentation#

function SBCMetaValue [1/6]#

Generic constructor.

template<typename U>
inline SBCMetaValue::SBCMetaValue (
    U u
) 


function SBCMetaValue [2/6]#

Constructs a value.

template<typename U>
inline SBCMetaValue::SBCMetaValue (
    SBCMetaValueType < U > * u
) 


function SBCMetaValue [3/6]#

Constructs a value.

template<typename U>
inline SBCMetaValue::SBCMetaValue (
    SBCMetaValueHolder < U > * u
) 


function SBCMetaValue [4/6]#

Constructs a value.

inline SBCMetaValue::SBCMetaValue (
    SBCMetaValueBase * u
) 


function SBCMetaValue [5/6]#

Constructs a value.

inline SBCMetaValue::SBCMetaValue (
    const SBCMetaValue & u
) 


function SBCMetaValue [6/6]#

Constructs an empty value.

SBCMetaValue::SBCMetaValue () noexcept

Default constructs an empty SBCMetaValue.

The created instance does not hold any value; its internal pointer is set to nullptr.


function call#

Calls the function functionName of the value with argumentst0 ,t1 , ...,t15 .

virtual SBCMetaValue SBCMetaValue::call (
    const std::string & functionName,
    const SBCMetaValue & t0=SBCMetaValue (),
    const SBCMetaValue & t1=SBCMetaValue (),
    const SBCMetaValue & t2=SBCMetaValue (),
    const SBCMetaValue & t3=SBCMetaValue (),
    const SBCMetaValue & t4=SBCMetaValue (),
    const SBCMetaValue & t5=SBCMetaValue (),
    const SBCMetaValue & t6=SBCMetaValue (),
    const SBCMetaValue & t7=SBCMetaValue (),
    const SBCMetaValue & t8=SBCMetaValue (),
    const SBCMetaValue & t9=SBCMetaValue (),
    const SBCMetaValue & t10=SBCMetaValue (),
    const SBCMetaValue & t11=SBCMetaValue (),
    const SBCMetaValue & t12=SBCMetaValue (),
    const SBCMetaValue & t13=SBCMetaValue (),
    const SBCMetaValue & t14=SBCMetaValue (),
    const SBCMetaValue & t15=SBCMetaValue ()
) const

Calls a member function of the value with up to 16 arguments.

This function invokes the function named functionName on the underlying value, passing the provided arguments t0 through t15. Arguments not needed by the function may be omitted (default-initialized).

Parameters:

  • functionName Name of the function to call on the value.
  • t0 First argument to pass to the function (default empty).
  • t1 Second argument to pass to the function (default empty).
  • t2 Third argument to pass to the function (default empty).
  • t3 Fourth argument to pass to the function (default empty).
  • t4 Fifth argument to pass to the function (default empty).
  • t5 Sixth argument to pass to the function (default empty).
  • t6 Seventh argument to pass to the function (default empty).
  • t7 Eighth argument to pass to the function (default empty).
  • t8 Ninth argument to pass to the function (default empty).
  • t9 Tenth argument to pass to the function (default empty).
  • t10 Eleventh argument to pass to the function (default empty).
  • t11 Twelfth argument to pass to the function (default empty).
  • t12 Thirteenth argument to pass to the function (default empty).
  • t13 Fourteenth argument to pass to the function (default empty).
  • t14 Fifteenth argument to pass to the function (default empty).
  • t15 Sixteenth argument to pass to the function (default empty).

Returns:

The result of the function call as an SBCMetaValue. If the function cannot be called, an empty SBCMetaValue is returned.


function clear#

Clears attribute attributeName from the value when possible.

virtual void SBCMetaValue::clear (
    const std::string & attributeName
) const

Clears the specified attribute from the value when possible.

This function clears attribute attributeName from the value when possible.

Parameters:

  • attributeName Name of the attribute to clear.

function constCall#

Calls the const function functionName of the value with argumentst0 ,t1 , ...,t15 .

virtual SBCMetaValue SBCMetaValue::constCall (
    const std::string & functionName,
    const SBCMetaValue & t0=SBCMetaValue (),
    const SBCMetaValue & t1=SBCMetaValue (),
    const SBCMetaValue & t2=SBCMetaValue (),
    const SBCMetaValue & t3=SBCMetaValue (),
    const SBCMetaValue & t4=SBCMetaValue (),
    const SBCMetaValue & t5=SBCMetaValue (),
    const SBCMetaValue & t6=SBCMetaValue (),
    const SBCMetaValue & t7=SBCMetaValue (),
    const SBCMetaValue & t8=SBCMetaValue (),
    const SBCMetaValue & t9=SBCMetaValue (),
    const SBCMetaValue & t10=SBCMetaValue (),
    const SBCMetaValue & t11=SBCMetaValue (),
    const SBCMetaValue & t12=SBCMetaValue (),
    const SBCMetaValue & t13=SBCMetaValue (),
    const SBCMetaValue & t14=SBCMetaValue (),
    const SBCMetaValue & t15=SBCMetaValue ()
) const

Calls a const member function of the value with up to 16 arguments.

This function invokes the const function named functionName on the underlying value, passing the provided arguments t0 through t15. Arguments not needed by the function may be omitted (default-initialized).

Parameters:

  • functionName Name of the const function to call on the value.
  • t0 First argument to pass to the function (default empty).
  • t1 Second argument to pass to the function (default empty).
  • t2 Third argument to pass to the function (default empty).
  • t3 Fourth argument to pass to the function (default empty).
  • t4 Fifth argument to pass to the function (default empty).
  • t5 Sixth argument to pass to the function (default empty).
  • t6 Seventh argument to pass to the function (default empty).
  • t7 Eighth argument to pass to the function (default empty).
  • t8 Ninth argument to pass to the function (default empty).
  • t9 Tenth argument to pass to the function (default empty).
  • t10 Eleventh argument to pass to the function (default empty).
  • t11 Twelfth argument to pass to the function (default empty).
  • t12 Thirteenth argument to pass to the function (default empty).
  • t13 Fourteenth argument to pass to the function (default empty).
  • t14 Fifteenth argument to pass to the function (default empty).
  • t15 Sixteenth argument to pass to the function (default empty).

Returns:

The result of the const function call as an SBCMetaValue. If the function cannot be called, an empty SBCMetaValue is returned.


function get#

Returns the value of attribute attributeName for this value.

virtual SBCMetaValue SBCMetaValue::get (
    const std::string & attributeName
) const

Retrieves the value of the specified attribute.

This function returns the value of attribute attributeName for this value.

Parameters:

  • attributeName Name of the attribute to retrieve.

Returns:

The attribute value as an SBCMetaValue. If the attribute does not exist, an empty SBCMetaValue is returned.


function getBaseType#

Returns the base type.

SBCMetaValue SBCMetaValue::getBaseType () const

Returns the base type of this type.

This function returns the base type, i.e. an instance of the template class SBCMetaValueType which contains type information about the base type of this type. For example, the base type of SBMStructuralModelNodeAtom is SBMStructuralModelNode.

Note that this function returns a type. If a string is needed, use SBCMetaValue::getBaseTypeName().

See also: SBCMetaValue::getBaseTypeName()

Returns:

The base type as an SBCMetaValue.


function getBaseTypeName#

Returns the base type name.

std::string SBCMetaValue::getBaseTypeName () const

Returns the type name of the base type of T.

This function returns the type name of the base type of T. For example, the base type name of SBMStructuralModelNodeAtom is "SBMStructuralModelNode".

Note that this function returns a string. If a type is needed, use SBCMetaValue::getBaseType().

See also: SBCMetaValue::getBaseType()

Returns:

The base type name as a string, or an empty string if the value is invalid.


function getClassType#

Returns the class type.

SBCMetaValue SBCMetaValue::getClassType () const

Returns the class type of this type when it is a pointer to a member or a member function.

This function returns the class type, i.e. an instance of the template class SBCMetaValueType which contains type information about the class type of this type, when the type is a pointer to a member or a pointer to a member function. For example, the class type name of & SBMStructuralModelNodeAtom::clearName is SBMStructuralModelNodeAtom.

Note that this function returns a type. If a string is needed, use SBCMetaValue::getClassTypeName().

See also: SBCMetaValue::getClassTypeName()

Returns:

The class type as an SBCMetaValue.


function getClassTypeName#

Returns the class type name.

std::string SBCMetaValue::getClassTypeName () const

Returns the type name of the class associated with the held member or member function.

This function returns the type name of the class associated to T, when T is a pointer to a member or a pointer to a member function ("void" otherwise). For example, the class type name of & SBMStructuralModelNodeAtom::clearName is "SBMStructuralModelNodeAtom".

Note that this function returns a string. If type is needed, use SBCMetaValue::getClassType().

See also: SBCMetaValue::getClassType()

Returns:

The class type name as a string, or an empty string if not applicable.


function getNumberOfParameters#

Returns the number of parameters of a function type.

unsigned int SBCMetaValue::getNumberOfParameters () const

Retrieves the number of parameters of the held function type.

If the value does not represent a function, zero is returned.

Returns:

The number of parameters, or zero if not applicable.


function getOutputType#

Returns the output type.

SBCMetaValue SBCMetaValue::getOutputType () const

Returns the output type of this type when it is a function.

This function returns the output type, i.e. an instance of the template class SBCMetaValueType which contains type information about the output type of this type, when the type is a function. For example, the output type name of SBMStructuralModelNodeAtom* getFirstAtom() is SBMStructuralModelNodeAtom.

Note that this function returns a type. If a string is needed, use SBCMetaValue::getOutputTypeName().

See also: SBCMetaValue::getOutputTypeName()

Returns:

The output type as an SBCMetaValue.


function getOutputTypeName#

Returns the output type name.

std::string SBCMetaValue::getOutputTypeName () const

Returns the type name of the output (return) type of the held function type.

This function returns the type name of the output type of T, when T is a function. For example, the output type name of SBMStructuralModelNodeAtom* getFirstAtom() is "SBMStructuralModelNodeAtom*".

Note that this function returns a string. If type is needed, use SBCMetaValue::getOutputType().

See also: SBCMetaValue::getOutputType()

Returns:

The output type name as a string, or an empty string if not applicable.


function getParameterType#

Returns the type of parameter i .

SBCMetaValue SBCMetaValue::getParameterType (
    unsigned int i
) const

Returns the type of parameter i of this function type.

This function returns the type of parameter i, i.e. an instance of the template class SBCMetaValueType which contains type information about the type of parameter i, when the type is a function. For example, the type name of parameter 2 of myFunction(int, double, const SBMStructuralModelNodeAtom*) is const SBMStructuralModelNodeAtom*.

Note that this function returns a type. If a string is needed, use SBCMetaValue::getParameterTypeName().

See also: SBCMetaValue::getParameterTypeName()

Parameters:

  • i Index of the parameter whose type is requested.

Returns:

The type of the requested parameter as an SBCMetaValue.


function getParameterTypeName#

Returns the type name of parameter i .

std::string SBCMetaValue::getParameterTypeName (
    unsigned int i
) const

Returns the type name of the i-th parameter of the held function type.

This function returns the type name of parameter i of type T, when T is a function ("void" otherwise). For example, the type name of parameter 2 of myFunction(int, double, const SBMStructuralModelNodeAtom*) is "const SBMStructuralModelNodeAtom*".

Note that this function returns a string. If type is needed, use SBCMetaValue::getParameterType().

See also: SBCMetaValue::getParameterType()

Parameters:

  • i The zero-based index of the parameter.

Returns:

The parameter type name as a string, or an empty string if not applicable.


function getParentType#

Returns the parent type.

SBCMetaValue SBCMetaValue::getParentType () const

Returns the parent type of this type.

This function returns the parent type, i.e. an instance of the template class SBCMetaValueType which contains type information about the parent type of this type. For example, the parent type of int* is int.

Note that this function returns a type. If a string is needed, use SBCMetaValue::getParentTypeName().

See also: SBCMetaValue::getParentTypeName()

Returns:

The parent type as an SBCMetaValue.


function getParentTypeName#

Returns the parent type name.

std::string SBCMetaValue::getParentTypeName () const

Returns the type name of the parent type of T.

This function returns the type name of the parent type of T. For example, the parent type name of int* is "int".

Note that this function returns a string. If a type is needed, use SBCMetaValue::getParentType().

See also: SBCMetaValue::getParentType(), SBCMetaValue::getRootTypeName()

Returns:

The parent type name as a string, or an empty string if the value is invalid.


function getProxy#

Returns the proxy of the value.

virtual SBCClassProxy * SBCMetaValue::getProxy () const

Returns the proxy object associated with the value, if any.

This function returns the proxy of the underlying value. If the value does not have an associated proxy, nullptr is returned.

Returns:

Pointer to the SBCClassProxy associated with the value, or nullptr if none.


function getRootType#

Returns the root type.

SBCMetaValue SBCMetaValue::getRootType () const

Returns the root type of this type.

This function returns the root type, i.e. an instance of the template class SBCMetaValueType which contains type information about the root type of this type. For example, the root type of const std::string& is std::string.

Note that this function returns a type. If a string is needed, use SBCMetaValue::getRootTypeName().

See also: SBCMetaValue::getRootTypeName()

Returns:

The root type as an SBCMetaValue.


function getRootTypeName#

Returns the root type name.

std::string SBCMetaValue::getRootTypeName () const

Returns the type name of the root type of T.

This function returns the type name of the root type of T. For example, the root type name of const std::string& is "std::string".

Note that this function returns a string. If a type is needed, use SBCMetaValue::getRootType().

See also: SBCMetaValue::getRootType(), SBCMetaValue::getParentTypeName()

Returns:

The root type name as a string, or an empty string if the value is invalid.


function getShortBaseTypeName#

Returns the short base type name.

std::string SBCMetaValue::getShortBaseTypeName () const

Returns the short type name of the base type of T.

This function returns the short type name of the base type of T. For example, the short base type name of SBMStructuralModelNodeAtom is "SBNode".

Note that this function returns a string. If a type is needed, use SBCMetaValue::getBaseType().

See also: SBCMetaValue::getBaseType()

Returns:

The short base type name as a std::string.


function getShortClassTypeName#

Returns the short class type name.

std::string SBCMetaValue::getShortClassTypeName () const

Returns the short type name of the class associated to T when it is a pointer to a member or a pointer to a member function ("void" otherwise).

For example, the short class type name of & SBMStructuralModelNodeAtom::clearName is "SBAtom*".

Note that this function returns a string. If a type is needed, use SBCMetaValue::getClassType().

See also: SBCMetaValue::getClassType()

Returns:

The short class type name as a std::string.


function getShortOutputTypeName#

Returns the short output type name.

std::string SBCMetaValue::getShortOutputTypeName () const

Returns the short type name of the output type of T when it is a function.

This function returns the short type name of the output type of T, when T is a function. For example, the short output type name of SBMStructuralModelNodeAtom* getFirstAtom() is "SBAtom".

Note that this function returns a string. If a type is needed, use SBCMetaValue::getOutputType().

See also: SBCMetaValue::getOutputType()

Returns:

The short output type name as a std::string.


function getShortParameterTypeName#

Returns the short type name of parameter i .

std::string SBCMetaValue::getShortParameterTypeName (
    unsigned int i
) const

Returns the short type name of parameter i of type T when it is a function ("void" otherwise).

For example, the short type name of parameter 2 of myFunction(int, double, const SBMStructuralModelNodeAtom*) is "const SBAtom*".

Note that this function returns a string. If a type is needed, use SBCMetaValue::getParameterType().

See also: SBCMetaValue::getParameterType()

Parameters:

  • i Index of the parameter whose type name is requested.

Returns:

The short type name of the requested parameter as a std::string.


function getShortParentTypeName#

Returns the short parent type name.

std::string SBCMetaValue::getShortParentTypeName () const

Returns the short type name of the parent type of T.

This function returns the short type name of the parent type of T. For example, the short parent type name of SBMStructuralModelNodeAtom* is "SBAtom".

Note that this function returns a string. If a type is needed, use SBCMetaValue::getParentType().

See also: SBCMetaValue::getParentType(), SBCMetaValue::getShortRootTypeName()

Returns:

The short parent type name as a string, or an empty string if the value is invalid.


function getShortRootTypeName#

Returns the short root type name.

std::string SBCMetaValue::getShortRootTypeName () const

Returns the short type name of the root type of T.

This function returns the type name of the root type of T. For example, the short root type name of const SBMStructuralModelNodeAtom & is "SBAtom".

Note that this function returns a string. If a type is needed, use SBCMetaValue::getRootType().

See also: SBCMetaValue::getRootType(), SBCMetaValue::getShortParentTypeName()

Returns:

The short root type name as a string, or an empty string if the value is invalid.


function getShortTypeName#

Returns the short type name.

std::string SBCMetaValue::getShortTypeName () const

Returns the short type name of the held value.

When the type T is fundamental, this function returns a string containing the fundamental type (e.g. "unsigned int"). When T is registered (via SB_REGISTER_TYPE), this function returns its short type name. Else, this function recursively decomposes the type in order to provide a string describing it, but using short names (e.g. "const SBAtom*").

Returns:

The short type name as a string, or an empty string if the value is invalid.


function getSize#

Returns the size of attribute attributeName in the value when relevant.

virtual unsigned int SBCMetaValue::getSize (
    const std::string & attributeName
) const

Retrieves the size of the specified attribute in the value.

This function returns the size of attribute attributeName in the value when relevant.

Parameters:

  • attributeName Name of the attribute whose size is requested.

Returns:

The size of the attribute as an unsigned int. Returns 0 if the attribute does not have a size or does not exist.


function getTypeName#

Returns the type name.

std::string SBCMetaValue::getTypeName () const

Returns the full type name of the held value.

When the type T is fundamental, this function returns a string containing the fundamental type (e.g. "unsigned int"). When T is registered (via SB_REGISTER_TYPE), this function returns its type name. Else, this function recursively decomposes the type in order to provide a string describing it (e.g. "const SBMStructuralModelNodeAtom*").

Returns:

The type name as a string, or an empty string if the value is invalid.


function getTypeUUID#

Returns the type UUID .

SBCContainerUUID SBCMetaValue::getTypeUUID () const

Returns the UUID associated with the type if it is registered.

If the type is registered (via SB_REGISTER_TYPE), this function returns the associated UUID. Else, the function returns an invalid UUID.

Returns:

The type UUID if registered, otherwise an invalid UUID.


function getValue#

Returns the value.

SBCMetaValueBase * SBCMetaValue::getValue () noexcept const

Returns the pointer to the held value base.

This function returns the pointer to the held value base.

Returns:

Pointer to the value base, or nullptr if no value is held.


function has#

Returns whether attribute attributeName exists in the value and has a value.

virtual bool SBCMetaValue::has (
    const std::string & attributeName
) const

Checks whether the specified attribute exists and has a value.

This function returns whether attribute attributeName exists in the value and has a value.

Parameters:

  • attributeName Name of the attribute to check.

Returns:

true if the attribute exists and has a value; otherwise false.

Checks if the value has the specified attribute.


function hasBaseType#

Returns true if the value is of a type that has a base type.

bool SBCMetaValue::hasBaseType () const

Checks whether the held value's type has a base type.

Returns:

true if the value exists and its type has a base type; otherwise false.


function isArrayType#

Returns true if the value is of an array type.

bool SBCMetaValue::isArrayType () const

Checks whether the held value is an array type.

Returns:

true if the value exists and its type is an array; otherwise false.


function isClassType#

Returns true if the value is of a class type.

bool SBCMetaValue::isClassType () const

Checks whether the held value is of a class type.

Returns:

true if the value exists and its type is a class; otherwise false.


function isConstType#

Returns true if the value is of a const type.

bool SBCMetaValue::isConstType () const

Checks whether the held value is a const-qualified type.

Returns:

true if the value exists and its type is const-qualified; otherwise false.


function isEnumType#

Returns true if the value is of an enum type.

bool SBCMetaValue::isEnumType () const

Checks whether the held value is of an enumeration type.

Returns:

true if the value exists and its type is an enumeration; otherwise false.


function isFunctionType#

Returns true if the value is of a function type.

bool SBCMetaValue::isFunctionType () const

Checks whether the held value is a function type.

Returns:

true if the value exists and its type is a function; otherwise false.


function isFundamentalType#

Returns true if the value is of a fundamental type.

bool SBCMetaValue::isFundamentalType () const

Checks whether the held value is of a fundamental type.

Returns true if the value is of a fundamental type (void, bool, char, signed char, unsigned char, wchar_t, short, unsigned short, int, unsigned int, long, unsigned long, float, double or long double).

Returns:

true if the value exists and its type is a fundamental type; otherwise false.


function isPointerToFunctionType#

Returns true if the value is of a pointer to function type.

bool SBCMetaValue::isPointerToFunctionType () const

Checks whether the held value is a pointer-to-function type.

Returns:

true if the value exists and its type is a pointer to function; otherwise false.


function isPointerToMemberFunctionType#

Returns true if the value is of a pointer to member function type.

bool SBCMetaValue::isPointerToMemberFunctionType () const

Checks whether the held value is a pointer-to-member-function type.

Returns:

true if the value exists and its type is a pointer to member function; otherwise false.


function isPointerToMemberType#

Returns true if the value is of a pointer to member type.

bool SBCMetaValue::isPointerToMemberType () const

Checks whether the held value is a pointer-to-member type.

Returns:

true if the value exists and its type is a pointer to member; otherwise false.


function isPointerType#

Returns true if the value is of a pointer type.

bool SBCMetaValue::isPointerType () const

Checks whether the held value is a pointer type.

Returns:

true if the value exists and its type is a pointer; otherwise false.


function isReferenceType#

Returns true if the value is of a reference type.

bool SBCMetaValue::isReferenceType () const

Checks whether the held value is a reference type.

Returns:

true if the value exists and its type is a reference; otherwise false.


function isRegisteredType#

Returns true if the value is of a registered type.

bool SBCMetaValue::isRegisteredType () const

Checks whether the held value is of a registered type.

Registered types are those that have been declared with the SAMSON registration mechanism.

Returns:

true if the value exists and its type is registered; otherwise false.


function isValid#

Returns whether the value is valid and can be dereferenced with getValue .

bool SBCMetaValue::isValid () noexcept const

Checks whether the value is valid and can be dereferenced with getValue.

This function returns whether the value is valid and can be dereferenced with getValue.

Returns:

true if the value is valid, false otherwise.


function isVolatileType#

Returns true if the value is of a volatile type.

bool SBCMetaValue::isVolatileType () const

Checks whether the held value is a volatile-qualified type.

Returns:

true if the value exists and its type is volatile-qualified; otherwise false.


function operator U#

template<typename U>
inline SBCMetaValue::operator U () const

function operator=#

Assignment operator.

SBCMetaValue & SBCMetaValue::operator= (
    const SBCMetaValue & value
) 

Assigns the content of another SBCMetaValue to this instance.

If the current instance holds a value, it is deleted before copying the value from the source. The source value is cloned if it is valid; otherwise this instance becomes empty.

Parameters:

Returns:

Reference to this SBCMetaValue after assignment.


function set#

Sets the value of attribute attributeName for this value tovalue .

virtual void SBCMetaValue::set (
    const std::string & attributeName,
    const SBCMetaValue & value,
    const SBCMetaValue & size=0
) const

Sets the value of the specified attribute.

This function sets the value of attribute attributeName for this value to value, optionally specifying a size.

Parameters:

  • attributeName Name of the attribute to set.
  • value The new value to assign to the attribute.
  • size Optional size parameter for the attribute (default is an empty SBCMetaValue).

function ~SBCMetaValue#

Destructs the value.

SBCMetaValue::~SBCMetaValue () 

Destroys the SBCMetaValue and releases any held value.

If the instance holds a value, the value is deleted. The internal pointer is set to nullptr.


Public Static Functions Documentation#

function buildType#

template<typename U>
static inline SBCMetaValue SBCMetaValue::buildType () 

function buildValue [1/2]#

static inline SBCMetaValue SBCMetaValue::buildValue () 

function buildValue [2/2]#

template<typename U>
static inline SBCMetaValue SBCMetaValue::buildValue (
    U u
) 

function canCastFrom#

template<typename U>
static inline bool SBCMetaValue::canCastFrom (
    const SBCMetaValue & fromValue
) 

function castFrom#

template<typename U>
static inline U SBCMetaValue::castFrom (
    const SBCMetaValue & fromValue
)