My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
LibThread::CountTrigger Class Reference

Public Member Functions

 CountTrigger (long count_init)
 
virtual bool ready ()
 
virtual bool accept (leftv arg)
 
virtual void activate (leftv arg)
 
virtual void execute ()
 
- Public Member Functions inherited from LibThread::Trigger
virtual bool accept (leftv arg)=0
 
virtual void activate (leftv arg)=0
 
 Trigger ()
 
- Public Member Functions inherited from LibThread::Job
 Job ()
 
 ~Job ()
 
void addDep (Job *job)
 
void addDep (vector< Job * > &jobs)
 
void addDep (long ndeps, Job **jobs)
 
void addNotify (vector< Job * > &jobs)
 
void addNotify (Job *job)
 
virtual bool ready ()
 
virtual void execute ()=0
 
void run ()
 
- Public Member Functions inherited from LibThread::SharedObject
 SharedObject ()
 
virtual ~SharedObject ()
 
void set_type (int type_init)
 
int get_type ()
 
void set_name (std::string &name_init)
 
void set_name (const char *s)
 
std::string & get_name ()
 
void incref (int by=1)
 
long decref ()
 
long getref ()
 
virtual BOOLEAN op2 (int op, leftv res, leftv a1, leftv a2)
 
virtual BOOLEAN op3 (int op, leftv res, leftv a1, leftv a2, leftv a3)
 

Private Attributes

long count
 

Additional Inherited Members

- Data Fields inherited from LibThread::Job
ThreadPoolpool
 
long prio
 
size_t id
 
long pending_index
 
vector< Job * > deps
 
vector< Job * > notify
 
vector< Trigger * > triggers
 
vector< string > args
 
string result
 
void * data
 
bool fast
 
bool done
 
bool queued
 
bool running
 
bool cancelled
 

Detailed Description

Definition at line 2034 of file shared.cc.

Constructor & Destructor Documentation

◆ CountTrigger()

LibThread::CountTrigger::CountTrigger ( long  count_init)
inline

Definition at line 2038 of file shared.cc.

2038 : Trigger(), count(count_init) {
2039 }

Member Function Documentation

◆ accept()

virtual bool LibThread::CountTrigger::accept ( leftv  arg)
inlinevirtual

Implements LibThread::Trigger.

Definition at line 2044 of file shared.cc.

2044 {
2045 return arg == NULL;
2046 }
#define NULL
Definition: omList.c:12

◆ activate()

virtual void LibThread::CountTrigger::activate ( leftv  arg)
inlinevirtual

Implements LibThread::Trigger.

Definition at line 2047 of file shared.cc.

2047 {
2048 if (!ready()) {
2049 count--;
2050 }
2051 }
virtual bool ready()
Definition: shared.cc:2040

◆ execute()

virtual void LibThread::CountTrigger::execute ( )
inlinevirtual

Implements LibThread::Job.

Definition at line 2052 of file shared.cc.

2052 {
2053 // do nothing
2054 }

◆ ready()

virtual bool LibThread::CountTrigger::ready ( )
inlinevirtual

Reimplemented from LibThread::Job.

Definition at line 2040 of file shared.cc.

2040 {
2041 if (!Trigger::ready()) return false;
2042 return count <= 0;
2043 }
virtual bool ready()
Definition: shared.cc:1605

Field Documentation

◆ count

long LibThread::CountTrigger::count
private

Definition at line 2036 of file shared.cc.


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