ShlubluLib
v0.5
ShlubluLib is a lightweight, modular, general purpose, open-source C++ library for Linux and Windows.
|
Collection of ObjectHandler used internally by Python. More...
#include <Python_ObjectHandlersCollection.h>
Public Types | |
using | Storage = std::unordered_set< ObjectHandler, ObjectHandler::Hasher > |
Definition of the storage container. | |
Public Member Functions | |
ObjectHandlersCollection () | |
Empty constructor. More... | |
ObjectHandlersCollection (ObjectHandlersCollection const &)=delete | |
Copy constructor is deleted. | |
ObjectHandlersCollection (ObjectHandlersCollection &&)=delete | |
Move constructor is deleted. | |
ObjectHandler const & | registerObject (ObjectHandler const &oh) |
Registers a use case represented by an ObjectHandler. More... | |
void | unregisterObject (ObjectHandler const &oh) |
Unregisters a use case represented by an ObjectHandler. More... | |
void | clear () |
Clears the collection. More... | |
bool | isRegistered (ObjectHandler const &oh) const |
Returns the registration status of a use case represented by an ObjectHandler. More... | |
size_t | size () const |
Returns the size of this collection. More... | |
Storage::const_iterator | begin () const |
Returns an iterator to the first element of this collection. More... | |
Storage::const_iterator | end () const |
Returns an iterator to the past-the-end element of this collection. More... | |
Collection of ObjectHandler used internally by Python.
Each element of a collection instance correspond to a unique ObjectHandler use case.
shlublu::Python::ObjectHandlersCollection::ObjectHandlersCollection | ( | ) |
Empty constructor.
Creates an empty collection.
ObjectHandler const& shlublu::Python::ObjectHandlersCollection::registerObject | ( | ObjectHandler const & | oh | ) |
Registers a use case represented by an ObjectHandler.
oh | the use case to register |
BindingLogicError | if oh 's ID is already registered |
void shlublu::Python::ObjectHandlersCollection::unregisterObject | ( | ObjectHandler const & | oh | ) |
Unregisters a use case represented by an ObjectHandler.
oh | the use case to unregister |
BindingLogicError | if oh 's ID has not been registered or has been unregistered already |
void shlublu::Python::ObjectHandlersCollection::clear | ( | ) |
Clears the collection.
All use cases are unregistered by a call to this function.
bool shlublu::Python::ObjectHandlersCollection::isRegistered | ( | ObjectHandler const & | oh | ) | const |
Returns the registration status of a use case represented by an ObjectHandler.
oh | the use case to assess |
oh
based on its ID size_t shlublu::Python::ObjectHandlersCollection::size | ( | ) | const |
Returns the size of this collection.
Storage::const_iterator shlublu::Python::ObjectHandlersCollection::begin | ( | ) | const |
Returns an iterator to the first element of this collection.
Order is internal to ObjectHandlersCollection. It does not follow the registration order. Iterating from begin()
to end()
guarantees to go through each element once and only once.
Storage::const_iterator shlublu::Python::ObjectHandlersCollection::end | ( | ) | const |
Returns an iterator to the past-the-end element of this collection.
Order is internal to ObjectHandlersCollection. It does not follow the registration order. Iterating from begin()
to end()
guarantees to go through each element once and only once.