Jpp
15.0.3
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JLang
JAbstractClass.cc
Go to the documentation of this file.
1
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
JLang/JAbstractClass.hh
"
6
7
#include "
Jeep/JParser.hh
"
8
#include "
Jeep/JMessage.hh
"
9
10
11
namespace
{
12
13
struct
__A__ {};
14
15
struct
__C__ {
16
virtual
~__C__() {}
17
virtual
void
c
() = 0;
18
};
19
20
21
/**
22
* Print class parameters.
23
*
24
* \param out output stream
25
* \param name name of class
26
*/
27
template
<
class
T>
28
inline
void
print
(std::ostream& out,
const
char
*
name
)
29
{
30
using namespace
std;
31
using namespace
JPP;
32
33
out << setw(36) << left <<
name
;
34
out << setw(4) <<
'.'
<< setw(8) << left << JAbstractClass<T>::is_abstract;
35
out << endl;
36
}
37
}
38
39
40
/**
41
* Print class parameters.
42
*
43
* \param OUT output stream
44
* \param T class
45
*/
46
#define PRINT(OUT, T) print<T>(OUT, #T)
47
48
49
/**
50
* \file
51
*
52
* Example program to test JLANG::JAbstractClass class.
53
* \author mdejong
54
*/
55
int
main
(
int
argc,
char
**argv)
56
{
57
using namespace
std;
58
using namespace
JPP;
59
60
int
debug
;
61
62
try
{
63
64
JParser<>
zap(
"Example program to test class inspection."
);
65
66
zap[
'd'
] =
make_field
(
debug
) = 3;
67
68
zap(argc, argv);
69
}
70
catch
(
const
exception &error) {
71
FATAL
(error.what() << endl);
72
}
73
74
if
(
debug
>=
debug_t
) {
75
76
cout << setw(36) << left <<
"name"
;
77
cout << setw(12) <<
"abstract"
;
78
cout << endl;
79
80
cout << setfill(
'.'
);
81
82
PRINT
(cout,
int
);
83
PRINT
(cout, __A__);
84
PRINT
(cout, __C__);
85
}
86
87
ASSERT
(!JAbstractClass<int> ::is_abstract);
88
ASSERT
(!JAbstractClass<__A__>::is_abstract);
89
ASSERT
( JAbstractClass<__C__>::is_abstract);
90
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
JEEP::debug_t
debug
Definition:
JMessage.hh:29
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
name
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition:
JCookie.sh:42
PRINT
#define PRINT(OUT, T)
Print class parameters.
Definition:
JAbstractClass.cc:46
ASSERT
#define ASSERT(A,...)
Assert macro.
Definition:
JMessage.hh:90
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
debug
int debug
debug level
Definition:
JSirene.cc:63
print
print
Definition:
JConvertDusj.sh:44
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
c
$WORKDIR ev_configure_domsimulator txt echo process $DOM_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DOM_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
JAbstractClass.hh
Generated by
1.8.5