45{
47
49
50 try {
51
52 JParser<> zap(
"Example program to test object referencing.");
53
55
56 zap(argc, argv);
57 }
58 catch(const exception &error) {
59 FATAL(error.what() << endl);
60 }
61
63
64
65 {
67
68 object = string("aap");
69
70 object.set(string("noot"));
71 object.set("mies");
72
73 object.get<string>() += " says ";
74
75
76 object->append("\"hello world\"");
77
78 cout << object << endl;
79 }
80
81 {
82 class JTemplate_t :
83 public JTemplate<JTYPELIST<std::string, float, int>::typelist>
84 {};
85
86 JTemplate_t object;
87
88 object.get<string>() = "abc";
89 object.get<int>() = -1;
90 object.get<float>() = -0.99;
91
92
93 object.set(string("aap noot mies"));
94 object.set<true>("hello world");
95 object.set(777);
96 object.set(123.456f);
97
98
99 cout << object << endl;
100 }
101
102 {
104
105 object.
get<__A__>() =
"a";
106 object.get<__B__>() = "b";
107 object.get<__C__>() = "c";
108
109 cout << object.get<__C__>()
110 << " == "
111 << object.get<__A__, true>()
112 << endl;
113 }
114}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for managing multiple objects.
const T & get() const
Get reference to object.