plebble
us::gov::engine::syncd_t Struct Reference

#include <syncd.h>

Inheritance diagram for us::gov::engine::syncd_t:
Collaboration diagram for us::gov::engine::syncd_t:

Classes

struct  actuator
 

Public Types

typedef bgtask t
 
typedef diff::hash_t hash_t
 

Public Member Functions

 syncd_t (actuator *d)
 
 ~syncd_t () override
 
 syncd_t (const syncd_t &)=delete
 
syncd_toperator= (const syncd_t &)=delete
 
void dump (ostream &os) const
 
void run ()
 
void update (const hash_t &head, const hash_t &tail)
 
void update (const hash_t &tail)
 
void wait ()
 
void onwakeup ()
 
void wait (const chrono::steady_clock::duration &d)
 
const hash_ttip () const
 
bool in_sync () const
 
bool in_sync_ () const
 
void signal_file_arrived ()
 
void logline (ostream &os) const
 
- Public Member Functions inherited from us::gov::bgtask
 bgtask ()
 
 bgtask (function< void()> run, function< void()> onwakeup)
 
virtual ~bgtask ()
 
void set_run_function (function< void()> r)
 
virtual ko start ()
 
virtual ko wait_ready (const chrono::system_clock::time_point &deadline) const
 
virtual void stop ()
 
virtual void join ()
 
void wakeup ()
 
bool isup () const
 
bool isdown () const
 
bool resumed () const
 
void run_ ()
 
void reset ()
 
bool reset_wait ()
 
bool reset_resume ()
 
bool is_active () const
 
 bgtask ()
 
 bgtask (callback cb0)
 
void set_callback (callback r)
 
ko start ()
 
ko wait_ready (Date deadline)
 
void stop ()
 
void join ()
 
boolean reset_wait ()
 
void wakeup ()
 
boolean reset_resume ()
 
boolean isup ()
 
boolean isdown ()
 
boolean resumed ()
 
void reset ()
 
boolean is_active ()
 

Public Attributes

actuatord
 
condition_variable cv
 
mutex mx
 
hash_t head
 
hash_t cur
 
hash_t tail
 
condition_variable cv_wait4file
 
mutex mx_wait4file
 
atomic< bool > file_arrived {false}
 
hash_t last_snapshot {0}
 

Additional Inherited Members

- Static Public Attributes inherited from us::gov::bgtask
static const char * KO_81021
 
static ko KO_81021 =new ko("KO 81021 Ready status never reached.")
 
- Protected Attributes inherited from us::gov::bgtask
atomic< short > resume {0}
 
thread * th {nullptr}
 
bool active {false}
 
function< void()> run
 
function< void()> onwakeup
 
mutex mx_ready
 
bool ready {false}
 
condition_variable cv_ready
 
AtomicInteger resume =new AtomicInteger(0)
 
Thread th =null
 
boolean active =false
 
callback cb =null
 
ReentrantLock mx_ready = new ReentrantLock()
 
boolean ready =false
 
Condition cv_ready =mx_ready.newCondition()
 

Member Typedef Documentation

◆ hash_t

◆ t

Constructor & Destructor Documentation

◆ syncd_t() [1/2]

us::gov::engine::syncd_t::syncd_t ( actuator d)

◆ ~syncd_t()

us::gov::engine::syncd_t::~syncd_t ( )
override

◆ syncd_t() [2/2]

us::gov::engine::syncd_t::syncd_t ( const syncd_t )
delete

Member Function Documentation

◆ dump()

void us::gov::engine::syncd_t::dump ( ostream &  os) const

◆ in_sync()

bool us::gov::engine::syncd_t::in_sync ( ) const

◆ in_sync_()

bool us::gov::engine::syncd_t::in_sync_ ( ) const

◆ logline()

void us::gov::engine::syncd_t::logline ( ostream &  os) const

◆ onwakeup()

void us::gov::engine::syncd_t::onwakeup ( )

◆ operator=()

syncd_t& us::gov::engine::syncd_t::operator= ( const syncd_t )
delete

◆ run()

void us::gov::engine::syncd_t::run ( )

Reimplemented from us::gov::bgtask.

◆ signal_file_arrived()

void us::gov::engine::syncd_t::signal_file_arrived ( )

◆ tip()

const hash_t& us::gov::engine::syncd_t::tip ( ) const

◆ update() [1/2]

void us::gov::engine::syncd_t::update ( const hash_t head,
const hash_t tail 
)

◆ update() [2/2]

void us::gov::engine::syncd_t::update ( const hash_t tail)

◆ wait() [1/2]

void us::gov::engine::syncd_t::wait ( )

◆ wait() [2/2]

void us::gov::engine::syncd_t::wait ( const chrono::steady_clock::duration &  d)

Member Data Documentation

◆ cur

hash_t us::gov::engine::syncd_t::cur

◆ cv

condition_variable us::gov::engine::syncd_t::cv

◆ cv_wait4file

condition_variable us::gov::engine::syncd_t::cv_wait4file

◆ d

actuator* us::gov::engine::syncd_t::d

◆ file_arrived

atomic<bool> us::gov::engine::syncd_t::file_arrived {false}

◆ head

hash_t us::gov::engine::syncd_t::head

◆ last_snapshot

hash_t us::gov::engine::syncd_t::last_snapshot {0}

◆ mx

mutex us::gov::engine::syncd_t::mx
mutable

◆ mx_wait4file

mutex us::gov::engine::syncd_t::mx_wait4file

◆ tail

hash_t us::gov::engine::syncd_t::tail

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