This template class describes a value holder. More...
Constructors and destructors | |
| SBCMetaValueHolder (const T &v) | |
Constructs a value holder that holds value v. | |
| virtual | ~SBCMetaValueHolder () |
| Destructs the value holder. | |
Value | |
| T | getValue () const |
| Returns the hold value. | |
| T & | getReference () |
| Returns a reference to the hold value. | |
| T const & | getConstReference () const |
| Returns a const reference to the hold value. | |
| static T const & | getValue (SBCMetaValueBase *container) |
Returns the value held in the container. | |
Cloning | |
| virtual SBCMetaValueBase * | clone () const |
| Clones the value. | |
Value attribute | |
| T | value |
| The hold value. | |
Additional Inherited Members | |
Public Member Functions inherited from SBCMetaValueType< T > | |
| SBCMetaValueType () | |
| Constructs a type. | |
| virtual | ~SBCMetaValueType () |
| Destructs the type. | |
| virtual bool | isEnumType () const |
| Returns true if the value is of an enum type. | |
| virtual bool | isClassType () const |
| Returns true if the value is of a class type. | |
| virtual bool | isFundamentalType () const |
| Returns true if the value is of a fundamental type. More... | |
| virtual bool | isRegisteredType () const |
| Returns true if the value is of a registered type. | |
| virtual bool | isConstType () const |
| Returns true if the value is of a const type. | |
| virtual bool | isVolatileType () const |
| Returns true if the value is of a volatile type. | |
| virtual bool | isReferenceType () const |
| Returns true if the value is of a reference type. | |
| virtual bool | isArrayType () const |
| Returns true if the value is of an array type. | |
| virtual bool | isPointerType () const |
| Returns true if the value is of a pointer type. | |
| virtual bool | isPointerToMemberType () const |
| Returns true if the value is of a pointer to member type. | |
| virtual bool | isFunctionType () const |
| Returns true if the value is of a function type. | |
| virtual bool | isPointerToFunctionType () const |
| Returns true if the value is of a pointer to function type. | |
| virtual bool | isPointerToMemberFunctionType () const |
| Returns true if the value is of a pointer to member function type. | |
| virtual bool | hasBaseType () const |
| Returns true if the value is of a type that has a base type. | |
| virtual unsigned int | getNumberOfParameters () const |
| Returns the number of parameters of a function type. | |
| virtual std::string | getTypeName () const |
| Returns the type name. More... | |
| virtual std::string | getParentTypeName () const |
| Returns the parent type name. More... | |
| virtual std::string | getRootTypeName () const |
| Returns the root type name. More... | |
| virtual std::string | getBaseTypeName () const |
| Returns the base type name. More... | |
| virtual std::string | getOutputTypeName () const |
| Returns the output type name. More... | |
| virtual std::string | getClassTypeName () const |
| Returns the class type name. More... | |
| virtual std::string | getParameterTypeName (unsigned int i) const |
Returns the type name of parameter i. More... | |
| virtual std::string | getShortTypeName () const |
| Returns the short type name. More... | |
| virtual std::string | getShortParentTypeName () const |
| Returns the short parent type name. More... | |
| virtual std::string | getShortRootTypeName () const |
| Returns the short root type name. More... | |
| virtual std::string | getShortBaseTypeName () const |
| Returns the short base type name. More... | |
| virtual std::string | getShortOutputTypeName () const |
| Returns the short output type name. More... | |
| virtual std::string | getShortClassTypeName () const |
| Returns the short class type name. More... | |
| virtual std::string | getShortParameterTypeName (unsigned int i) const |
Returns the short type name of parameter i. More... | |
| virtual SBCMetaValueBase * | getParentType () const |
| Returns the parent type. More... | |
| virtual SBCMetaValueBase * | getRootType () const |
| Returns the root type. More... | |
| virtual SBCMetaValueBase * | getBaseType () const |
| Returns the base type. More... | |
| virtual SBCMetaValueBase * | getOutputType () const |
| Returns the output type. More... | |
| virtual SBCMetaValueBase * | getClassType () const |
| Returns the class type. More... | |
| virtual SBCMetaValueBase * | getParameterType (unsigned int i) const |
Returns the type of parameter i. More... | |
| virtual SBCContainerUUID | getTypeUUID () const |
| Returns the type UUID. | |
Public Member Functions inherited from SBCMetaValueBase | |
| virtual | ~SBCMetaValueBase () |
| Destructs the value. | |
| virtual SBCClassProxy * | getProxy () const |
| Returns the proxy of the value. | |
| virtual SBCMetaValueBase * | call (const SBCMetaValue &object, const std::string &functionName, const SBCMetaValue &t0, const SBCMetaValue &t1, const SBCMetaValue &t2, const SBCMetaValue &t3, const SBCMetaValue &t4, const SBCMetaValue &t5, const SBCMetaValue &t6, const SBCMetaValue &t7, const SBCMetaValue &t8, const SBCMetaValue &t9, const SBCMetaValue &t10, const SBCMetaValue &t11, const SBCMetaValue &t12, const SBCMetaValue &t13, const SBCMetaValue &t14, const SBCMetaValue &t15) const |
Calls the function functionName of the value with arguments t0, t1, ..., t15. | |
| virtual SBCMetaValueBase * | constCall (const SBCMetaValue &object, const std::string &functionName, const SBCMetaValue &t0, const SBCMetaValue &t1, const SBCMetaValue &t2, const SBCMetaValue &t3, const SBCMetaValue &t4, const SBCMetaValue &t5, const SBCMetaValue &t6, const SBCMetaValue &t7, const SBCMetaValue &t8, const SBCMetaValue &t9, const SBCMetaValue &t10, const SBCMetaValue &t11, const SBCMetaValue &t12, const SBCMetaValue &t13, const SBCMetaValue &t14, const SBCMetaValue &t15) const |
Calls the const function functionName of the value with arguments t0, t1, ..., t15. | |
| virtual SBCMetaValueBase * | get (const SBCMetaValue &object, const std::string &attributeName) const |
Returns the value of attribute attributeName for this value. | |
| virtual void | set (const SBCMetaValue &object, const std::string &attributeName, const SBCMetaValue &value, const SBCMetaValue &size) const |
Sets the value of attribute attributeName for this value to value. | |
| virtual bool | has (const SBCMetaValue &object, const std::string &attributeName) const |
Returns whether attribute attributeName exists in the value and has a value. | |
| virtual void | clear (const SBCMetaValue &object, const std::string &attributeName) const |
Clears attribute attributeName from the value when possible. | |
| virtual unsigned int | getSize (const SBCMetaValue &object, const std::string &attributeName) const |
Returns the size of attribute attributeName in the value when relevant. | |
Protected Member Functions inherited from SBCMetaValueBase | |
| SBCMetaValueBase () | |
| Constructs a value. | |
| T | The type described |
This template class holds a value. It derives from the template class SBCMetaValueType, used to hold type information, which derives from SBCMetaValue, the base class of value holders.
Assume a SAMSON Extension called SEElement defines a class A, and another SAMSON Extension called SEOtherElement wants to use it. If the SAMSON 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:
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 SAMSON Extension SEElement returns a value holder that stores a pointer to the new instance of class A:
and the SAMSON Extension SEOtherElement sees this value holder as a pointer to a SBValue (the base class of SBValueHolder<A*>):
Unlike the template class SBCMetaValueType, which only holds information about the type T of the value, the template class SBCMetaValueHolder does hold the value:
Short name: SBValue