Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JLoadProperty< JLoadableObject_t, T > Class Template Reference

Data structure for object properties which require reloading whenever the property is reread. More...

#include <JLoadProperty.hh>

Inheritance diagram for JLANG::JLoadProperty< JLoadableObject_t, T >:

Public Types

typedef JLoadProperty< JLoadableObject_t, T > JLoadProperty_t
 

Public Member Functions

 JLoadProperty (JLoadableObject_t &object)
 Constructor.
 
 JLoadProperty (JLoadableObject_t &object, const T &value)
 Constructor.
 
std::istream & read (std::istream &in)
 Read property from input.
 
JLoadProperty_toperator= (const T &buffer)
 Assignment operator.
 

Private Attributes

JLoadableObject_t & object
 

Friends

std::istream & operator>> (std::istream &in, JLoadProperty &property)
 Input stream.
 
std::ostream & operator<< (std::ostream &out, const JLoadProperty &property)
 Output stream.
 

Detailed Description

template<class JLoadableObject_t, class T>
class JLANG::JLoadProperty< JLoadableObject_t, T >

Data structure for object properties which require reloading whenever the property is reread.

The first template parameter refers to the loadable object.
This object needs to have an implementation of the method void load()
. The second template parameter refers to the property type.

Definition at line 26 of file JLoadProperty.hh.

Member Typedef Documentation

◆ JLoadProperty_t

template<class JLoadableObject_t , class T >
JLoadProperty<JLoadableObject_t, T> JLANG::JLoadProperty< JLoadableObject_t, T >::JLoadProperty_t

Definition at line 31 of file JLoadProperty.hh.

Constructor & Destructor Documentation

◆ JLoadProperty() [1/2]

template<class JLoadableObject_t , class T >
JLANG::JLoadProperty< JLoadableObject_t, T >::JLoadProperty ( JLoadableObject_t & object)
inline

Constructor.

Parameters
objectpointer to loadable object

Definition at line 39 of file JLoadProperty.hh.

39 :
40 T (),
41 object(object)
42 {}
JLoadableObject_t & object

◆ JLoadProperty() [2/2]

template<class JLoadableObject_t , class T >
JLANG::JLoadProperty< JLoadableObject_t, T >::JLoadProperty ( JLoadableObject_t & object,
const T & value )
inline

Constructor.

Parameters
objectpointer to loadable object
valueproperty value

Definition at line 51 of file JLoadProperty.hh.

52 :
53 T (value),
54 object(object)
55 {}

Member Function Documentation

◆ read()

template<class JLoadableObject_t , class T >
std::istream & JLANG::JLoadProperty< JLoadableObject_t, T >::read ( std::istream & in)
inline

Read property from input.

Parameters
ininput stream.
Returns
input stream

Definition at line 64 of file JLoadProperty.hh.

65 {
66 in >> static_cast<T&>(*this);
67
68 object.load();
69
70 return in;
71 }

◆ operator=()

template<class JLoadableObject_t , class T >
JLoadProperty_t & JLANG::JLoadProperty< JLoadableObject_t, T >::operator= ( const T & buffer)
inline

Assignment operator.

Parameters
bufferbuffer
Returns
property

Definition at line 80 of file JLoadProperty.hh.

81 {
82 static_cast<T&>(*this) = buffer;
83
84 return *this;
85 }

Friends And Related Symbol Documentation

◆ operator>>

template<class JLoadableObject_t , class T >
std::istream & operator>> ( std::istream & in,
JLoadProperty< JLoadableObject_t, T > & property )
friend

Input stream.

Parameters
ininput stream
propertyproperty
Returns
input stream

Definition at line 95 of file JLoadProperty.hh.

96 {
97 return property.read(in);
98 }

◆ operator<<

template<class JLoadableObject_t , class T >
std::ostream & operator<< ( std::ostream & out,
const JLoadProperty< JLoadableObject_t, T > & property )
friend

Output stream.

Parameters
outoutput stream
propertyproperty
Returns
output stream

Definition at line 108 of file JLoadProperty.hh.

109 {
110 return out << static_cast<const T&>(property);
111 }

Member Data Documentation

◆ object

template<class JLoadableObject_t , class T >
JLoadableObject_t& JLANG::JLoadProperty< JLoadableObject_t, T >::object
private

Definition at line 116 of file JLoadProperty.hh.


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