DECAYMODE Class Reference

#include <AsciiData.hh>

Inheritance diagram for DECAYMODE:

Tagged Tagged List of all members.

Public Member Functions

 DECAYMODE ()
 DECAYMODE ()
bool initialized () const
bool initialized () const
void set_initialized ()
void set_initialized ()
void unset_initalized ()
void unset_initalized ()

Public Attributes

int size
int data [10]

Protected Member Functions

void check_start_tag (std::istream &is, const char *tag)
void check_start_tag (std::istream &is, const char *tag)
void check_end_tag (std::istream &is, const char *tag)
void check_end_tag (std::istream &is, const char *tag)

Friends

std::istreamoperator>> (std::istream &, DECAYMODE &x)
std::ostreamoperator<< (std::ostream &, const DECAYMODE &x)
std::istreamoperator>> (std::istream &, DECAYMODE &x)
std::ostreamoperator<< (std::ostream &, const DECAYMODE &x)

Detailed Description

Definition at line 32 of file AsciiData.hh.


Constructor & Destructor Documentation

DECAYMODE::DECAYMODE (  )  [inline]

Definition at line 34 of file AsciiData.hh.

00034 {};

DECAYMODE::DECAYMODE (  )  [inline]

Definition at line 34 of file AsciiData.h.

00034 {};


Member Function Documentation

void Tagged::check_end_tag ( std::istream is,
const char *  tag 
) [protected, inherited]

void Tagged::check_end_tag ( std::istream is,
const char *  tag 
) [inline, protected, inherited]

Definition at line 108 of file dmplib.hh.

References deljobs::string.

00109 {
00110     char c; 
00111     is >> c;
00112     if(c != '}') 
00113         throw AsciiNoEndChar();
00114 
00115     std::string in_tag;
00116     is >> in_tag;
00117     if(in_tag != tag) 
00118         throw AsciiWrongEndTag(tag, in_tag);
00119 }

void Tagged::check_start_tag ( std::istream is,
const char *  tag 
) [protected, inherited]

void Tagged::check_start_tag ( std::istream is,
const char *  tag 
) [inline, protected, inherited]

Definition at line 81 of file dmplib.hh.

References Tagged::set_initialized(), and deljobs::string.

00082 { 
00083     // read input, check for '{' character
00084     char c; 
00085     if(!(is >> c) || (c != '{')) {
00086         throw AsciiNoStartChar();
00087     }
00088 
00089     // compare tags
00090     std::string in_tag;
00091     is >> in_tag;
00092     if(in_tag != tag) 
00093       throw AsciiWrongStartTag(tag, in_tag);
00094 
00095     // check for empty block
00096     is >> c;
00097     if(c == '}') {
00098         is >> in_tag;
00099         if(in_tag != tag) 
00100             throw AsciiWrongEndTag(tag, in_tag);
00101     } else {
00102         is.putback(c); 
00103         set_initialized();
00104     }
00105 }

bool Tagged::initialized (  )  const [inherited]

bool Tagged::initialized (  )  const [inline, inherited]

Definition at line 63 of file dmplib.hh.

References Tagged::m_initialized.

00064 {
00065     return m_initialized;
00066 }

void Tagged::set_initialized (  )  [inherited]

void Tagged::set_initialized (  )  [inline, inherited]

Definition at line 69 of file dmplib.hh.

References Tagged::m_initialized.

Referenced by Tagged::check_start_tag(), main(), BesAsciiIO::SaveAsciiEvents(), and BesAsciiIO::SaveHitAsciiEvents().

00070 { 
00071     m_initialized = true; 
00072 }

void Tagged::unset_initalized (  )  [inherited]

void Tagged::unset_initalized (  )  [inline, inherited]

Definition at line 75 of file dmplib.hh.

References Tagged::m_initialized.

00076 { 
00077     m_initialized = false; 
00078 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream os,
const DECAYMODE x 
) [friend]

Definition at line 60 of file AsciiData.cc.

00061 {
00062   os << std::endl << "{ DECAYMODE" << std::endl;
00063   if(x.initialized()) {
00064     os << " " << x.size;
00065     for (int index=0; index<x.size; index++) {
00066       os << " " << x.data[index];
00067     }
00068   }
00069   os << std::endl << "} DECAYMODE" << std::endl;
00070   return os;
00071 }

std::ostream& operator<< ( std::ostream os,
const DECAYMODE x 
) [friend]

Definition at line 60 of file AsciiData.cc.

00061 {
00062   os << std::endl << "{ DECAYMODE" << std::endl;
00063   if(x.initialized()) {
00064     os << " " << x.size;
00065     for (int index=0; index<x.size; index++) {
00066       os << " " << x.data[index];
00067     }
00068   }
00069   os << std::endl << "} DECAYMODE" << std::endl;
00070   return os;
00071 }

std::istream& operator>> ( std::istream is,
DECAYMODE x 
) [friend]

Definition at line 48 of file AsciiData.cc.

00049 {
00050    x.check_start_tag(is,"DECAYMODE");
00051    if(!x.initialized()) return is;
00052    is >> x.size;
00053    for (int index=0; index<x.size; index++) {
00054      is >> x.data[index];
00055    }
00056    x.check_end_tag(is, "DECAYMODE");
00057    return is;
00058 }

std::istream& operator>> ( std::istream is,
DECAYMODE x 
) [friend]

Definition at line 48 of file AsciiData.cc.

00049 {
00050    x.check_start_tag(is,"DECAYMODE");
00051    if(!x.initialized()) return is;
00052    is >> x.size;
00053    for (int index=0; index<x.size; index++) {
00054      is >> x.data[index];
00055    }
00056    x.check_end_tag(is, "DECAYMODE");
00057    return is;
00058 }


Member Data Documentation

int DECAYMODE::data

Definition at line 37 of file AsciiData.hh.

Referenced by BesAsciiIO::SaveDecayMode().

int DECAYMODE::size

Definition at line 34 of file AsciiData.hh.

Referenced by BesAsciiIO::SaveDecayMode().


Generated on Tue Nov 29 23:18:14 2016 for BOSS_7.0.2 by  doxygen 1.4.7