ShlubluLib  v0.5
ShlubluLib is a lightweight, modular, general purpose, open-source C++ library for Linux and Windows.
Python_ObjectHandlersCollection.h
Go to the documentation of this file.
1 #pragma once
2 
9 #include <unordered_set>
10 
13 
14 
15 namespace shlublu
16 {
17 
18 namespace Python
19 {
20 
27 {
28 public:
32  using Storage = std::unordered_set<ObjectHandler, ObjectHandler::Hasher>;
33 
34 public:
40 
45 
50 
59 
67 
73  void clear();
74 
81  bool isRegistered(ObjectHandler const& oh) const;
82 
88  size_t size() const;
89 
97  Storage::const_iterator begin() const;
98 
106  Storage::const_iterator end() const;
107 
108 private:
110 
111  Storage mObjects;
112 
114 };
115 
116 
117 }
118 
119 }
120 
121 
shlublu::Python::ObjectHandler
Handler of CPython object pointers used by Python to handle references counts.
Definition: Python_ObjectHandler.h:71
shlublu::Python::ObjectHandlersCollection::size
size_t size() const
Returns the size of this collection.
shlublu::Python::ObjectHandlersCollection::begin
Storage::const_iterator begin() const
Returns an iterator to the first element of this collection.
shlublu::Python::ObjectHandlersCollection::Storage
std::unordered_set< ObjectHandler, ObjectHandler::Hasher > Storage
Definition of the storage container.
Definition: Python_ObjectHandlersCollection.h:32
shlublu
shlublu::Python::ObjectHandlersCollection::ObjectHandlersCollection
ObjectHandlersCollection()
Empty constructor.
shlublu::Python::ObjectHandlersCollection::registerObject
ObjectHandler const & registerObject(ObjectHandler const &oh)
Registers a use case represented by an ObjectHandler.
shlublu::Python::ObjectHandlersCollection::isRegistered
bool isRegistered(ObjectHandler const &oh) const
Returns the registration status of a use case represented by an ObjectHandler.
shlublu::Python::ObjectHandlersCollection::unregisterObject
void unregisterObject(ObjectHandler const &oh)
Unregisters a use case represented by an ObjectHandler.
shlublu::Python::ObjectHandlersCollection::ObjectHandlersCollection
ObjectHandlersCollection(ObjectHandlersCollection const &)=delete
Copy constructor is deleted.
Python_BindingExceptions.h
shlublu::Python::ObjectHandlersCollection
Collection of ObjectHandler used internally by Python.
Definition: Python_ObjectHandlersCollection.h:27
Python_ObjectHandler.h
shlublu::Python::ObjectHandlersCollection::clear
void clear()
Clears the collection.
shlublu::Python::ObjectHandlersCollection::ObjectHandlersCollection
ObjectHandlersCollection(ObjectHandlersCollection &&)=delete
Move constructor is deleted.
shlublu::Python::ObjectHandlersCollection::end
Storage::const_iterator end() const
Returns an iterator to the past-the-end element of this collection.