Interface to create and get unique sequence numbers. More...
#include <sequencer.hpp>
Public Member Functions | |
sequencer (const sequencer_impl_ptr &impl=sequencer_impl_ptr(new default_sequencer)) | |
Creates a new sequencer. More... | |
sequencer_impl_ptr | exchange_sequencer (const sequencer_impl_ptr &impl) |
long | init () |
long | reset (long id) |
long | next () |
long | current () const |
long | update (long id) |
Detailed Description
Interface to create and get unique sequence numbers.
This class provides an interface to create, get and manage unique sequence numbers. Because it is just an interface the underlaying sequencer implementation is used to do the real work implementing the sequencers strategy.
Constructor & Destructor Documentation
oos::sequencer::sequencer | ( | const sequencer_impl_ptr & | impl = sequencer_impl_ptr(new default_sequencer) | ) |
Creates a new sequencer.
This constructor creates a new sequencer. If no implementation object is given, a default implementation object is used.
- Parameters
-
impl The sequence implementation object implementing the sequence strategy.
Member Function Documentation
long oos::sequencer::current | ( | ) | const |
Returns the current sequence number.
- Returns
- The current sequence number.
sequencer_impl_ptr oos::sequencer::exchange_sequencer | ( | const sequencer_impl_ptr & | impl | ) |
Replace the current sequencer implementation with the new one and return the old implementation.
- Parameters
-
impl The new sequencer implementation.
- Returns
- The old sequencer implementation.
long oos::sequencer::init | ( | ) |
Initializes the sequencer and return the current number.
- Returns
- The current sequence number.
long oos::sequencer::next | ( | ) |
Returns the next valid sequence number.
- Returns
- The next sequence number.
long oos::sequencer::reset | ( | long | id | ) |
Resets the sequencers sequence id to the given value.
- Parameters
-
id The new sequence number.
- Returns
- The current sequence number.
long oos::sequencer::update | ( | long | id | ) |
Updates the sequence number to the given value.
- Parameters
-
id The value to update.
- Returns
- The new current sequence value.
The documentation for this class was generated from the following file:
- tools/sequencer.hpp