ShlubluLib  v0.5
ShlubluLib is a lightweight, modular, general purpose, open-source C++ library for Linux and Windows.
Public Types | Public Member Functions | List of all members
shlublu::Python::ObjectHandlersCollection Class Reference

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...
 

Detailed Description

Collection of ObjectHandler used internally by Python.

Each element of a collection instance correspond to a unique ObjectHandler use case.

Constructor & Destructor Documentation

◆ ObjectHandlersCollection()

shlublu::Python::ObjectHandlersCollection::ObjectHandlersCollection ( )

Empty constructor.

Creates an empty collection.

Member Function Documentation

◆ registerObject()

ObjectHandler const& shlublu::Python::ObjectHandlersCollection::registerObject ( ObjectHandler const &  oh)

Registers a use case represented by an ObjectHandler.

Parameters
ohthe use case to register
Returns
a reference to this use case once registered
Exceptions
BindingLogicErrorif oh's ID is already registered

◆ unregisterObject()

void shlublu::Python::ObjectHandlersCollection::unregisterObject ( ObjectHandler const &  oh)

Unregisters a use case represented by an ObjectHandler.

Parameters
ohthe use case to unregister
Exceptions
BindingLogicErrorif oh's ID has not been registered or has been unregistered already

◆ clear()

void shlublu::Python::ObjectHandlersCollection::clear ( )

Clears the collection.

All use cases are unregistered by a call to this function.

◆ isRegistered()

bool shlublu::Python::ObjectHandlersCollection::isRegistered ( ObjectHandler const &  oh) const

Returns the registration status of a use case represented by an ObjectHandler.

Parameters
ohthe use case to assess
Returns
the registration status of oh based on its ID

◆ size()

size_t shlublu::Python::ObjectHandlersCollection::size ( ) const

Returns the size of this collection.

Returns
the number of elements it contains.

◆ begin()

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.

Returns
an iterator to the first element of the collection

◆ end()

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.

Returns
an iterator to the past-the-end element of the collection

The documentation for this class was generated from the following file: