Collection¶
-
template<typename
T
>
classrlogic
::
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:
T: the object type to iterate over, e.g. rlogic::LuaScript
Public Types
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