Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

unique_key_generator Class Reference

supports the generation and reusing of the unique key sequence More...

#include <stack.h>

List of all members.

Public Member Functions

 unique_key_generator (size_t capacity=os_def_size)
 constructor
 ~unique_key_generator ()
 destructor
void clear ()
 clears all internal resources
size_t generate ()
 generates the new unique key or takes it from repository
void save (size_t key)
 saves the used key and store it in repository

Private Member Functions

 unique_key_generator (const unique_key_generator &x)
 private copy constructor
unique_key_generatoroperator= (const unique_key_generator &x)
 private assign operator

Private Attributes

size_t _last
 keep the last key
stack< size_t > _rep
 repository for the used keys


Detailed Description

supports the generation and reusing of the unique key sequence

Definition at line 421 of file stack.h.


Constructor & Destructor Documentation

unique_key_generator::unique_key_generator ( const unique_key_generator x  )  [private]

private copy constructor

unique_key_generator::unique_key_generator ( size_t  capacity = os_def_size  )  [inline]

constructor

Parameters:
capacity  default capacity for stack chunks

Definition at line 424 of file stack.hpp.

unique_key_generator::~unique_key_generator (  )  [inline]

destructor

Definition at line 432 of file stack.hpp.

References clear().


Member Function Documentation

unique_key_generator& unique_key_generator::operator= ( const unique_key_generator x  )  [private]

private assign operator

void unique_key_generator::clear (  )  [inline]

clears all internal resources

Definition at line 442 of file stack.hpp.

References _last, _rep, and stack< T >::clear().

Referenced by aiosock::off(), aiofile::off(), var_object_repository::reset(), fuzzy_matcher_impl::reset(), and ~unique_key_generator().

size_t unique_key_generator::generate (  )  [inline]

generates the new unique key or takes it from repository

Definition at line 453 of file stack.hpp.

References _last, _rep, base_stack< T >::empty(), stack< T >::pop(), and base_stack< T >::top().

Referenced by aiofile::_assign_file(), aiosock::_assign_socket(), fuzzy_matcher_impl::add(), and var_object_repository::insert_object().

void unique_key_generator::save ( size_t  key  )  [inline]


Member Data Documentation

size_t unique_key_generator::_last [private]

keep the last key

Definition at line 450 of file stack.h.

Referenced by clear(), and generate().

stack< size_t > unique_key_generator::_rep [private]

repository for the used keys

Definition at line 451 of file stack.h.

Referenced by clear(), generate(), and save().


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


© Copyright Terimber 2003-.