mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2025-01-05 17:42:23 +08:00
ApiDocs. Document mapping::type::<Collections>.
This commit is contained in:
parent
b32b905723
commit
aa9d53ca5b
@ -36,8 +36,15 @@ namespace oatpp { namespace data { namespace mapping { namespace type {
|
||||
|
||||
namespace __class {
|
||||
|
||||
/**
|
||||
* Any class.
|
||||
*/
|
||||
class Any {
|
||||
public:
|
||||
|
||||
/**
|
||||
* Class Id.
|
||||
*/
|
||||
static const ClassId CLASS_ID;
|
||||
|
||||
static Type *getType() {
|
||||
|
@ -34,13 +34,27 @@ namespace oatpp { namespace data { namespace mapping { namespace type {
|
||||
|
||||
namespace __class {
|
||||
|
||||
/**
|
||||
* Abstract list class.
|
||||
*/
|
||||
class AbstractList {
|
||||
public:
|
||||
/**
|
||||
* Class Id.
|
||||
*/
|
||||
static const ClassId CLASS_ID;
|
||||
public:
|
||||
|
||||
/**
|
||||
* Polymorphic Dispatcher
|
||||
*/
|
||||
class AbstractPolymorphicDispatcher {
|
||||
public:
|
||||
/**
|
||||
* Add item.
|
||||
* @param object - List to add item to.
|
||||
* @param item - Item to add.
|
||||
*/
|
||||
virtual void addPolymorphicItem(const type::Void& object, const type::Void& item) const = 0;
|
||||
};
|
||||
|
||||
@ -51,6 +65,11 @@ namespace __class {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* `ObjectWrapper` over `std::list<T>`
|
||||
* @tparam T - Item `ObjectWrapper` type.
|
||||
* @tparam C - Class.
|
||||
*/
|
||||
template<class T, class C>
|
||||
class ListObjectWrapper : public type::ObjectWrapper<std::list<T>, C> {
|
||||
public:
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
typedef __class::Object<ObjT> TemplateObjectClass;
|
||||
public:
|
||||
|
||||
OATPP_DEFINE_OBJECT_WRAPPER_DEFAULTS(DTOWrapper, TemplateObjectType, TemplateObjectClass)
|
||||
OATPP_DEFINE_OBJECT_WRAPPER_DEFAULTS(DTOWrapper, TemplateObjectType, TemplateObjectClass)
|
||||
|
||||
static DTOWrapper createShared() {
|
||||
return std::make_shared<TemplateObjectType>();
|
||||
|
@ -35,23 +35,44 @@ namespace oatpp { namespace data { namespace mapping { namespace type {
|
||||
|
||||
namespace __class {
|
||||
|
||||
class AbstractPairList {
|
||||
public:
|
||||
static const ClassId CLASS_ID;
|
||||
public:
|
||||
|
||||
class AbstractPolymorphicDispatcher {
|
||||
/**
|
||||
* Abstract PairList class.
|
||||
*/
|
||||
class AbstractPairList {
|
||||
public:
|
||||
virtual void addPolymorphicItem(const type::Void& object, const type::Void& key, const type::Void& value) const = 0;
|
||||
/**
|
||||
* Class id.
|
||||
*/
|
||||
static const ClassId CLASS_ID;
|
||||
public:
|
||||
|
||||
/**
|
||||
* Polymorphic Dispatcher.
|
||||
*/
|
||||
class AbstractPolymorphicDispatcher {
|
||||
public:
|
||||
/**
|
||||
* Add key-value pair to pair-list.
|
||||
* @param object - pair list.
|
||||
* @param key - key.
|
||||
* @param value - value.
|
||||
*/
|
||||
virtual void addPolymorphicItem(const type::Void& object, const type::Void& key, const type::Void& value) const = 0;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
template<class Key, class Value>
|
||||
class PairList;
|
||||
template<class Key, class Value>
|
||||
class PairList;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* `ObjectWrapper` over `std::list<std::pair<Key, Value>>`
|
||||
* @tparam Key - Key `ObjectWrapper` type.
|
||||
* @tparam Value - Value `ObjectWrapper` type.
|
||||
* @tparam C - Class.
|
||||
*/
|
||||
template<class Key, class Value, class C>
|
||||
class PairListObjectWrapper : public type::ObjectWrapper<std::list<std::pair<Key, Value>>, C> {
|
||||
public:
|
||||
@ -59,7 +80,7 @@ public:
|
||||
typedef C TemplateObjectClass;
|
||||
public:
|
||||
|
||||
OATPP_DEFINE_OBJECT_WRAPPER_DEFAULTS(PairListObjectWrapper, TemplateObjectType, TemplateObjectClass)
|
||||
OATPP_DEFINE_OBJECT_WRAPPER_DEFAULTS(PairListObjectWrapper, TemplateObjectType, TemplateObjectClass)
|
||||
|
||||
PairListObjectWrapper(std::initializer_list<std::pair<Key, Value>> ilist)
|
||||
: type::ObjectWrapper<TemplateObjectType, TemplateObjectClass>(std::make_shared<TemplateObjectType>(ilist))
|
||||
|
@ -35,13 +35,28 @@ namespace oatpp { namespace data { namespace mapping { namespace type {
|
||||
|
||||
namespace __class {
|
||||
|
||||
/**
|
||||
* Abstract Unordered Map class.
|
||||
*/
|
||||
class AbstractUnorderedMap {
|
||||
public:
|
||||
/**
|
||||
* Class Id.
|
||||
*/
|
||||
static const ClassId CLASS_ID;
|
||||
public:
|
||||
|
||||
/**
|
||||
* Polymorphic Dispatcher.
|
||||
*/
|
||||
class AbstractPolymorphicDispatcher {
|
||||
public:
|
||||
/**
|
||||
* Add item.
|
||||
* @param object - Unordered Map.
|
||||
* @param key - Key.
|
||||
* @param value - Value.
|
||||
*/
|
||||
virtual void addPolymorphicItem(const type::Void& object, const type::Void& key, const type::Void& value) const = 0;
|
||||
};
|
||||
|
||||
@ -52,6 +67,12 @@ namespace __class {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* `ObjectWrapper` for `std::unordered_map<Key, Value>`
|
||||
* @tparam Key - Key `ObjectWrapper` type.
|
||||
* @tparam Value - Value `ObjectWrapper` type.
|
||||
* @tparam C - Class.
|
||||
*/
|
||||
template<class Key, class Value, class C>
|
||||
class UnorderedMapObjectWrapper : public type::ObjectWrapper<std::unordered_map<Key, Value>, C> {
|
||||
public:
|
||||
|
@ -34,23 +34,42 @@ namespace oatpp { namespace data { namespace mapping { namespace type {
|
||||
|
||||
namespace __class {
|
||||
|
||||
class AbstractUnorderedSet {
|
||||
public:
|
||||
static const ClassId CLASS_ID;
|
||||
public:
|
||||
|
||||
class AbstractPolymorphicDispatcher {
|
||||
/**
|
||||
* Abstract Unordered Set class.
|
||||
*/
|
||||
class AbstractUnorderedSet {
|
||||
public:
|
||||
virtual void addPolymorphicItem(const type::Void& object, const type::Void& item) const = 0;
|
||||
/**
|
||||
* Class Id.
|
||||
*/
|
||||
static const ClassId CLASS_ID;
|
||||
public:
|
||||
|
||||
/**
|
||||
* Polymorphic Dispatcher.
|
||||
*/
|
||||
class AbstractPolymorphicDispatcher {
|
||||
public:
|
||||
/**
|
||||
* Add Item.
|
||||
* @param object - UnorderedSet.
|
||||
* @param item - Item.
|
||||
*/
|
||||
virtual void addPolymorphicItem(const type::Void& object, const type::Void& item) const = 0;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
template<class T>
|
||||
class UnorderedSet;
|
||||
template<class T>
|
||||
class UnorderedSet;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* `ObjectWrapper` over `std::unordered_set<T>`
|
||||
* @tparam T - Key `ObjectWrapper` type.
|
||||
* @tparam C - Class.
|
||||
*/
|
||||
template<class T, class C>
|
||||
class UnorderedSetObjectWrapper : public type::ObjectWrapper<std::unordered_set<T>, C> {
|
||||
public:
|
||||
|
@ -34,13 +34,27 @@ namespace oatpp { namespace data { namespace mapping { namespace type {
|
||||
|
||||
namespace __class {
|
||||
|
||||
/**
|
||||
* Abstract Vector Class.
|
||||
*/
|
||||
class AbstractVector {
|
||||
public:
|
||||
/**
|
||||
* Class Id.
|
||||
*/
|
||||
static const ClassId CLASS_ID;
|
||||
public:
|
||||
|
||||
/**
|
||||
* Polymorphic Dispatcher.
|
||||
*/
|
||||
class AbstractPolymorphicDispatcher {
|
||||
public:
|
||||
/**
|
||||
* Add Item.
|
||||
* @param object - Vector.
|
||||
* @param item - Item to add.
|
||||
*/
|
||||
virtual void addPolymorphicItem(const type::Void& object, const type::Void& item) const = 0;
|
||||
};
|
||||
|
||||
@ -51,6 +65,11 @@ namespace __class {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* `ObjectWrapper` over `std::vector<T>`.
|
||||
* @tparam T - Item `ObjectWrapper` type.
|
||||
* @tparam C - Class.
|
||||
*/
|
||||
template<class T, class C>
|
||||
class VectorObjectWrapper : public type::ObjectWrapper<std::vector<T>, C> {
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user