# Type.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/core/data/mapping/type/Type.hpp"

# ClassId

Structure representing ID of the type class.

namespace oatpp { namespace data { namespace mapping { namespace type { 
  class ClassId {}
}}}}

# Fields

Type Name Summary
const char* const name Name of the type class.
const v_int32 id Integer ID of the type class.
Note: class type IDs are integer values incremented continuously from [0 to getClassCount()]

# Methods

Return Type Name Summary
int getClassCount Get count of all type classes created.
[none] ClassId Constructor.

# ClassId::name

Name of the type class.

const char* const name

# ClassId::id

Integer ID of the type class.
Note: class type IDs are integer values incremented continuously from [0 to getClassCount()]

const v_int32 id

# ClassId::getClassCount

Get count of all type classes created.

  • @return

static int getClassCount()

# ClassId::ClassId

Constructor.

  • @param pName

ClassId(const char* pName)

# Void

Void Object Class.

namespace oatpp { namespace data { namespace mapping { namespace type { namespace __class { 
  class Void {}
}}}}}

# Fields

Type Name Summary
const ClassId CLASS_ID Class id.

# Methods

Return Type Name Summary
Type* getType Get class type information.

# Void::CLASS_ID

Class id.

static const ClassId CLASS_ID

# Void::getType

Get class type information.

static Type* getType()

# ObjectWrapper

ObjectWrapper holds std::shared_ptr to object, object static type, plus object dynamic type information.

  • @tparam T - Object Type.
  • @tparam Clazz - Static type info.

namespace oatpp { namespace data { namespace mapping { namespace type { 
  template <class T, class Clazz = __class::Void>
  class ObjectWrapper {}
}}}}

# Typedefs

Type Name Summary
T ObjectType Static object type
Clazz Class Static object class information.

# Fields

Type Name Summary
const Type* const valueType Value type information. See Type.

# ObjectWrapper::ObjectType

Static object type

typedef T ObjectType

# ObjectWrapper::Class

Static object class information.

typedef Clazz Class

# ObjectWrapper::valueType

Value type information. See Type.

const Type* const valueType

# Type

Object type data.

namespace oatpp { namespace data { namespace mapping { namespace type { 
  class Type {}
}}}}

# Fields

Type Name Summary
const ClassId classId type class id.
const char* const nameQualifier Type name qualifier.
std::list<const Type*> params List of type parameters - for templated types.
const void* const polymorphicDispatcher PolymorphicDispatcher - is an object to forward polymorphic calls to a correct object of type Type.
const InterpretationMap interpretationMap Map of type Interpretations.

# Methods

Return Type Name Summary
[none] Type Constructor.
const AbstractInterpretation* findInterpretation Find type interpretation.

# Type::classId

type class id.

const ClassId classId

# Type::nameQualifier

Type name qualifier.

const char* const nameQualifier

# Type::params

List of type parameters - for templated types.

std::list<const Type*> params

# Type::polymorphicDispatcher

PolymorphicDispatcher - is an object to forward polymorphic calls to a correct object of type Type.

const void* const polymorphicDispatcher

# Type::interpretationMap

Map of type Interpretations.

const InterpretationMap interpretationMap

# Type::Type

Constructor.

  • @param pClassId - type class id.
  • @param pNameQualifier - type name qualifier.
  • @param pPolymorphicDispatcher - is an object to forward polymorphic calls to a correct object of type Type.
  • @param pInterpretationMap - Map of type Interpretations.

Type(const ClassId& pClassId,
     const char* pNameQualifier,
     void* pPolymorphicDispatcher = nullptr,
     InterpretationMap&& pInterpretationMap =

# Type::findInterpretation

Find type interpretation.

  • @param names - list of possible interpretation names.
  • @return - Type::AbstractInterpretation. Returns the first interpretation found from the list or NULL if no interpretations found.

const AbstractInterpretation* findInterpretation(const std::vector<std::string>& names) const

# Type::AbstractInterpretation

Type Abstract Interpretation.

namespace oatpp { namespace data { namespace mapping { namespace type { 
  class Type {
    class AbstractInterpretation {}
  };
}}}}

# Methods

Return Type Name Summary
Void toInterpretation Convert the object to its interpretation.
Void fromInterpretation Convert interpretation back to the original object.
const Type* getInterpretationType Type of the interpretation.

# Type::AbstractInterpretation::toInterpretation

Convert the object to its interpretation.

  • @param originalValue
  • @return

virtual Void toInterpretation(const Void& originalValue) const = 0

# Type::AbstractInterpretation::fromInterpretation

Convert interpretation back to the original object.

  • @param interValue
  • @return

virtual Void fromInterpretation(const Void& interValue) const = 0

# Type::AbstractInterpretation::getInterpretationType

Type of the interpretation.

  • @return

virtual const Type* getInterpretationType() const = 0