Jack2  1.9.9
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Jack::JackAtomicState< T > Class Template Reference

A class to handle two states (switching from one to the other) in a lock-free manner. More...

#include <JackAtomicState.h>

Public Member Functions

T * ReadCurrentState ()
 Returns the current state : only valid in the RT reader thread.
 
UInt16 GetCurrentIndex ()
 Returns the current state index.
 
T * TrySwitchState ()
 Tries to switch to the next state and returns the new current state (either the same as before if case of switch failure or the new one)
 
T * TrySwitchState (bool *result)
 Tries to switch to the next state and returns the new current state (either the same as before if case of switch failure or the new one)
 
T * WriteNextStateStart ()
 Start write operation : setup and returns the next state to update, check for recursive write calls.
 
void WriteNextStateStop ()
 Stop write operation : make the next state ready to be used by the RT thread.
 
bool IsPendingChange ()
 

Protected Member Functions

UInt32 WriteNextStateStartAux ()
 
void WriteNextStateStopAux ()
 

Protected Attributes

fState [2]
 
volatile AtomicCounter fCounter
 
SInt32 fCallWriteCounter
 

Detailed Description

template<class T>
class Jack::JackAtomicState< T >

A class to handle two states (switching from one to the other) in a lock-free manner.

Definition at line 90 of file JackAtomicState.h.


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