inlib  1.2.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
inlib::waxml::ntuple::sub_ntuple Class Reference
Inheritance diagram for inlib::waxml::ntuple::sub_ntuple:
Inheritance graph
[legend]
Collaboration diagram for inlib::waxml::ntuple::sub_ntuple:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void * cast (cid a_class) const
virtual const std::string & name () const
virtual std::string aida_type () const
 sub_ntuple (const std::string &a_name, const std::string &a_spaces)
virtual ~sub_ntuple ()
template<class T >
column< T > * create_column (const std::string &a_name, const T &a_def=T())
sub_ntuplecreate_sub_ntuple (const std::string &a_name)
const std::vector< iobj * > & columns () const
std::string booking () const
void reset ()
const std::string & value () const
bool add_row ()

Static Public Member Functions

static cid id_class ()

Protected Member Functions

 sub_ntuple (const sub_ntuple &a_from)
sub_ntupleoperator= (const sub_ntuple &)

Protected Attributes

std::string m_name
std::string m_spaces
std::vector< iobj * > m_cols
std::string m_tmp

Detailed Description

Definition at line 112 of file ntuple.


Constructor & Destructor Documentation

inlib::waxml::ntuple::sub_ntuple::sub_ntuple ( const std::string &  a_name,
const std::string &  a_spaces 
) [inline]

Definition at line 123 of file ntuple.

    :m_name(a_name),m_spaces(a_spaces){}
virtual inlib::waxml::ntuple::sub_ntuple::~sub_ntuple ( ) [inline, virtual]

Definition at line 126 of file ntuple.

{}
inlib::waxml::ntuple::sub_ntuple::sub_ntuple ( const sub_ntuple a_from) [inline, protected]

Definition at line 128 of file ntuple.

    :iobj(a_from),m_name(a_from.m_name){}

Member Function Documentation

bool inlib::waxml::ntuple::sub_ntuple::add_row ( ) [inline]

Definition at line 163 of file ntuple.

                   {
      if(m_cols.empty()) return false;
      std::ostringstream sout;
      sout << m_spaces << "<row>" << std::endl;
      std::vector<iobj*>::const_iterator it;
      for(it=m_cols.begin();it!=m_cols.end();++it) {
        if(sub_ntuple* sub = id_cast<iobj,sub_ntuple>(*(*it))) {
          sout << m_spaces << "  <entryITuple>" << std::endl;
          sout << sub->value();
          sout << m_spaces << "  </entryITuple>" << std::endl;
          sub->reset();
        } else if(leaf* lf = id_cast<iobj,leaf>(*(*it))){
          sout << m_spaces << "  <entry" 
               << " value=\"" << lf->s_value().c_str()
               << "\"/>" << std::endl;
        }
      }
      sout << m_spaces << "</row>" << std::endl;

      m_tmp += sout.str();

      return true;
    }
virtual std::string inlib::waxml::ntuple::sub_ntuple::aida_type ( ) const [inline, virtual]

Implements inlib::waxml::ntuple::iobj.

Definition at line 121 of file ntuple.

{return "ITuple";}
std::string inlib::waxml::ntuple::sub_ntuple::booking ( ) const [inline]

Definition at line 155 of file ntuple.

                              {
      std::string s;
      get_booking(m_cols,s);
      return s;
    }
virtual void* inlib::waxml::ntuple::sub_ntuple::cast ( cid  a_class) const [inline, virtual]

Implements inlib::waxml::ntuple::iobj.

Definition at line 116 of file ntuple.

                                          {
      if(void* p = cmp_cast<sub_ntuple>(this,a_class)) {return p;}
      else return 0;
    }
const std::vector<iobj*>& inlib::waxml::ntuple::sub_ntuple::columns ( ) const [inline]

Definition at line 153 of file ntuple.

{return m_cols;}
template<class T >
column<T>* inlib::waxml::ntuple::sub_ntuple::create_column ( const std::string &  a_name,
const T &  a_def = T() 
) [inline]

Definition at line 133 of file ntuple.

                                                          {
      if(find_named<iobj>(m_cols,a_name)) return 0;
      column<T>* col = new column<T>(a_name,a_def);
      if(!col) return 0;
      m_cols.push_back(col);
      return col;
    }
sub_ntuple* inlib::waxml::ntuple::sub_ntuple::create_sub_ntuple ( const std::string &  a_name) [inline]

Definition at line 142 of file ntuple.

                                                          {
      if(find_named<iobj>(m_cols,a_name)) return 0;
      std::string spaces;
      for(unsigned int i=0;i<4;i++) spaces += " ";
      sub_ntuple* col = new sub_ntuple(a_name,m_spaces+spaces);
      if(!col) return 0;
      m_cols.push_back(col);
      return col;
    }
static cid inlib::waxml::ntuple::sub_ntuple::id_class ( ) [inline, static]

Definition at line 114 of file ntuple.

{return 300;}
virtual const std::string& inlib::waxml::ntuple::sub_ntuple::name ( ) const [inline, virtual]

Implements inlib::waxml::ntuple::iobj.

Definition at line 120 of file ntuple.

{return m_name;}
sub_ntuple& inlib::waxml::ntuple::sub_ntuple::operator= ( const sub_ntuple ) [inline, protected]

Definition at line 130 of file ntuple.

{return *this;}
void inlib::waxml::ntuple::sub_ntuple::reset ( ) [inline]

Definition at line 160 of file ntuple.

{m_tmp.clear();}
const std::string& inlib::waxml::ntuple::sub_ntuple::value ( ) const [inline]

Definition at line 161 of file ntuple.

{return m_tmp;}

Member Data Documentation

Definition at line 189 of file ntuple.

Definition at line 187 of file ntuple.

Definition at line 188 of file ntuple.

std::string inlib::waxml::ntuple::sub_ntuple::m_tmp [protected]

Definition at line 190 of file ntuple.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines