diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-10-11 15:10:34 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-10-11 15:10:34 +0000 |
commit | 23111468052a9f4ec607b9b10123f62004348216 (patch) | |
tree | f81e272d0159b645be87a876da75ae4911e4dfaa /apps/JAWS/clients/Caching/ID_Generator.h | |
parent | d71e1419e3c009e237fec7a91e832be8fc0fe31a (diff) | |
download | ATCD-TAO-1_0_6.tar.gz |
This commit was manufactured by cvs2svn to create tag 'TAO-1_0_6'.TAO-1_0_6
Diffstat (limited to 'apps/JAWS/clients/Caching/ID_Generator.h')
-rw-r--r-- | apps/JAWS/clients/Caching/ID_Generator.h | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/apps/JAWS/clients/Caching/ID_Generator.h b/apps/JAWS/clients/Caching/ID_Generator.h deleted file mode 100644 index 3c02779f36e..00000000000 --- a/apps/JAWS/clients/Caching/ID_Generator.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// none -// -// = FILENAME -// ID_Generator.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef ACE_ID_GENERATOR_H -#define ACE_ID_GENERATOR_h - -#include "ace/Synch.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#define ACE_OFFER_ID_LENGTH 21 - -class ACE_ID_Generator - // = TITLE - // An unique ID generator. - // - // = DESCRIPTION - - // Generate an offer ID according to current time and avoid - // duplicate ID. It guarantees ID uniqueness within a process, - // i.e. no two threads may get the same ID string. Using a - // similar method like the backery algorithm. -{ -public: - static char *get_new_id (char *id); - // allocate a new ID string and point <id> to it. - -private: - static void get_serial_id (time_t &t, size_t &s); - // Atomically get info required to generate an offer ID. - - static ACE_SYNCH_MUTEX *get_lock (void); - // Get the lock instance. - - static time_t last_time_; - // Record the time last offer ID generated. - - static size_t last_number_; - // Record serial number of last offer ID with same - // generation time. - - static ACE_SYNCH_MUTEX *lock_; - // mutex to access private member. -}; - -#endif /* ACE_ID_GENERATOR_H */ |