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 Name of the class - CLASS_NAME = "Void".

Methods

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

Void::CLASS_ID

Name of the class - CLASS_NAME = "Void".

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<Type*> params List of type parameters - for templated types.
const Creator creator Creator - function to create instance of this type.
const PropertiesGetter propertiesGetter PropertiesGetter - function to get properties of the type.
const void* const polymorphicDispatcher PolymorphicDispatcher - is an object to forward polymorphic calls to a correct object of type Type.

Methods

Return Type Name Summary
[none] Type Constructor.

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<Type*> params

Type::creator

Creator - function to create instance of this type.

const Creator creator

Type::propertiesGetter

PropertiesGetter - function to get properties of the type.

const PropertiesGetter propertiesGetter

Type::polymorphicDispatcher

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

const void* const polymorphicDispatcher

Type::Type

Constructor.

  • @param pClassId - type class id.
  • @param pNameQualifier - type name qualifier.
  • @param pCreator - function pointer of Creator - function to create instance of this type.
  • @param pPropertiesGetter - function to get properties of the type.
  • @param pPolymorphicDispatcher - dispatcher to correctly address methods of the type.

Type(const ClassId& pClassId,
     const char* pNameQualifier,
     Creator pCreator = nullptr,
     PropertiesGetter pPropertiesGetter = nullptr,
     void* pPolymorphicDispatcher = nullptr)

Type::Properties

Object type properties table.

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

Methods

Return Type Name Summary
Property* pushBack Add property to the end of the list.
void pushFrontAll Add all properties to the beginning of the list.
const std::unordered_map<std::string, Property*>& getMap Get properties as unordered map for random access.
const std::list<Property*>& getList Get properties in ordered way.

Type::Properties::pushBack

Add property to the end of the list.

  • @param property

Property* pushBack(Property* property)

Type::Properties::pushFrontAll

Add all properties to the beginning of the list.

  • @param properties

void pushFrontAll(Properties* properties)

Type::Properties::getMap

Get properties as unordered map for random access.

const std::unordered_map<std::string, Property*>& getMap() const

Type::Properties::getList

Get properties in ordered way.

const std::list<Property*>& getList() const

Type::Property

Class to map object properties.

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

Fields

Type Name Summary
const char* const name Property name.
const Type* const type Property type.
Info info Property additional info.

Methods

Return Type Name Summary
[none] Property Constructor.
void set Set value of object field mapped by this property.
Void get Get value of object field mapped by this property.
Void& getAsRef Get reference to ObjectWrapper of the object field.

Type::Property::name

Property name.

const char* const name

Type::Property::type

Property type.

const Type* const type

Type::Property::info

Property additional info.

Info info

Type::Property::Property

Constructor.

  • @param pOffset - memory offset of object field from object start address.
  • @param pName - name of the property.
  • @param pType - Type of the property.

Property(v_int64 pOffset, const char* pName, Type* pType)

Type::Property::set

Set value of object field mapped by this property.

  • @param object - object address.
  • @param value - value to set.

void set(void* object, const Void& value)

Type::Property::get

Get value of object field mapped by this property.

  • @param object - object address.
  • @return - value of the field.

Void get(void* object)

Type::Property::getAsRef

Get reference to ObjectWrapper of the object field.

  • @param object - object address.
  • @return - reference to ObjectWrapper of the object field.

Void& getAsRef(void* object)

Type::Property::Info

Editional Info about Property.

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

Fields

Type Name Summary
std::string description Description.

Type::Property::Info::description

Description.

std::string description = ""