|
| ntuple (std::ostream &a_writer, char a_sep=',', char a_vec_sep=';') |
|
| ntuple (std::ostream &a_writer, std::ostream &a_out, const ntuple_booking &a_bkg, char a_sep=',', char a_vec_sep=';') |
|
virtual | ~ntuple () |
|
void | write_hippo_header () |
|
bool | write_commented_header (std::ostream &a_out) |
|
template<class T > |
column_ref< T > * | create_column_ref (const std::string &a_name, const T &a_ref) |
|
template<class T > |
column< T > * | create_column (const std::string &a_name, const T &a_def=T()) |
|
template<class T > |
std_vector_column< T > * | create_column (const std::string &a_name, const std::vector< T > &a_ref) |
|
template<class T > |
column_ref< T > * | find_column_ref (const std::string &a_name) |
|
template<class T > |
column< T > * | find_column (const std::string &a_name) |
|
bool | add_row () |
|
const std::vector< icol * > & | columns () const |
|
void | set_title (const std::string &a_value) |
|
const std::string & | title () const |
|
|
static const std::string & | s_class () |
|
Definition at line 23 of file wcsv_ntuple.
◆ ntuple() [1/3]
tools::wcsv::ntuple::ntuple |
( |
std::ostream & |
a_writer, |
|
|
char |
a_sep = ',' , |
|
|
char |
a_vec_sep = ';' |
|
) |
| |
|
inline |
◆ ntuple() [2/3]
tools::wcsv::ntuple::ntuple |
( |
std::ostream & |
a_writer, |
|
|
std::ostream & |
a_out, |
|
|
const ntuple_booking & |
a_bkg, |
|
|
char |
a_sep = ',' , |
|
|
char |
a_vec_sep = ';' |
|
) |
| |
|
inline |
Definition at line 192 of file wcsv_ntuple.
201 const std::vector<column_booking>& cols = a_bkg.columns();
202 std::vector<column_booking>::const_iterator it;
203 for(it=cols.begin();it!=cols.end();++it){
205 #define TOOLS_WCSV_NTUPLE_CREATE_COL(a__type) \
206 if((*it).cls_id()==_cid(a__type())) {\
207 a__type* user = (a__type*)(*it).user_obj();\
209 if(!create_column_ref<a__type>((*it).name(),*user)) {\
210 a_out << "tools::wcsv_ntuple::wcsv_ntuple : create_column_ref(" << (*it).name() << ") failed." << std::endl;\
211 safe_clear<icol>(m_cols);\
215 if(!create_column<a__type>((*it).name())) {\
216 a_out << "tools::wcsv_ntuple::wcsv_ntuple : create_column(" << (*it).name() << ") failed." << std::endl;\
217 safe_clear<icol>(m_cols);\
223 #define TOOLS_WCSV_NTUPLE_CREATE_VEC_COL(a__type) \
224 if((*it).cls_id()==_cid_std_vector<a__type>()) {\
225 std::vector<a__type>* vec = (std::vector<a__type>*)(*it).user_obj();\
227 if(!create_column<a__type>((*it).name(),*vec)) {\
228 a_out << "tools::wcsv_ntuple::wcsv_ntuple : create_column(" << (*it).name() << ") failed." << std::endl;\
229 safe_clear<icol>(m_cols);\
233 a_out << "tools::wcsv_ntuple :"\
234 << " for std::vector column " << sout((*it).name())\
235 << ", the user vector pointer is null."\
237 safe_clear<icol>(m_cols);\
274 #undef TOOLS_WCSV_NTUPLE_CREATE_VEC_COL
275 #undef TOOLS_WCSV_NTUPLE_CREATE_COL
278 a_out <<
"tools::wcsv::ntuple :"
279 <<
" for column " << sout((*it).name())
280 <<
", type with cid " << (*it).cls_id() <<
" not yet handled."
◆ ~ntuple()
virtual tools::wcsv::ntuple::~ntuple |
( |
| ) |
|
|
inlinevirtual |
◆ ntuple() [3/3]
tools::wcsv::ntuple::ntuple |
( |
const ntuple & |
a_from | ) |
|
|
inlineprotected |
◆ add_row()
bool tools::wcsv::ntuple::add_row |
( |
| ) |
|
|
inline |
Definition at line 379 of file wcsv_ntuple.
380 if(
m_cols.empty())
return false;
381 std::vector<icol*>::iterator it;
385 for(;it!=
m_cols.end();++it) {
◆ columns()
const std::vector<icol*>& tools::wcsv::ntuple::columns |
( |
| ) |
const |
|
inline |
◆ create_column() [1/2]
template<class T >
std_vector_column<T>* tools::wcsv::ntuple::create_column |
( |
const std::string & |
a_name, |
|
|
const std::vector< T > & |
a_ref |
|
) |
| |
|
inline |
◆ create_column() [2/2]
template<class T >
column<T>* tools::wcsv::ntuple::create_column |
( |
const std::string & |
a_name, |
|
|
const T & |
a_def = T() |
|
) |
| |
|
inline |
Definition at line 347 of file wcsv_ntuple.
348 if(find_named<icol>(
m_cols,a_name))
return 0;
349 column<T>* col =
new column<T>(
m_writer,a_name,a_def);
◆ create_column_ref()
template<class T >
column_ref<T>* tools::wcsv::ntuple::create_column_ref |
( |
const std::string & |
a_name, |
|
|
const T & |
a_ref |
|
) |
| |
|
inline |
Definition at line 338 of file wcsv_ntuple.
339 if(find_named<icol>(
m_cols,a_name))
return 0;
340 column_ref<T>* col =
new column_ref<T>(
m_writer,a_name,a_ref);
◆ find_column()
template<class T >
column<T>* tools::wcsv::ntuple::find_column |
( |
const std::string & |
a_name | ) |
|
|
inline |
Definition at line 373 of file wcsv_ntuple.
374 icol* col = find_named<icol>(
m_cols,a_name);
376 return id_cast<icol, column<T> >(*col);
◆ find_column_ref()
template<class T >
column_ref<T>* tools::wcsv::ntuple::find_column_ref |
( |
const std::string & |
a_name | ) |
|
|
inline |
Definition at line 366 of file wcsv_ntuple.
367 icol* col = find_named<icol>(
m_cols,a_name);
369 return id_cast<icol, column_ref<T> >(*col);
◆ operator=()
ntuple& tools::wcsv::ntuple::operator= |
( |
const ntuple & |
a_from | ) |
|
|
inlineprotected |
◆ s_class()
static const std::string& tools::wcsv::ntuple::s_class |
( |
| ) |
|
|
inlinestatic |
Definition at line 25 of file wcsv_ntuple.
26 static const std::string s_v(
"tools::wcsv::ntuple");
◆ set_title()
void tools::wcsv::ntuple::set_title |
( |
const std::string & |
a_value | ) |
|
|
inline |
◆ title()
const std::string& tools::wcsv::ntuple::title |
( |
| ) |
const |
|
inline |
◆ write_commented_header()
bool tools::wcsv::ntuple::write_commented_header |
( |
std::ostream & |
a_out | ) |
|
|
inline |
Definition at line 316 of file wcsv_ntuple.
320 m_writer <<
"#separator " << (
unsigned int)
m_sep << std::endl;
323 {
for(
unsigned int count=0;count<
m_cols.size();count++) {
324 icol* _col =
m_cols[count];
326 if(!
cid2s(_col->id_cls(),sid)) {
327 a_out <<
"tools::wcsv::ntuple::write_commented_header :"
328 <<
" unknown column type id " << _col->id_cls() << std::endl;
331 m_writer <<
"#column " << sid <<
" " << _col->name() << std::endl;
◆ write_hippo_header()
void tools::wcsv::ntuple::write_hippo_header |
( |
| ) |
|
|
inline |
Definition at line 306 of file wcsv_ntuple.
308 std::vector<icol*>::const_iterator it;
◆ m_cols
std::vector<icol*> tools::wcsv::ntuple::m_cols |
|
protected |
◆ m_sep
char tools::wcsv::ntuple::m_sep |
|
protected |
◆ m_title
std::string tools::wcsv::ntuple::m_title |
|
protected |
◆ m_vec_sep
char tools::wcsv::ntuple::m_vec_sep |
|
protected |
◆ m_writer
std::ostream& tools::wcsv::ntuple::m_writer |
|
protected |
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/wcsv_ntuple