LHEF  3.0(beta)
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
LHEF::TagBase Struct Reference

This is the base class of all classes representing xml tags. More...

#include <LHEF.h>

Inheritance diagram for LHEF::TagBase:
LHEF::Clus LHEF::Cut LHEF::Generator LHEF::HEPEUP LHEF::HEPRUP LHEF::MergeInfo LHEF::PDFInfo LHEF::ProcInfo LHEF::Scales LHEF::Weight LHEF::WeightGroup LHEF::WeightInfo LHEF::XSecInfo

Public Types

typedef XMLTag::AttributeMap AttributeMap
 Convenient typedef.
 

Public Member Functions

 TagBase ()
 Default constructor does nothing.
 
 TagBase (const AttributeMap &attr, std::string conts=std::string())
 Main constructor stores the attributes and contents of a tag.
 
bool getattr (std::string n, double &v, bool erase=true)
 Find an attribute named n and set the double variable v to the corresponding value.
 
bool getattr (std::string n, bool &v, bool erase=true)
 Find an attribute named n and set the bool variable v to true if the corresponding value is "yes".
 
bool getattr (std::string n, long &v, bool erase=true)
 Find an attribute named n and set the long variable v to the corresponding value.
 
bool getattr (std::string n, int &v, bool erase=true)
 Find an attribute named n and set the long variable v to the corresponding value.
 
bool getattr (std::string n, std::string &v, bool erase=true)
 Find an attribute named n and set the string variable v to the corresponding value.
 
void printattrs (std::ostream &file) const
 print out ' name="value"' for all unparsed attributes.
 
void closetag (std::ostream &file, std::string tag) const
 Print out end of tag marker.
 

Static Public Member Functions

static std::string yes ()
 Static string token for truth values.
 

Public Attributes

XMLTag::AttributeMap attributes
 The attributes of this tag;.
 
std::string contents
 The contents of this tag.
 

Detailed Description

This is the base class of all classes representing xml tags.

Definition at line 335 of file LHEF.h.

Member Function Documentation

void LHEF::TagBase::closetag ( std::ostream &  file,
std::string  tag 
) const
inline

Print out end of tag marker.

Print contents if not empty else print simple close tag.

Definition at line 436 of file LHEF.h.

References contents.

Referenced by LHEF::Generator::print(), LHEF::XSecInfo::print(), LHEF::ProcInfo::print(), LHEF::MergeInfo::print(), LHEF::WeightInfo::print(), and LHEF::Scales::print().

bool LHEF::TagBase::getattr ( std::string  n,
double &  v,
bool  erase = true 
)
inline

Find an attribute named n and set the double variable v to the corresponding value.

Remove the correspondig attribute from the list if found and erase is true.

Returns
false if no attribute was found.

Definition at line 359 of file LHEF.h.

References attributes.

Referenced by LHEF::Clus::Clus(), LHEF::Cut::Cut(), LHEF::Generator::Generator(), LHEF::HEPEUP::HEPEUP(), LHEF::MergeInfo::MergeInfo(), LHEF::PDFInfo::PDFInfo(), LHEF::ProcInfo::ProcInfo(), LHEF::Scales::Scales(), LHEF::Weight::Weight(), LHEF::WeightGroup::WeightGroup(), LHEF::WeightInfo::WeightInfo(), and LHEF::XSecInfo::XSecInfo().

bool LHEF::TagBase::getattr ( std::string  n,
bool &  v,
bool  erase = true 
)
inline

Find an attribute named n and set the bool variable v to true if the corresponding value is "yes".

Remove the correspondig attribute from the list if found and erase is true.

Returns
false if no attribute was found.

Definition at line 373 of file LHEF.h.

References attributes.

bool LHEF::TagBase::getattr ( std::string  n,
long &  v,
bool  erase = true 
)
inline

Find an attribute named n and set the long variable v to the corresponding value.

Remove the correspondig attribute from the list if found and erase is true.

Returns
false if no attribute was found.

Definition at line 387 of file LHEF.h.

References attributes.

bool LHEF::TagBase::getattr ( std::string  n,
int &  v,
bool  erase = true 
)
inline

Find an attribute named n and set the long variable v to the corresponding value.

Remove the correspondig attribute from the list if found and erase is true.

Returns
false if no attribute was found.

Definition at line 401 of file LHEF.h.

References attributes.

bool LHEF::TagBase::getattr ( std::string  n,
std::string &  v,
bool  erase = true 
)
inline

Find an attribute named n and set the string variable v to the corresponding value.

Remove the correspondig attribute from the list if found and erase is true.

Returns
false if no attribute was found.

Definition at line 415 of file LHEF.h.

References attributes.


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