28 friend inline std::ostream&
operator<<(std::ostream& out,
const __A__&
object) {
return out <<
object.a; }
35 JPredicate_t(
const int value) :
39 bool operator()(
const int value)
const
41 return this->value == value;
48 void print(std::ostream& out,
int debug,
const char* title, T __begin, T __end)
53 if (
debug >= debug_t) {
55 copy(__begin, __end, ostream_iterator<typename T::value_type>(out,
" "));
68int main(
int argc,
char **argv)
77 JParser<> zap(
"Auxiliary program to test object selection methods.");
83 catch(
const exception &error) {
84 FATAL(error.what() << endl);
89 buffer.push_back(__A__(3));
90 buffer.push_back(__A__(4));
91 buffer.push_back(__A__(2));
92 buffer.push_back(__A__(1));
93 buffer.push_back(__A__(5));
96 print(cout,
debug,
"data:", buffer.begin(), buffer.end());
98 JPredicate_t predicate(3);
101 vector<__A__>::const_iterator p = find_if(buffer.begin(), buffer.end(), make_find_if(&__A__::a, predicate));
103 DEBUG(
"has " << predicate.value <<
"? " << (p != buffer.end() ?
"yes" :
"no") << endl);
105 ASSERT(p != buffer.end() && p->a == predicate.value);
109 vector<__A__>::const_iterator p = find_if(buffer.begin(), buffer.end(), make_find_if(&__A__::get, predicate));
111 DEBUG(
"has " << predicate.value <<
"? " << (p != buffer.end() ?
"yes" :
"no") << endl);
113 ASSERT(p != buffer.end() && p->get() == predicate.value);
int main(int argc, char **argv)
General purpose messaging.
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void print(const TH1 &h1, std::ostream &out)
Print histogram parameters.
Utility class to parse command line options.
void copy(const Head &from, JHead &to)
Copy header from from to to.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).