# Collection.hpp

This File On Github
Ask A Question

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

# Collection

Abstract Collection.
Ex.: Vector, List, Set.

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

# Collection::Iterator

Iterator.

namespace oatpp { namespace data { namespace mapping { namespace type { namespace __class { 
  class Collection {
    struct Iterator {}
  };
}}}}}

# Methods

Return Type Name Summary
[none] ~Iterator Default virtual destructor.
type::Void get Get current item.
void next Iterate to next item.
bool finished Check if iterator finished.

# Collection::Iterator::~Iterator

Default virtual destructor.

virtual ~Iterator() = default

# Collection::Iterator::get

Get current item.

  • @return

virtual type::Void get() = 0

# Collection::Iterator::next

Iterate to next item.

virtual void next() = 0

# Collection::Iterator::finished

Check if iterator finished.

  • @return

virtual bool finished() = 0

# Collection::PolymorphicDispatcher

Polymorphic Dispatcher

namespace oatpp { namespace data { namespace mapping { namespace type { namespace __class { 
  class Collection {
    class PolymorphicDispatcher {}
  };
}}}}}

# Methods

Return Type Name Summary
[none] ~PolymorphicDispatcher Virtual destructor.
type::Void createObject Create Collection.
const type::Type* getItemType Get type of collection items.
v_int64 getCollectionSize Get collection size.
void addItem Add item.
std::unique_ptr<Iterator> beginIteration Begin collection iteration.

# Collection::PolymorphicDispatcher::~PolymorphicDispatcher

Virtual destructor.

virtual ~PolymorphicDispatcher() = default

# Collection::PolymorphicDispatcher::createObject

Create Collection.

  • @return

virtual type::Void createObject() const = 0

# Collection::PolymorphicDispatcher::getItemType

Get type of collection items.

  • @return

virtual const type::Type* getItemType() const = 0

# Collection::PolymorphicDispatcher::getCollectionSize

Get collection size.

  • @param object - collection.
  • @return - size of the collection (elements count).

virtual v_int64 getCollectionSize(const type::Void& object) const = 0

# Collection::PolymorphicDispatcher::addItem

Add item.

  • @param object - Collection.
  • @param item - Item to add.

virtual void addItem(const type::Void& object, const type::Void& item) const = 0

# Collection::PolymorphicDispatcher::beginIteration

Begin collection iteration.

  • @param object - Collection.
  • @return

virtual std::unique_ptr<Iterator> beginIteration(const type::Void& object) const = 0