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

Public Member Functions

 ProcTrigger (const char *p)
 
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

string procname
 
bool success
 

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 2087 of file shared.cc.

Constructor & Destructor Documentation

◆ ProcTrigger()

LibThread::ProcTrigger::ProcTrigger ( const char *  p)
inline

Definition at line 2092 of file shared.cc.

2092 : Trigger(), procname(p), success(false) {
2093 }
int p
Definition: cfModGcd.cc:4078

Member Function Documentation

◆ accept()

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

Implements LibThread::Trigger.

Definition at line 2098 of file shared.cc.

2098 {
2099 return TRUE;
2100 }
#define TRUE
Definition: auxiliary.h:100

◆ activate()

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

Implements LibThread::Trigger.

Definition at line 2101 of file shared.cc.

2101 {
2102 if (!ready()) {
2104 vector<leftv> argv;
2105 for (unsigned i = 0; i < args.size(); i++) {
2106 appendArg(argv, args[i]);
2107 }
2108 int error = false;
2109 while (arg) {
2110 appendArgCopy(argv, arg);
2111 arg = arg->next;
2112 }
2113 sleftv val;
2114 if (!error)
2115 error = executeProc(val, procname.c_str(), argv);
2116 if (!error) {
2117 if (val.Typ() == NONE || (val.Typ() == INT_CMD &&
2118 (long) val.Data()))
2119 {
2120 success = true;
2121 }
2122 val.CleanUp();
2123 }
2124 pool->scheduler->lock.lock();
2125 }
2126 }
int i
Definition: cfEzgcd.cc:132
vector< string > args
Definition: shared.cc:1558
ThreadPool * pool
Definition: shared.cc:1551
virtual bool ready()
Definition: shared.cc:2094
Scheduler * scheduler
Definition: shared.cc:1635
void lock()
Definition: thread.h:46
void unlock()
Definition: thread.h:57
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
int Typ()
Definition: subexpr.cc:1019
void * Data()
Definition: subexpr.cc:1162
leftv next
Definition: subexpr.h:86
void CleanUp(ring r=currRing)
Definition: subexpr.cc:348
#define error(a)
Definition: mpr_numeric.cc:966
static void appendArgCopy(vector< leftv > &argv, leftv arg)
Definition: shared.cc:742
static void appendArg(vector< leftv > &argv, string &s)
Definition: shared.cc:728
static BOOLEAN executeProc(sleftv &result, const char *procname, const vector< leftv > &argv)
Definition: shared.cc:749
@ INT_CMD
Definition: tok.h:96
#define NONE
Definition: tok.h:221

◆ execute()

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

Implements LibThread::Job.

Definition at line 2127 of file shared.cc.

2127 {
2128 // do nothing
2129 }

◆ ready()

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

Reimplemented from LibThread::Job.

Definition at line 2094 of file shared.cc.

2094 {
2095 if (!Trigger::ready()) return false;
2096 return success;
2097 }
virtual bool ready()
Definition: shared.cc:1605

Field Documentation

◆ procname

string LibThread::ProcTrigger::procname
private

Definition at line 2089 of file shared.cc.

◆ success

bool LibThread::ProcTrigger::success
private

Definition at line 2090 of file shared.cc.


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