Jpp  15.0.1-rc.2-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | Static Private Member Functions | List of all members
JTOOLS::JDriver< JClass_t > Class Template Reference

Auxiliary class to load and store objects. More...

#include <JDriver.hh>

Static Public Member Functions

static JClass_t * load ()
 Load object. More...
 
static JClass_t * load (std::istream &in)
 Load object. More...
 
template<class T >
static void store (std::ostream &out, const T *p)
 Store object. More...
 

Static Private Member Functions

static JClass_t * load (JLANG::JBool< false > option)
 Load object without input. More...
 
static JClass_t * load (std::istream &in, JLANG::JBool< false > option)
 Load object without input. More...
 
static JClass_t * load (std::istream &in, JLANG::JBool< true > option)
 Load object with input. More...
 
static void store (std::ostream &out, const JClass_t *p, JBool< false > option)
 Store object without output. More...
 
static void store (std::ostream &out, const JClass_t *p, JBool< true > option)
 Store object with output. More...
 

Detailed Description

template<class JClass_t>
class JTOOLS::JDriver< JClass_t >

Auxiliary class to load and store objects.

Definition at line 27 of file JDriver.hh.

Member Function Documentation

template<class JClass_t>
static JClass_t* JTOOLS::JDriver< JClass_t >::load ( JLANG::JBool< false >  option)
inlinestaticprivate

Load object without input.

Parameters
optionI/O option
Returns
pointer to newly loaded object

Definition at line 35 of file JDriver.hh.

36  {
37  return new JClass_t();
38  }
template<class JClass_t>
static JClass_t* JTOOLS::JDriver< JClass_t >::load ( std::istream &  in,
JLANG::JBool< false >  option 
)
inlinestaticprivate

Load object without input.

Parameters
ininput stream
optionI/O option
Returns
pointer to newly loaded object

Definition at line 48 of file JDriver.hh.

49  {
50  return load(option);
51  }
static JClass_t * load()
Load object.
Definition: JDriver.hh:111
template<class JClass_t>
static JClass_t* JTOOLS::JDriver< JClass_t >::load ( std::istream &  in,
JLANG::JBool< true >  option 
)
inlinestaticprivate

Load object with input.

Parameters
ininput stream
optionI/O option
Returns
pointer to newly loaded object

Definition at line 61 of file JDriver.hh.

62  {
63  JClass_t* p = load(JLANG::JBool<false>());
64 
65  in >> *p;
66 
67  if (in.fail()) {
68 
69  delete p;
70 
71  p = NULL;
72  }
73 
74  return p;
75  }
Auxiliary template class for type bool.
Definition: JBool.hh:20
static JClass_t * load()
Load object.
Definition: JDriver.hh:111
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41
template<class JClass_t>
static void JTOOLS::JDriver< JClass_t >::store ( std::ostream &  out,
const JClass_t *  p,
JBool< false >  option 
)
inlinestaticprivate

Store object without output.

This implementation doesn't do anything.

Parameters
outoutput stream
optionI/O option
ppointer to object

Definition at line 86 of file JDriver.hh.

87  {}
template<class JClass_t>
static void JTOOLS::JDriver< JClass_t >::store ( std::ostream &  out,
const JClass_t *  p,
JBool< true >  option 
)
inlinestaticprivate

Store object with output.

Parameters
outoutput stream
optionI/O option
ppointer object

Definition at line 97 of file JDriver.hh.

98  {
99  if (p != NULL) {
100  out << *p;
101  }
102  }
template<class JClass_t>
static JClass_t* JTOOLS::JDriver< JClass_t >::load ( )
inlinestatic

Load object.

Returns
pointer to newly loaded object

Definition at line 111 of file JDriver.hh.

112  {
114  }
Test availability of stream operators.
Auxiliary template class for type bool.
Definition: JBool.hh:20
static JClass_t * load()
Load object.
Definition: JDriver.hh:111
template<class JClass_t>
static JClass_t* JTOOLS::JDriver< JClass_t >::load ( std::istream &  in)
inlinestatic

Load object.

Parameters
ininput stream
Returns
pointer to newly loaded object

Definition at line 123 of file JDriver.hh.

124  {
126  }
Test availability of stream operators.
static JClass_t * load()
Load object.
Definition: JDriver.hh:111
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41
template<class JClass_t>
template<class T >
static void JTOOLS::JDriver< JClass_t >::store ( std::ostream &  out,
const T p 
)
inlinestatic

Store object.

Parameters
outoutput stream
ppointer to object

Definition at line 136 of file JDriver.hh.

137  {
138  store(out, dynamic_cast<const JClass_t*>(p), JLANG::JBool<JStreamAvailable<JClass_t>::has_ostream>());
139  }
Test availability of stream operators.
static void store(std::ostream &out, const JClass_t *p, JBool< false > option)
Store object without output.
Definition: JDriver.hh:86
Auxiliary template class for type bool.
Definition: JBool.hh:20

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