Jpp  17.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
JROOT::JASCIIFileWriter< T > Struct Template Reference

Auxiliary class to write object with ROOT dictionary from ASCII formatted file. More...

#include <JASCIIFileStreamer.hh>

Inheritance diagram for JROOT::JASCIIFileWriter< T >:

Public Member Functions

 JASCIIFileWriter (const JRootDictionary &dictionary=JRootDictionary::getInstance())
 Constructor. More...
 
 JASCIIFileWriter (const char *const file_name, const JRootDictionary &dictionary=JRootDictionary::getInstance())
 Constructor. More...
 
JASCIIFileWriteroperator<< (const T &object)
 Write object to this file. More...
 

Private Attributes

T object
 internal value More...
 
std::vector
< JROOT::JRootWritableClass
columns
 column count -> data member More...
 
JRootWriter writer
 

Detailed Description

template<class T>
struct JROOT::JASCIIFileWriter< T >

Auxiliary class to write object with ROOT dictionary from ASCII formatted file.

The names of in the first line are one-to-one mapped to the names of the data members of the corresponding data structure using the corresponding ROOT dictionary.

Definition at line 132 of file JASCIIFileStreamer.hh.

Constructor & Destructor Documentation

template<class T >
JROOT::JASCIIFileWriter< T >::JASCIIFileWriter ( const JRootDictionary dictionary = JRootDictionary::getInstance())
inline

Constructor.

Parameters
dictionarydictionary

Definition at line 142 of file JASCIIFileStreamer.hh.

142  :
143  writer(static_cast<std::ostream&>(*this), JLANG::JEquationParameters(), dictionary)
144  {}
Simple data structure to support I/O of equations (see class JLANG::JEquation).
template<class T >
JROOT::JASCIIFileWriter< T >::JASCIIFileWriter ( const char *const  file_name,
const JRootDictionary dictionary = JRootDictionary::getInstance() 
)
inline

Constructor.

Parameters
file_namefile name
dictionarydictionary

Definition at line 153 of file JASCIIFileStreamer.hh.

154  :
155  writer(static_cast<std::ostream&>(*this), JLANG::JEquationParameters(), dictionary)
156  {
157  this->open(file_name);
158  }
Simple data structure to support I/O of equations (see class JLANG::JEquation).
T * open(const std::string &file_name)
Open file.
Definition: JeepToolkit.hh:346

Member Function Documentation

template<class T >
JASCIIFileWriter& JROOT::JASCIIFileWriter< T >::operator<< ( const T object)
inline

Write object to this file.

Parameters
objectobject
Returns
this input stream

Definition at line 167 of file JASCIIFileStreamer.hh.

168  {
169  using namespace std;
170  using namespace JPP;
171 
172  if (columns.empty()) {
173 
174  JRootWritableClass cls(this->object);
175 
176  for (const TDataMember* p : getListOfDataMembers<T>()) {
177 
178  static_cast<ostream&>(*this) << ' ' << p->GetName();
179 
180  columns.push_back(cls.get(*p));
181  }
182 
183  static_cast<ostream&>(*this) << endl;
184  }
185 
186  this->object = object;
187 
188  writer.flags(this->flags());
189 
190  for (size_t i = 0; i != columns.size(); ++i) {
192  }
193 
194  return *this;
195  }
JRootWriter & putObject(const T &object)
Write object.
std::vector< JROOT::JRootWritableClass > columns
column count -&gt; data member
ROOT class for writing object.
Definition: JRootClass.hh:593

Member Data Documentation

template<class T >
T JROOT::JASCIIFileWriter< T >::object
private

internal value

Definition at line 198 of file JASCIIFileStreamer.hh.

template<class T >
std::vector<JROOT::JRootWritableClass> JROOT::JASCIIFileWriter< T >::columns
private

column count -> data member

Definition at line 200 of file JASCIIFileStreamer.hh.

template<class T >
JRootWriter JROOT::JASCIIFileWriter< T >::writer
private

Definition at line 202 of file JASCIIFileStreamer.hh.


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