Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
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. More...
 
virtual std::istream & read (std::istream &in)
 Stream input. More...
 
virtual std::ostream & write (std::ostream &out) const
 Stream output. More...
 
virtual std::ostream & write (std::ostream &out, const char *prefix, const char postfix) const
 Stream output. More...
 
virtual bool equals (const JPropertiesElementInterface &element) const
 Equality between property element interfaces. More...
 
virtual bool is_properties () const
 Get properties type. More...
 

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 196 of file JProperties.hh.

Constructor & Destructor Documentation

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

Constructor.

Parameters
valuereference of template object

Definition at line 208 of file JProperties.hh.

208  :
210  object(value)
211  {}
Interface for I/O of properties element.
Definition: JProperties.hh:66

Member Function Documentation

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

Stream input.

Parameters
ininput stream
Returns
input stream

Implements JLANG::JStreamInput.

Definition at line 220 of file JProperties.hh.

221  {
222  THROW(JPropertiesException, "JPropertiesTemplateElement<>::read() reading of const data type.");
223  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:633
template<class T >
virtual std::ostream& JEEP::JPropertiesTemplateElement< const T >::write ( std::ostream &  out) const
inlinevirtual

Stream output.

Parameters
outoutput stream
Returns
output stream

Implements JLANG::JStreamOutput.

Definition at line 232 of file JProperties.hh.

233  {
234  return writeObject(out, object);
235  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class T >
virtual std::ostream& JEEP::JPropertiesTemplateElement< const T >::write ( std::ostream &  out,
const char *  prefix,
const char  postfix 
) const
inlinevirtual

Stream output.

Parameters
outoutput stream
prefixprefix
postfixpostfix
Returns
output stream

Implements JLANG::JStreamSuffixOutput.

Definition at line 246 of file JProperties.hh.

249  {
250  return writeObject(out, prefix, object, postfix);
251  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class T >
virtual bool JEEP::JPropertiesTemplateElement< const T >::equals ( const JPropertiesElementInterface element) const
inlinevirtual

Equality between property element interfaces.

Parameters
elementproperties element interface
Returns
true if equal; else false

Reimplemented from JEEP::JPropertiesElementInterface.

Definition at line 260 of file JProperties.hh.

261  {
262  const JPropertiesTemplateElement<const T>* p = dynamic_cast<const JPropertiesTemplateElement<const T>*>(&element);
263 
264  if (p != NULL)
265  return compareObjects(object, p->object);
266  else
267  return false;
268  }
Template specialisation of JPropertiesTemplateElement for const data type.
Definition: JProperties.hh:196
bool compareObjects(const T &first, const T &second, JBool< true >)
Comparison of comparable objects.
virtual bool JEEP::JPropertiesElementInterface::is_properties ( ) const
inlinevirtualinherited

Get properties type.

Returns
false

Reimplemented in JEEP::JPropertiesTemplateElement< JProperties >.

Definition at line 82 of file JProperties.hh.

83  {
84  return false;
85  }

Friends And Related Function Documentation

template<class T >
friend class JPropertiesElement
friend

Definition at line 200 of file JProperties.hh.

Member Data Documentation

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

Definition at line 272 of file JProperties.hh.


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