Jpp
17.3.2
the software that should make you happy
|
Auxiliary class for managing multiple objects. More...
#include <JTemplate.hh>
Public Types | |
typedef JTemplate< JType_t > | template_type |
Public Member Functions | |
JTemplate () | |
Default constructor. More... | |
JTemplate (const JType_t &value) | |
Constructor. More... | |
operator const JType_t & () const | |
Type conversion. More... | |
operator JType_t & () | |
Type conversion. More... | |
const JType_t * | operator-> () const |
Smart pointer operator. More... | |
JType_t * | operator-> () |
Smart pointer operator. More... | |
template<class T , bool use_polymorphism = false> | |
const T & | get () const |
Get reference to object. More... | |
template<class T , bool use_polymorphism = false> | |
T & | get () |
Get reference to object. More... | |
template_type & | set (const JType_t &value) |
Set value. More... | |
template<bool use_polymorphism, class T > | |
template_type & | set (const T &value) |
Set value. More... | |
Protected Member Functions | |
const JType_t & | c_get (JBool< true > option) const |
Get reference to object. More... | |
JType_t & | c_get (JBool< true > option) |
Get reference to object. More... | |
template<class T > | |
template_type & | c_set (const T &value, JBool< true > option) |
Set value. More... | |
Protected Attributes | |
JType_t | object |
object More... | |
Friends | |
std::istream & | operator>> (std::istream &in, JTemplate< JType_t > &object) |
Read object from input. More... | |
std::ostream & | operator<< (std::ostream &out, const JTemplate< JType_t > &object) |
Write object to output. More... | |
Auxiliary class for managing multiple objects.
This class can be used to replace regular base classes by corresponding data members. The various operators and methods facilitate the access to these data members.
The template value use_polymorfism
in methods get
and set
applies to the given template parameter of these methods. If false
, only exact type matches are allowed. If true
, method get
will return a reference to the first data member of which the type derives from the specified class and method set
will assign the given value to the first data member for which a matching constructor exists.
Definition at line 40 of file JTemplate.hh.
typedef JTemplate<JType_t> JLANG::JTemplate< JType_t >::template_type |
Definition at line 42 of file JTemplate.hh.
|
inline |
Default constructor.
Definition at line 48 of file JTemplate.hh.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get reference to object.
Definition at line 113 of file JTemplate.hh.
|
inline |
Get reference to object.
Definition at line 125 of file JTemplate.hh.
|
inline |
Set value.
value | value |
Definition at line 137 of file JTemplate.hh.
|
inline |
Set value.
value | value |
Definition at line 150 of file JTemplate.hh.
|
inlineprotected |
Get reference to object.
option | true |
Definition at line 188 of file JTemplate.hh.
|
inlineprotected |
Get reference to object.
option | true |
Definition at line 200 of file JTemplate.hh.
|
inlineprotected |
Set value.
value | value |
option | true |
Definition at line 214 of file JTemplate.hh.
|
friend |
Read object from input.
in | input stream |
object | object |
Definition at line 163 of file JTemplate.hh.
|
friend |
Write object to output.
out | output stream |
object | object |
Definition at line 176 of file JTemplate.hh.
|
protected |
object
Definition at line 222 of file JTemplate.hh.