BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlcc::SkipList_NodeCreationHelper< KEY, DATA > Class Template Reference

#include <bdlcc_skiplist.h>

Public Member Functions

 SkipList_NodeCreationHelper (PoolManager *poolManager, Node *node, bslma::Allocator *basicAllocator=0)
 
 ~SkipList_NodeCreationHelper ()
 
void construct (const KEY &key, const DATA &data)
 

Detailed Description

template<class KEY, class DATA>
class bdlcc::SkipList_NodeCreationHelper< KEY, DATA >

This component-private structure is a scoped guard that initializes new nodes and releases them in case of exception.

See bdlcc_skiplist

Constructor & Destructor Documentation

◆ SkipList_NodeCreationHelper()

template<class KEY , class DATA >
bdlcc::SkipList_NodeCreationHelper< KEY, DATA >::SkipList_NodeCreationHelper ( PoolManager *  poolManager,
Node node,
bslma::Allocator basicAllocator = 0 
)
inline

Create a new scoped guard object to assist in exception-safe initialization of the specified node, which was allocated from the specified poolManager. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ ~SkipList_NodeCreationHelper()

template<class KEY , class DATA >
bdlcc::SkipList_NodeCreationHelper< KEY, DATA >::~SkipList_NodeCreationHelper ( )
inline

Destroy this scoped guard. If the guard currently manages a node, destroy its data as necessary and return it to the pool.

Member Function Documentation

◆ construct()

template<class KEY , class DATA >
void bdlcc::SkipList_NodeCreationHelper< KEY, DATA >::construct ( const KEY &  key,
const DATA &  data 
)
inline

Attempt to copy-construct the specified key and data into the node specified at construction; then release the node from management. Note that if an exception is thrown during the invocation of either constructor, the node will remain under management and thus the destructor of this object will do the appropriate cleanup. The behavior is undefined if construct has already been invoked on this scoped guard object.


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