Collection

template<typename T>
class rlogic::Collection

A Collection which allows STL-style algorithm with forward semantics to be executed (e.g. find_if, for_each etc.). A Collection cannot be instantiated directly, it can only be obtained using rlogic::LogicEngine::getCollection.

See also rlogic::Iterator for more info on the iterator objects returned by begin and end.

Template parameters:

Public Types

using iterator = Iterator<T, internal_container_type, false>

The iterator type returned by begin() and end()

using const_iterator = Iterator<T, internal_container_type, true>

The iterator type returned by cbegin() and cend()

using value_type = typename iterator::value_type

The iterator type after dereferencing

using pointer = typename iterator::pointer

Iterator value pointer type

using reference = typename iterator::reference

Iterator value reference type

Public Functions

size_t size() const

Return number of elements in the collection

Return

number of elements in the collection

iterator begin()

Return an iterator to the start of the collection

Return

iterator to the start of the collection

const_iterator begin() const

Return an const iterator to the start of the collection

Return

const iterator to the start of the collection

iterator end()

Return an iterator to the end of the collection

Return

iterator to the end of the collection

const_iterator end() const

Return a const iterator to the end of the collection

Return

const iterator to the end of the collection

const_iterator cbegin() const

Return a const iterator to the start of the collection

Return

const iterator to the of the collection

const_iterator cend() const

Return a const iterator to the end of the collection

Return

const iterator to the end of the collection

Collection() = delete

Default constructor is deleted because a collection is supposed to provide read-only access to internal data of the rlogic::LogicEngine class, therefore it can only be obtained by calling rlogic::LogicEngine::getCollection

~Collection() noexcept = default

Default destructor

Collection(const Collection &other) noexcept = default

Default copy constructor

Parameters
  • other: collection to copy

Collection &operator=(const Collection &other) noexcept = default

Default assignment operator

Parameters
  • other: collection to assign from

Collection(internal_container_type &container)

Internal constructor. Not supposed to be called from user code!

Parameters
  • container: internal container