Open CASCADE Technology Reference Manual 8.0.2
Loading...
Searching...
No Matches
StdObjMgt_MapOfInstantiators Class Reference

#include <StdObjMgt_MapOfInstantiators.hxx>

Inheritance diagram for StdObjMgt_MapOfInstantiators:

Public Member Functions

template<class Persistent>
void Bind (const TCollection_AsciiString &theTypeName)
Public Member Functions inherited from NCollection_DataMap< TCollection_AsciiString, StdObjMgt_Persistent::Instantiator >
iterator begin () const noexcept
 Returns an iterator pointing to the first element in the map.
iterator end () const noexcept
 Returns an iterator referring to the past-the-end element in the map.
const_iterator cbegin () const noexcept
 Returns a const iterator pointing to the first element in the map.
const_iterator cend () const noexcept
 Returns a const iterator referring to the past-the-end element in the map.
ItemsView Items ()
 Returns a view for key-value pair iteration. Usage: for (auto [aKey, aValue] : aMap.Items())
 NCollection_DataMap ()
 Empty Constructor.
void Exchange (NCollection_DataMap &theOther) noexcept
 Exchange the content of two maps without re-allocations. Notice that allocators will be swapped as well!
const NCollection_DefaultHasher< TCollection_AsciiString > & GetHasher () const noexcept
 Returns const reference to the hasher.
NCollection_DataMap & Assign (const NCollection_DataMap &theOther)
 Assignment. This method does not change the internal allocator.
NCollection_DataMap & operator= (const NCollection_DataMap &theOther)
 Assignment operator.
void ReSize (const size_t N)
 ReSize.
bool Bind (const TCollection_AsciiString &theKey, const StdObjMgt_Persistent::Instantiator &theItem)
 Bind binds Item to Key in map.
StdObjMgt_Persistent::Instantiator * Bound (const TCollection_AsciiString &theKey, const StdObjMgt_Persistent::Instantiator &theItem)
 Bound binds Item to Key in map.
bool TryBind (const TCollection_AsciiString &theKey, const StdObjMgt_Persistent::Instantiator &theItem)
 TryBind binds Item to Key in map only if Key is not yet bound.
StdObjMgt_Persistent::Instantiator & TryBound (const TCollection_AsciiString &theKey, const StdObjMgt_Persistent::Instantiator &theItem)
 TryBound binds Item to Key in map only if Key is not yet bound.
bool Emplace (K &&theKey, Args &&... theArgs)
 Emplace constructs value in-place; if key exists, destroys and reconstructs value.
StdObjMgt_Persistent::Instantiator & Emplaced (K &&theKey, Args &&... theArgs)
 Emplaced constructs value in-place; if key exists, destroys and reconstructs value.
bool TryEmplace (K &&theKey, Args &&... theArgs)
 TryEmplace constructs value in-place only if key not already bound.
StdObjMgt_Persistent::Instantiator & TryEmplaced (K &&theKey, Args &&... theArgs)
 TryEmplaced constructs value in-place only if key not already bound.
bool IsBound (const TCollection_AsciiString &theKey) const
 IsBound.
std::optional< std::pair< std::reference_wrapper< const TCollection_AsciiString >, std::reference_wrapper< const StdObjMgt_Persistent::Instantiator > > > Contained (const TCollection_AsciiString &theKey) const
 Contained returns optional pair of const references to key and value. Returns std::nullopt if the key is not found.
bool UnBind (const TCollection_AsciiString &theKey)
 UnBind removes Item Key pair from map.
const StdObjMgt_Persistent::Instantiator * Seek (const TCollection_AsciiString &theKey) const
 Seek returns pointer to Item by Key. Returns NULL is Key was not bound.
const StdObjMgt_Persistent::Instantiator & Find (const TCollection_AsciiString &theKey) const
 Find returns the Item for Key. Raises if Key was not bound.
const StdObjMgt_Persistent::Instantiator & operator() (const TCollection_AsciiString &theKey) const
 operator ()
StdObjMgt_Persistent::Instantiator * ChangeSeek (const TCollection_AsciiString &theKey)
 ChangeSeek returns modifiable pointer to Item by Key. Returns NULL is Key was not bound.
StdObjMgt_Persistent::Instantiator & ChangeFind (const TCollection_AsciiString &theKey)
 ChangeFind returns modifiable Item by Key. Raises if Key was not bound.
void Clear (const bool doReleaseMemory=false)
 Clear data. If doReleaseMemory is false then the table of buckets is not released and will be reused.
 ~NCollection_DataMap () override
 Destructor.
Public Member Functions inherited from NCollection_BaseMap
size_t NbBuckets () const noexcept
 NbBuckets.
int Extent () const noexcept
 Extent (number of elements, legacy int-returning API).
int Length () const noexcept
 Length - number of elements (legacy int-returning API, synonym of Extent()).
size_t Size () const noexcept
 Size - number of elements.
bool IsEmpty () const noexcept
 IsEmpty.
const occ::handle< NCollection_BaseAllocator > & Allocator () const noexcept
 Returns attached allocator.

Additional Inherited Members

Public Types inherited from NCollection_DataMap< TCollection_AsciiString, StdObjMgt_Persistent::Instantiator >
typedef TCollection_AsciiString key_type
 STL-compliant typedef for key type.
typedef StdObjMgt_Persistent::Instantiator value_type
 STL-compliant typedef for value type.
typedef NCollection_StlIterator< std::forward_iterator_tag, Iterator, StdObjMgt_Persistent::Instantiator, false > iterator
 Shorthand for a regular iterator type.
typedef NCollection_StlIterator< std::forward_iterator_tag, Iterator, StdObjMgt_Persistent::Instantiator, true > const_iterator
 Shorthand for a constant iterator type.
using KeyValueRef
 Key-value pair reference for structured binding support. Enables: for (auto [key, value] : map.Items())
using ConstKeyValueRef
 Const key-value pair reference for structured binding support.
using ItemsView
 View class for key-value pair iteration (mutable).
using ConstItemsView
 View class for key-value pair iteration (const).
Protected Member Functions inherited from NCollection_DataMap< TCollection_AsciiString, StdObjMgt_Persistent::Instantiator >
bool lookup (const TCollection_AsciiString &theKey, DataMapNode *&theNode) const
 Lookup for particular key in map.
bool IsEqual (const TCollection_AsciiString &theKey1, const TCollection_AsciiString &theKey2) const
size_t HashCode (const TCollection_AsciiString &theKey, const size_t theUpperBound) const
auto emplaceImpl (K &&theKey, std::bool_constant< IsTry >, std::bool_constant< ReturnRef >, Args &&... theArgs) -> std::conditional_t< ReturnRef, StdObjMgt_Persistent::Instantiator &, bool >
 Implementation helper for Bind/TryBind/Bound/TryBound/Emplace/TryEmplace/Emplaced/TryEmplaced. Uses destroy + reconstruct in-place instead of assignment operator.
Protected Member Functions inherited from NCollection_BaseMap
 NCollection_BaseMap (const size_t theNbBuckets, const bool single, const occ::handle< NCollection_BaseAllocator > &theAllocator)
 Constructor.
 NCollection_BaseMap (NCollection_BaseMap &&theOther) noexcept
 Move Constructor.
virtual ~NCollection_BaseMap ()=default
 Destructor.
bool BeginResize (const size_t theExtent, size_t &theNewBuckets, NCollection_ListNode **&data1, NCollection_ListNode **&data2) const
 BeginResize.
void EndResize (const size_t theExtent, const size_t theNewBuckets, NCollection_ListNode **data1, NCollection_ListNode **data2) noexcept
 EndResize.
bool Resizable () const noexcept
 Resizable.
size_t Increment () noexcept
 Increment.
size_t Decrement () noexcept
 Decrement.
void Destroy (NCollection_DelMapNode fDel, bool doReleaseMemory=true)
 Destroy.
size_t NextPrimeForMap (const size_t N) const noexcept
 NextPrimeForMap.
void exchangeMapsData (NCollection_BaseMap &theOther) noexcept
 Exchange content of two maps without data copying.
NCollection_BaseMap & operator= (NCollection_BaseMap &&) noexcept=delete
 Move operator.
 NCollection_BaseMap (const NCollection_BaseMap &)=delete
 Copy Constructor.
NCollection_BaseMap & operator= (const NCollection_BaseMap &)=delete
 Assign operator.
Static Protected Member Functions inherited from NCollection_BaseMap
static size_t NbBucketsFromInt (const int theNbBuckets)
 Converts legacy int bucket count to size_t with validation.
Protected Attributes inherited from NCollection_BaseMap
occ::handle< NCollection_BaseAllocator > myAllocator
NCollection_ListNode ** myData1
NCollection_ListNode ** myData2

Member Function Documentation

◆ Bind()

template<class Persistent>
void StdObjMgt_MapOfInstantiators::Bind ( const TCollection_AsciiString & theTypeName)
inline

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