| 
    qxLib
    
   | 
 
Class stores unique objects and allows access to them through tokens. More...
#include <unique_objects_pool.h>
Classes | |
| class | token | 
| The token is used for distributed access to a unique object in the pool.  More... | |
Public Member Functions | |
| unique_objects_pool (bool bAutoCleanup=true) noexcept | |
| unique_objects_pool object constructor  More... | |
| template<class U > | |
| token | get_or_create (U &&value) noexcept | 
| Get or create object.  More... | |
| void | shrink () | 
| Remove unused (with counter = 0) objects.  | |
| size_t | size () const | 
| Get number of objects stored.  More... | |
| bool | empty () const | 
| Is pool empty.  More... | |
Class stores unique objects and allows access to them through tokens.
Class is thread safe
| T | - object type | 
Definition at line 42 of file unique_objects_pool.h.
      
  | 
  inlinenoexcept | 
unique_objects_pool object constructor
| bAutoCleanup | - if true, objects will be deleted when usages count reaches 0, otherwise you should use shrink() | 
Definition at line 91 of file unique_objects_pool.inl.
      
  | 
  inline | 
Is pool empty.
| - | true if pool is empty | 
Definition at line 162 of file unique_objects_pool.inl.
      
  | 
  inlinenoexcept | 
Get or create object.
| U | - value type | 
| value | - object to search and to construct if wasn't able to find | 
| - | token to existing or constructed object | 
Definition at line 97 of file unique_objects_pool.inl.
      
  | 
  inline | 
Get number of objects stored.
| - | number of objects stored | 
Definition at line 153 of file unique_objects_pool.inl.