Jpp 21.0.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JEEP::JPropertiesTemplateElement< const T > Class Template Reference

Template specialisation of JPropertiesTemplateElement for const data type. More...

#include <JProperties.hh>

Inheritance diagram for JEEP::JPropertiesTemplateElement< const T >:
JEEP::JPropertiesElementInterface JLANG::JStreamInput JLANG::JStreamOutput JLANG::JStreamSuffixOutput

Public Member Functions

 JPropertiesTemplateElement (const T &value)
 Constructor.
 
virtual std::istream & read (std::istream &in) override
 Stream input.
 
virtual std::ostream & write (std::ostream &out) const override
 Stream output.
 
virtual std::ostream & write (std::ostream &out, const char *prefix, const char postfix) const override
 Stream output.
 
virtual bool equals (const JPropertiesElementInterface &element) const override
 Equality between property element interfaces.
 
virtual bool is_properties () const
 Get properties type.
 

Protected Attributes

const T & object
 

Friends

class JPropertiesElement
 

Detailed Description

template<class T>
class JEEP::JPropertiesTemplateElement< const T >

Template specialisation of JPropertiesTemplateElement for const data type.

This class implements the JPropertiesElementInterface interface.

Definition at line 209 of file JProperties.hh.

Constructor & Destructor Documentation

◆ JPropertiesTemplateElement()

template<class T >
JEEP::JPropertiesTemplateElement< const T >::JPropertiesTemplateElement ( const T & value)
inline

Constructor.

Parameters
valuereference of template object

Definition at line 221 of file JProperties.hh.

221 :
222 JPropertiesElementInterface(),
223 object(value)
224 {}

Member Function Documentation

◆ read()

template<class T >
virtual std::istream & JEEP::JPropertiesTemplateElement< const T >::read ( std::istream & in)
inlineoverridevirtual

Stream input.

Parameters
ininput stream
Returns
input stream

Implements JLANG::JStreamInput.

Definition at line 233 of file JProperties.hh.

234 {
235 THROW(JPropertiesException, "JPropertiesTemplateElement<>::read() reading of const data type.");
236 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.

◆ write() [1/2]

template<class T >
virtual std::ostream & JEEP::JPropertiesTemplateElement< const T >::write ( std::ostream & out) const
inlineoverridevirtual

Stream output.

Parameters
outoutput stream
Returns
output stream

Reimplemented from JEEP::JPropertiesElementInterface.

Definition at line 245 of file JProperties.hh.

246 {
247 return writeObject(out, object);
248 }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.

◆ write() [2/2]

template<class T >
virtual std::ostream & JEEP::JPropertiesTemplateElement< const T >::write ( std::ostream & out,
const char * prefix,
const char postfix ) const
inlineoverridevirtual

Stream output.

Parameters
outoutput stream
prefixprefix
postfixpostfix
Returns
output stream

Reimplemented from JEEP::JPropertiesElementInterface.

Definition at line 259 of file JProperties.hh.

262 {
263 return writeObject(out, prefix, object, postfix);
264 }

◆ equals()

template<class T >
virtual bool JEEP::JPropertiesTemplateElement< const T >::equals ( const JPropertiesElementInterface & element) const
inlineoverridevirtual

Equality between property element interfaces.

Parameters
elementproperties element interface
Returns
true if equal; else false

Reimplemented from JEEP::JPropertiesElementInterface.

Definition at line 273 of file JProperties.hh.

274 {
275 const JPropertiesTemplateElement<const T>* p = dynamic_cast<const JPropertiesTemplateElement<const T>*>(&element);
276
277 if (p != NULL)
278 return compareObjects(object, p->object);
279 else
280 return false;
281 }
bool compareObjects(const T &first, const T &second, std::true_type)
Comparison of comparable objects.

◆ is_properties()

virtual bool JEEP::JPropertiesElementInterface::is_properties ( ) const
inlinevirtualinherited

Get properties type.

Returns
false

Reimplemented in JEEP::JPropertiesTemplateElement< JProperties >.

Definition at line 83 of file JProperties.hh.

84 {
85 return false;
86 }

Friends And Related Symbol Documentation

◆ JPropertiesElement

template<class T >
friend class JPropertiesElement
friend

Definition at line 213 of file JProperties.hh.

Member Data Documentation

◆ object

template<class T >
const T& JEEP::JPropertiesTemplateElement< const T >::object
protected

Definition at line 285 of file JProperties.hh.


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