Develop Biology
The language of life
bio::physical::ThreadedPeriodic Class Reference

#include <ThreadedPeriodic.h>

+ Inheritance diagram for bio::physical::ThreadedPeriodic:
+ Collaboration diagram for bio::physical::ThreadedPeriodic:

Public Member Functions

virtual ~ThreadedPeriodic ()
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, ThreadedPeriodic) ThreadedPeriodic(TimeUS interval
 
virtual bool Work ()
 
- Public Member Functions inherited from bio::physical::Periodic
 Periodic (TimeUS interval=GetDefaultInterval())
 
virtual ~Periodic ()
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Periodic) static TimeUS GetDefaultInterval()
 
virtual void CheckIn ()
 
TimeUS GetInterval () const
 
float GetIntervalInSeconds () const
 
virtual Properties GetProperties () const
 
Timestamp GetTimeLastPeaked () const
 
virtual void InitializeImplementation (ByteStreams args)
 
virtual Code Peak ()
 
virtual Code Reify (Symmetry *symmetry)
 
virtual void SetInterval (TimeUS interval)
 
virtual void SetLastPeakTimestamp (Timestamp lastPeak)
 
virtual SymmetrySpin () const
 
- Public Member Functions inherited from bio::physical::Class< Periodic >
 Class (Periodic *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
PeriodicConvert (Wave *wave)
 
virtual operator Periodic * ()
 
virtual operator Wave * ()
 
- Public Member Functions inherited from bio::physical::Wave
 Wave (Symmetry *symmetry=NULL)
 
virtual ~Wave ()
 
virtual chemical::AtomAsAtom ()
 
virtual const chemical::AtomAsAtom () const
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual Code Attenuate (const Wave *other)
 
virtual WaveClone () const
 
virtual WaveDemodulate ()
 
virtual const WaveDemodulate () const
 
virtual Code Disattenuate (const Wave *other)
 
virtual Properties GetProperties () const
 
virtual WaveModulate (Wave *signal)
 
virtual Waveoperator* ()
 
virtual const Waveoperator* () const
 
virtual Waveoperator* (Wave *signal)
 
virtual void operator+ (const Wave *other)
 
virtual void operator- (const Wave *other)
 
virtual void operator| (Symmetry *symmetry)
 
virtual Code Reify (Symmetry *symmetry)
 
virtual SymmetrySpin () const
 
- Public Member Functions inherited from bio::Threaded
 Threaded ()
 
virtual ~Threaded ()
 
virtual ThreadId GetThreadId ()
 
virtual bool IsRunning ()
 
virtual void Sleep (TimeUS us)
 
virtual bool Start ()
 
virtual bool Stop ()
 
virtual bool Work ()
 
- Public Member Functions inherited from bio::ThreadSafe
 ThreadSafe ()
 
 ThreadSafe (const ThreadSafe &toCopy)
 
virtual ~ThreadSafe ()
 
void LockThread () const
 
void UnlockThread () const
 

Additional Inherited Members

- Public Types inherited from bio::Threaded
typedef pid_t ThreadId
 
- Static Public Member Functions inherited from bio::physical::Periodic
static Properties GetClassProperties ()
 
- Static Public Member Functions inherited from bio::physical::Wave
static Properties GetResonanceBetween (const Wave *wave, const Properties &properties)
 
static Properties GetResonanceBetween (const Wave *wave1, const Wave *wave2)
 
static Properties GetResonanceBetween (ConstWaves waves)
 
- Static Public Member Functions inherited from bio::Threaded
static ThreadId InvalidThreadId ()
 
- Protected Member Functions inherited from bio::VirtualBase
 VirtualBase ()
 
virtual ~VirtualBase ()
 
void Initialize (ByteStream arg1)
 
void Initialize (ByteStream arg1, ByteStream arg2)
 
void Initialize (ByteStream arg1, ByteStream arg2, ByteStream arg3)
 
void Initialize (ByteStreams args)
 
virtual void InitializeImplementation (ByteStreams args)=0
 
- Protected Member Functions inherited from bio::Threaded
virtual void RequestStop ()
 
- Static Protected Member Functions inherited from bio::Threaded
static void * Worker (void *arg)
 
- Protected Attributes inherited from bio::physical::Periodic
TimeUS m_interval
 
Timestamp m_lastPeakTimestamp
 
- Protected Attributes inherited from bio::physical::Class< Periodic >
Periodicm_object
 
- Protected Attributes inherited from bio::physical::Wave
Wavem_signal
 
Symmetrym_symmetry
 
- Protected Attributes inherited from bio::VirtualBase
bool m_hasBeenInitialized
 
- Protected Attributes inherited from bio::Threaded
bool m_created
 
ThreadId m_id
 
bool m_running
 
bool m_stopRequested
 

Detailed Description

A ThreadedPeriodic is simply an Periodic that vibrates in its own thread. See Periodic.h & Threaded.h for more info.

Definition at line 34 of file ThreadedPeriodic.h.

Constructor & Destructor Documentation

◆ ~ThreadedPeriodic()

bio::physical::ThreadedPeriodic::~ThreadedPeriodic ( )
virtual

Definition at line 35 of file ThreadedPeriodic.cpp.

36{
37}

Member Function Documentation

◆ BIO_DISAMBIGUATE_ALL_CLASS_METHODS()

bio::physical::ThreadedPeriodic::BIO_DISAMBIGUATE_ALL_CLASS_METHODS ( physical  ,
ThreadedPeriodic   
)

Ensure virtual methods point to Class implementations.

◆ Work()

bool bio::physical::ThreadedPeriodic::Work ( )
virtual

Calls Peak() then sleeps.

Reimplemented from bio::Threaded.

Definition at line 39 of file ThreadedPeriodic.cpp.

40{
42 Peak();
43 LockThread();
48 return true;
49}
void LockThread() const
Definition: ThreadSafe.cpp:84
void UnlockThread() const
Definition: ThreadSafe.cpp:97
virtual void Sleep(TimeUS us)
Definition: Threaded.cpp:170
virtual bool Work()
Definition: Threaded.h:89
virtual Code Peak()
Definition: Periodic.h:84
TimeUS GetInterval() const
Definition: Periodic.cpp:69
virtual void SetLastPeakTimestamp(Timestamp lastPeak)
Definition: Periodic.cpp:84
Timestamp GetCurrentTimestamp()
Definition: Time.cpp:41
uint32_t Timestamp
Definition: Types.h:68

References bio::physical::GetCurrentTimestamp().


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