Version: 8.3.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
 

Detailed Description

Definition at line 31 of file local.hxx.

Constructor & Destructor Documentation

Local::Local ( UserFun f)

Definition at line 22 of file local.cxx.

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

23 {
24  fun = &f;
25 }
Local::~Local ( void  )

Definition at line 27 of file local.cxx.

References q.

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 }

Member Function Documentation

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

Implements Distrib.

Definition at line 47 of file local.cxx.

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

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 }
void Local::put ( long  id,
std::vector< double > &  cal 
)
virtual

Implements Distrib.

Definition at line 38 of file local.cxx.

References q.

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 }

Member Data Documentation

UserFun* Local::fun
protected

Definition at line 33 of file local.hxx.

Referenced by get(), and Local().

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: