My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
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
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 1995 of file shared.cc.

Constructor & Destructor Documentation

◆ AccTrigger()

LibThread::AccTrigger::AccTrigger ( long  count_init)
inline

Definition at line 1999 of file shared.cc.

1999 : Trigger(), count(count_init) {
2000 }

Member Function Documentation

◆ accept()

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

Implements LibThread::Trigger.

Definition at line 2005 of file shared.cc.

2005 {
2006 return true;
2007 }

◆ activate()

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

Implements LibThread::Trigger.

Definition at line 2008 of file shared.cc.

2008 {
2009 while (arg != NULL && !ready()) {
2010 args.push_back(LinTree::to_string(arg));
2011 if (ready()) {
2012 return;
2013 }
2014 arg = arg->next;
2015 }
2016 }
virtual bool ready()
Definition: shared.cc:2001
vector< string > args
Definition: shared.cc:1558
leftv next
Definition: subexpr.h:86
std::string to_string(leftv val)
Definition: lintree.cc:843
#define NULL
Definition: omList.c:12

◆ execute()

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

Implements LibThread::Job.

Definition at line 2017 of file shared.cc.

2017 {
2019 l->Init(args.size());
2020 for (unsigned i = 0; i < args.size(); i++) {
2022 memcpy(&l->m[i], val, sizeof(*val));
2023 omFreeBin(val, sleftv_bin);
2024 }
2025 sleftv val;
2026 memset(&val, 0, sizeof(val));
2027 val.rtyp = LIST_CMD;
2028 val.data = l;
2029 result = LinTree::to_string(&val);
2030 // val.CleanUp();
2031 }
int l
Definition: cfEzgcd.cc:100
int i
Definition: cfEzgcd.cc:132
string result
Definition: shared.cc:1559
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
int rtyp
Definition: subexpr.h:91
void * data
Definition: subexpr.h:88
Definition: lists.h:24
EXTERN_VAR omBin sleftv_bin
Definition: ipid.h:145
VAR omBin slists_bin
Definition: lists.cc:23
slists * lists
Definition: mpr_numeric.h:146
leftv from_string(std::string &str)
Definition: lintree.cc:854
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
@ LIST_CMD
Definition: tok.h:118

◆ ready()

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

Reimplemented from LibThread::Job.

Definition at line 2001 of file shared.cc.

2001 {
2002 if (!Trigger::ready()) return false;
2003 return args.size() >= count;
2004 }
virtual bool ready()
Definition: shared.cc:1605

Field Documentation

◆ count

long LibThread::AccTrigger::count
private

Definition at line 1997 of file shared.cc.


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