#include #include #include #include "JLang/JStatic.hh" #include "JTools/JQuantile.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" namespace { using JLANG::JStatic; using JTOOLS::JQuantile; struct __A__ { static JStatic A; static JStatic B; static JStatic C; STATIC_DATA_MEMBER(double) D; STATIC_DATA_MEMBER(int) E; STATIC_DATA_MEMBER(std::string) F; STATIC_DATA_MEMBER(JQuantile) Q; }; } /** * \file * * Example program to test JLANG::JStatic class. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; int debug; try { JParser<> zap("Example program to test static data member."); zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } __A__::A = 888; __A__::B = 0; __A__::C = 100; __A__::D = -11.11; __A__::E = 1; __A__::F = "hello world"; int i = __A__::A; DEBUG(i << endl); __A__::B++; __A__::B += 2; DEBUG(__A__::B << endl); DEBUG(__A__::C << endl); DEBUG(__A__::D << endl); DEBUG(__A__::E << endl); DEBUG(__A__::F << endl); for (int i = 1; i != 10; ++i) { __A__::Q->put(i); } DEBUG(__A__::Q->getMean() << endl); { __A__ a; DEBUG(a.F << endl); } }