Loading...
Searching...
No Matches
LibThread::AccTrigger Class Reference

## Public Member Functions

| AccTrigger (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
| 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)
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
ThreadPool * | pool
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 1990 of file shared.cc.

## Constructor & Destructor Documentation

## AccTrigger()

LibThread::AccTrigger::AccTrigger | ( | long | count_init | ) |

inline

Definition at line 1994 of file shared.cc.

: Trigger(), count(count_init) {
}
LibThread::AccTrigger::count
long count
Definition shared.cc:1992
LibThread::Trigger::Trigger
Trigger()
Definition shared.cc:1597

## Member Function Documentation

## accept()

virtual bool LibThread::AccTrigger::accept | ( | leftv | arg | ) |

inline virtual

Implements LibThread::Trigger.

Definition at line 2000 of file shared.cc.

{
return true;
}

## activate()

virtual void LibThread::AccTrigger::activate | ( | leftv | arg | ) |

inline virtual

Implements LibThread::Trigger.

Definition at line 2003 of file shared.cc.

{
while (arg != NULL && !ready()) {
args.push_back(LinTree::to_string(arg));
if (ready()) {
return;
}
arg = arg->next;
}
}
LibThread::AccTrigger::ready
virtual bool ready()
Definition shared.cc:1996
LibThread::Job::args
vector< string > args
Definition shared.cc:1553
sleftv::next
leftv next
Definition subexpr.h:86
LinTree::to_string
std::string to_string(leftv val)
Definition lintree.cc:843
NULL
#define NULL
Definition omList.c:12

## execute()

virtual void LibThread::AccTrigger::execute | ( |  | ) |

inline virtual

Implements LibThread::Job.

Definition at line 2012 of file shared.cc.

{
lists l = (lists) omAlloc0Bin(slists_bin);
l->Init(args.size());
for (unsigned i = 0; i < args.size(); i++) {
leftv val = LinTree::from_string(args[i]);
memcpy(&l->m[i], val, sizeof(*val));
omFreeBin(val, sleftv_bin);
}
sleftv val;
memset(&val, 0, sizeof(val));
val.rtyp = LIST_CMD;
val.data = l;
result = LinTree::to_string(&val);
// val.CleanUp();
}
l
int l
Definition cfEzgcd.cc:100
i
int i
Definition cfEzgcd.cc:132
LibThread::Job::result
string result
Definition shared.cc:1554
sleftv::rtyp
int rtyp
Definition subexpr.h:91
sleftv::data
void * data
Definition subexpr.h:88
slists::Init
INLINE_THIS void Init(int l=0)
sleftv_bin
EXTERN_VAR omBin sleftv_bin
Definition ipid.h:145
slists_bin
VAR omBin slists_bin
Definition lists.cc:23
lists
slists * lists
Definition mpr_numeric.h:146
LinTree::from_string
leftv from_string(std::string &str)
Definition lintree.cc:854
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition omAllocDecl.h:206
omFreeBin
#define omFreeBin(addr, bin)
Definition omAllocDecl.h:259
leftv
sleftv * leftv
Definition structs.h:53
LIST_CMD
@ LIST_CMD
Definition tok.h:118

## ready()

virtual bool LibThread::AccTrigger::ready | ( |  | ) |

inline virtual

Reimplemented from LibThread::Job.

Definition at line 1996 of file shared.cc.

{
if (!Trigger::ready()) return false;
return args.size() >= count;
}
LibThread::Job::ready
virtual bool ready()
Definition shared.cc:1600

## Field Documentation

## count

long LibThread::AccTrigger::count

private

Definition at line 1992 of file shared.cc.

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

- Singular/dyn_modules/systhreads/shared.cc