Version: 9.16.0
Local Class Reference

#include <local.hxx>

Inheritance diagram for Local:
Collaboration diagram for Local:

Public Member Functions

 Local (UserFun &)
 
 ~Local (void)
 
virtual void put (long, std::vector< double > &)
 
virtual std::vector< double > * get (long *)
 

Protected Attributes

UserFunfun
 
std::queue< std::pair< long, std::vector< double > * > > q
 

Additional Inherited Members

virtual void put (long, std::vector< double > &)=0
 
virtual std::vector< double > * get (long *)=0
 

Detailed Description

Definition at line 31 of file local.hxx.

Constructor & Destructor Documentation

◆ Local()

Local::Local ( UserFun f)

Definition at line 22 of file local.cxx.

23{
24 fun = &f;
25}
UserFun * fun
Definition: local.hxx:33

References gui.CONNECTOR::f(), and fun.

◆ ~Local()

Local::~Local ( void  )

Definition at line 27 of file local.cxx.

28{
29 std::pair<long,std::vector<double> *> pa;
30
31 while (! q.empty()) {
32 pa = q.front();
33 q.pop();
34 delete pa.second;
35 }
36}
std::queue< std::pair< long, std::vector< double > * > > q
Definition: local.hxx:34

References q.

Member Function Documentation

◆ get()

std::vector< double > * Local::get ( long *  id)
virtual

Implements Distrib.

Definition at line 47 of file local.cxx.

48{
49 std::vector<double> *cal, *res;
50 std::pair<long,std::vector<double> *> pa;
51
52 pa = q.front(); q.pop();
53 *id = pa.first; cal = pa.second;
54 res = fun->eval(*cal);
55 delete cal;
56 return res;
57}
virtual std::vector< double > * eval(std::vector< double > &)=0

References UserFun::eval(), fun, and q.

◆ put()

void Local::put ( long  id,
std::vector< double > &  cal 
)
virtual

Implements Distrib.

Definition at line 38 of file local.cxx.

39{
40 std::pair<long, std::vector<double> *> *tmp;
41
42 tmp = new std::pair<long, std::vector<double> *>(id, &cal);
43 q.push(*tmp);
44 delete tmp;
45}

References q.

Member Data Documentation

◆ fun

UserFun* Local::fun
protected

Definition at line 33 of file local.hxx.

Referenced by get(), and Local().

◆ q

std::queue<std::pair<long, std::vector<double> *> > Local::q
protected

Definition at line 34 of file local.hxx.

Referenced by get(), put(), and ~Local().


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