Jpp  15.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
JEEP::JPropertiesTemplateElement< T > Class Template Reference

Template class for I/O of properties element. More...

#include <JProperties.hh>

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

Public Member Functions

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

Protected Attributes

Tobject
 

Friends

class JPropertiesElement
 

Detailed Description

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

Template class for I/O of properties element.

This class implements the JPropertiesElementInterface interface.

Definition at line 110 of file JProperties.hh.

Constructor & Destructor Documentation

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

Constructor.

Parameters
valuereference of template object

Definition at line 122 of file JProperties.hh.

122  :
124  object(value)
125  {}
Interface for I/O of properties element.
Definition: JProperties.hh:66

Member Function Documentation

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

Stream input.

Parameters
ininput stream
Returns
input stream

Implements JLANG::JStreamInput.

Definition at line 134 of file JProperties.hh.

135  {
136  using namespace std;
137 
138  readObject(in, object);
139 
140  string buffer;
141 
142  in >> buffer;
143 
144  if (!buffer.empty()) {
145  THROW(JPropertiesException, "JProperties: pending data <" << buffer << (in.peek() != EOF ? "..." : "") << ">");
146  }
147 
148  return in;
149  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
std::istream & readObject(std::istream &in, T &object)
Stream input of object.
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 T>
virtual std::ostream& JEEP::JPropertiesTemplateElement< T >::write ( std::ostream &  out,
const char *  prefix,
const char  postfix 
) const
inlineoverridevirtual

Stream output.

Parameters
outoutput stream
prefixprefix
postfixpostfix
Returns
output stream

Implements JLANG::JStreamSuffixOutput.

Definition at line 160 of file JProperties.hh.

163  {
164  return writeObject(out, prefix, object, postfix);
165  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class T>
virtual std::ostream& JEEP::JPropertiesTemplateElement< T >::write ( std::ostream &  out) const
inlineoverridevirtual

Stream output.

Parameters
outoutput stream
Returns
output stream

Implements JLANG::JStreamOutput.

Definition at line 174 of file JProperties.hh.

175  {
176  return writeObject(out, object);
177  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class T>
virtual bool JEEP::JPropertiesTemplateElement< 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 186 of file JProperties.hh.

187  {
188  const JPropertiesTemplateElement<T>* p = dynamic_cast<const JPropertiesTemplateElement<T>*>(&element);
189 
190  if (p != NULL)
191  return compareObjects(object, p->object);
192  else
193  return false;
194  }
Template class for I/O of properties element.
Definition: JProperties.hh:110
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 114 of file JProperties.hh.

Member Data Documentation

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

Definition at line 198 of file JProperties.hh.


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