Public Member Functions | Public Attributes | List of all members
Fun Struct Reference

Public Member Functions

 Fun (int n)
 
int operator() (int x, bool dec)
 

Public Attributes

int n
 

Detailed Description

Definition at line 12 of file test_thread.cxx.

Constructor & Destructor Documentation

Fun::Fun ( int  n)
inline

Definition at line 14 of file test_thread.cxx.

14 :n(n) {}
int n
Definition: test_thread.cxx:13

Member Function Documentation

int Fun::operator() ( int  x,
bool  dec 
)
inline

Definition at line 15 of file test_thread.cxx.

15  {
16  while (x>0) {
17  int old_n = n;
18  if (dec) {
19  n = x;
20  }
21  stringstream msg;
22  msg << this << " n=" << n << " (was:" << old_n << ") x=" << x << "\n";
23  cerr << msg.str();
24  --x;
25  msleep(x);
26  }
27  return 0;
28  }
void msg(const char *fmt,...)
Definition: message.cpp:107
QTextStream & dec(QTextStream &s)
void msleep(int msec)
Definition: test_thread.cxx:5
int n
Definition: test_thread.cxx:13
list x
Definition: train.py:276

Member Data Documentation

int Fun::n

Definition at line 13 of file test_thread.cxx.


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