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

Public Member Functions

 KernelJob (void(*func)(leftv result, leftv arg))
 
virtual void execute ()
 
- 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

void(* cfunc )(leftv result, leftv arg)
 

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

Constructor & Destructor Documentation

◆ KernelJob()

LibThread::KernelJob::KernelJob ( void(*)(leftv result, leftv arg)  func)
inline

Definition at line 2409 of file shared.cc.

2409: cfunc(func) { }
void(* cfunc)(leftv result, leftv arg)
Definition: shared.cc:2407

Member Function Documentation

◆ execute()

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

Implements LibThread::Job.

Definition at line 2410 of file shared.cc.

2410 {
2411 vector<leftv> argv;
2412 for (unsigned i = 0; i <args.size(); i++) {
2413 appendArg(argv, args[i]);
2414 }
2415 for (unsigned i = 0; i < deps.size(); i++) {
2416 appendArg(argv, deps[i]->result);
2417 }
2418 sleftv val;
2419 memset(&val, 0, sizeof(val));
2420 if (argv.size() > 0) {
2421 leftv *tail = &argv[0]->next;
2422 for (unsigned i = 1; i < argv.size(); i++) {
2423 *tail = argv[i];
2424 tail = &(*tail)->next;
2425 }
2426 *tail = NULL;
2427 }
2428 cfunc(&val, argv[0]);
2429 result = (LinTree::to_string(&val));
2430 val.CleanUp();
2431 }
int i
Definition: cfEzgcd.cc:132
vector< string > args
Definition: shared.cc:1558
vector< Job * > deps
Definition: shared.cc:1555
string result
Definition: shared.cc:1559
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
leftv next
Definition: subexpr.h:86
void CleanUp(ring r=currRing)
Definition: subexpr.cc:348
static void appendArg(vector< leftv > &argv, string &s)
Definition: shared.cc:728
std::string to_string(leftv val)
Definition: lintree.cc:843
#define NULL
Definition: omList.c:12

Field Documentation

◆ cfunc

void(* LibThread::KernelJob::cfunc) (leftv result, leftv arg)
private

Definition at line 2407 of file shared.cc.


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