# 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.
std::vector<const char*> getRegisteredClassNames Get registered class names.
[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::getRegisteredClassNames

Get registered class names.

  • @return

static std::vector<const char*> getRegisteredClassNames()

# 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.

# Methods

Return Type Name Summary
const Type* getValueType Get value type

# ObjectWrapper::ObjectType

Static object type

typedef T ObjectType

# ObjectWrapper::Class

Static object class information.

typedef Clazz Class

# ObjectWrapper::getValueType

Get value type

  • @return

const Type* getValueType() const

# 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.
const std::vector<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.
const Type* const parent Parent type.
Ex.: DTO super-class type.
Note: setting parent type also means that child object can be statically casted to parent type without any violations.
const bool isCollection polymorphicDispatcher extends oatpp::data::mapping::type::__class::Collection::PolymorphicDispatcher.
const bool isMap polymorphicDispatcher extends oatpp::data::mapping::type::__class::Map::PolymorphicDispatcher.

# Methods

Return Type Name Summary
[none] Type Constructor.
const AbstractInterpretation* findInterpretation Find type interpretation.
bool extends Check if type extends other type.

# 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.

const std::vector<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::parent

Parent type.
Ex.: DTO super-class type.
Note: setting parent type also means that child object can be statically casted to parent type without any violations.

const Type* const parent

# Type::isCollection

polymorphicDispatcher extends oatpp::data::mapping::type::__class::Collection::PolymorphicDispatcher.

const bool isCollection

# Type::isMap

polymorphicDispatcher extends oatpp::data::mapping::type::__class::Map::PolymorphicDispatcher.

const bool isMap

# Type::Type

Constructor.

  • @param pClassId - type class id.
  • @param typeInfo - type creation info. Type::Info.

Type(const ClassId& pClassId, const Info& typeInfo = Info())

# 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::extends

Check if type extends other type.

  • @param other
  • @return

bool extends(const Type* other) const

# Type::Info

Type info.

namespace oatpp { namespace data { namespace mapping { namespace type { 
  class Type {
    struct Info {}
  };
}}}}

# Fields

Type Name Summary
const char* nameQualifier Type name qualifier.
std::vector<const Type*> params List of type parameters - for templated types.
void* polymorphicDispatcher PolymorphicDispatcher is responsible for forwarding polymorphic calls to a correct object of type Type.
InterpretationMap interpretationMap Map of type Interpretations.
const Type* parent Parent type.
Ex.: DTO super-class type.
Note: setting parent type also means that child object can be statically casted to parent type without any violations.
bool isCollection polymorphicDispatcher extends oatpp::data::mapping::type::__class::Collection::PolymorphicDispatcher.
bool isMap polymorphicDispatcher extends oatpp::data::mapping::type::__class::Map::PolymorphicDispatcher.

# Methods

Return Type Name Summary
[none] Info Default constructor.

# Type::Info::nameQualifier

Type name qualifier.

const char* nameQualifier = nullptr

# Type::Info::params

List of type parameters - for templated types.

std::vector<const Type*> params

# Type::Info::polymorphicDispatcher

PolymorphicDispatcher is responsible for forwarding polymorphic calls to a correct object of type Type.

void* polymorphicDispatcher = nullptr

# Type::Info::interpretationMap

Map of type Interpretations.

InterpretationMap interpretationMap

# Type::Info::parent

Parent type.
Ex.: DTO super-class type.
Note: setting parent type also means that child object can be statically casted to parent type without any violations.

const Type* parent = nullptr

# Type::Info::isCollection

polymorphicDispatcher extends oatpp::data::mapping::type::__class::Collection::PolymorphicDispatcher.

bool isCollection = false

# Type::Info::isMap

polymorphicDispatcher extends oatpp::data::mapping::type::__class::Map::PolymorphicDispatcher.

bool isMap = false

# Type::Info::Info

Default constructor.

Info()

# 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