CMS 3D CMS Logo

DDXMLElement Class Reference

This is a base class for processing XML elements in the DDD. More...

#include <DetectorDescription/Parser/src/DDXMLElement.h>

Inheritance diagram for DDXMLElement:

DDLAlgoPosPart DDLAlgorithm DDLDivision DDLLogicalPart DDLMap DDLMaterial DDLNumeric DDLPosPart DDLRotationAndReflection DDLRotationByAxis DDLSolid DDLSpecPar DDLString DDLVector

List of all members.

Public Member Functions

void appendText (const std::string &inText)
 append to the current (i.e. most recently added)
virtual std::vector
< DDXMLAttribute >
::const_iterator 
begin ()
virtual void clear ()
 clear this element's contents.
 DDXMLElement (const bool &clearme)
 Constructor for autoClear element.
 DDXMLElement ()
 Constructor.
virtual std::vector
< DDXMLAttribute >
::const_iterator 
end ()
virtual const std::string & get (const std::string &name, size_t aIndex=0) const
 Returns a specific value from the aIndex set of attributes.
virtual const std::string & getAttribute (const std::string &name) const
 Access to attributes by name.
virtual const DDXMLAttributegetAttributeSet (size_t aIndex=0) const
 Get a "row" of attributes, i.e. one attribute set.
virtual const DDName getDDName (const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
virtual const std::string getName (const std::string &attname, size_t aIndex=0)
 Gets the value of the name part of an attribute of the form ns:name.
virtual std::string getNameSpace (const std::string &defaultNS, const std::string &attname, size_t aIndex=0)
 Gets the namespace of an attribute of the form ns:name.
const std::string getText (size_t tindex=0) const
 retrieve the text blob.
virtual std::vector< std::string > getVectorAttribute (const std::string &name)
 Returns a set of values as a std::vector of strings, given the attribute name.
virtual bool gotText () const
 gotText()? kind of like gotMilk? Yes = text has already been encountered.
virtual bool isEmpty () const
 Have any elements of this type been encountered but not processed?
void loadAttributes (const std::string &elemName, const std::vector< std::string > &names, const std::vector< std::string > &values, const std::string &nmspace)
 Load the element attributes.
void loadText (const std::string &inText)
 Used to load both text and XML comments into this object.
std::vector< DDXMLAttribute >
::const_iterator & 
operator++ (int inc)
 Allow the elements of this type to be iterated over using ++ operator.
const std::string & parent () const
 Who's yer pa?
virtual void preProcessElement (const std::string &name, const std::string &nmspace)
 Called by loadAttributes AFTER attributes are loaded.
virtual void processElement (const std::string &name, const std::string &nmspace)
 Processing the element.
virtual size_t size () const
 Number of elements accumulated.
virtual void stream (std::ostream &os) const
 Allow for the elements to have their own streaming method, but also provide a default.
void throwError (const std::string &keyMessage) const
 format std::string for throw an error.
virtual ~DDXMLElement ()
 Destructor.

Static Public Member Functions

static std::string itostr (int i)
 WARNING: abused by other classes in this system: yet another conversion from int to std::string...

Private Member Functions

void appendAttributes (std::vector< std::string > &tv, const std::string &name)
 behind the scenes appending to pAttributes...

Private Attributes

AttrAccumType attributeAccumulator_
std::vector< DDXMLAttributeattributes_
bool autoClear_
std::vector< DDXMLAttribute >
::const_iterator 
myIter_
std::vector< std::string > text_

Friends

std::ostream & operator<< (std::ostream &os, const DDXMLElement &element)


Detailed Description

This is a base class for processing XML elements in the DDD.

DDXMLElement

Component of DDL XML Parsing

A DDXMLElement stores all the attributes and text of an XML element. It is designed to accumulate this information unless cleared. In other words, it accumulates sets of attributes, and allows the appending of text indefinitely, as opposed to, say, creating another class which is designed to hold a std::vector of single element information. This is contrary to the way that XML normally defines an element, but for DDL, this works fine.

One of the things that one needs to build in to each subclass is when an element needs to be cleared. For some, emptying the std::vectors should happen at the end (of the processElement method). For some, clearing is ONLY done by the parent. For example, SpecPar and its child PartSelector. or Polyhedra and its child ZSection. In some cases elements can be in one or more parent elements as well as on their own (Vector, Map). For these the processing currently depends on the parent so one must clear only as appropriate.

Definition at line 58 of file DDXMLElement.h.


Constructor & Destructor Documentation

DDXMLElement::DDXMLElement (  ) 

Constructor.

Definition at line 34 of file DDXMLElement.cc.

00034                            : attributes_(), text_(), autoClear_(false)
00035 { }

DDXMLElement::DDXMLElement ( const bool clearme  ) 

Constructor for autoClear element.

Definition at line 37 of file DDXMLElement.cc.

00037                                               : attributes_(), text_(), autoClear_(clearme)
00038 { }

DDXMLElement::~DDXMLElement (  )  [virtual]

Destructor.

Definition at line 40 of file DDXMLElement.cc.

00041 { }


Member Function Documentation

void DDXMLElement::appendAttributes ( std::vector< std::string > &  tv,
const std::string &  name 
) [private]

behind the scenes appending to pAttributes...

Definition at line 276 of file DDXMLElement.cc.

References attributes_, end(), and i.

Referenced by getVectorAttribute().

00278 {
00279   for (size_t i = tv.size(); i < attributes_.size(); ++i)
00280     {
00281       DDXMLAttribute::const_iterator itnv = attributes_[i].find(name);
00282       if (itnv != attributes_[i].end())
00283         tv.push_back(itnv->second);
00284       else
00285         tv.push_back("");
00286     }  
00287 }

void DDXMLElement::appendText ( const std::string &  inText  ) 

append to the current (i.e. most recently added)

Definition at line 228 of file DDXMLElement.cc.

References alivecheck_mergeAndRegister::msg, text_, and throwError().

Referenced by DDLSAX2FileHandler::characters().

00229 {
00230   static const std::string cr("\n");
00231   if (text_.size() > 0) {
00232     text_[text_.size() - 1] += cr;
00233     text_[text_.size() - 1] += inText ;
00234   } else
00235     {
00236       std::string msg = "DDXMLElement::appendText could not append to non-existent text.";
00237       throwError(msg);
00238     }
00239 }

std::vector< DDXMLAttribute >::const_iterator DDXMLElement::begin (  )  [virtual]

Definition at line 295 of file DDXMLElement.cc.

References attributes_, and myIter_.

00296 {
00297   myIter_ = attributes_.begin();
00298   return attributes_.begin();
00299 }

void DDXMLElement::clear ( void   )  [virtual]

clear this element's contents.

Definition at line 75 of file DDXMLElement.cc.

References attributeAccumulator_, attributes_, and text_.

Referenced by DDLVector::clearall(), DDLPosPart::preProcessElement(), DDLRotationSequence::preProcessElement(), DDLPolyGenerator::preProcessElement(), DDLLogicalPart::preProcessElement(), DDLShapelessSolid::preProcessElement(), DDLReflectionSolid::preProcessElement(), DDLCompositeMaterial::preProcessElement(), DDLBooleanSolid::preProcessElement(), DDLAlgorithm::preProcessElement(), DDLVector::processElement(), DDLSpecPar::processElement(), DDLRotationSequence::processElement(), DDLBooleanSolid::processElement(), DDLDivision::processElement(), DDLCompositeMaterial::processElement(), DDLRotationAndReflection::processElement(), DDLLogicalPart::processElement(), DDLString::processElement(), DDLPosPart::processElement(), DDLNumeric::processElement(), DDLRotationByAxis::processElement(), DDLAlgorithm::processElement(), DDLElementaryMaterial::processElement(), DDLAlgoPosPart::processElement(), DDLPolyGenerator::processElement(), processElement(), DDLMap::processElement(), DDLSolid::setReference(), and DDLMaterial::setReference().

00076 {
00077   text_.clear();
00078   attributes_.clear();
00079   attributeAccumulator_.clear();
00080 }

std::vector< DDXMLAttribute >::const_iterator DDXMLElement::end (  )  [virtual]

Definition at line 301 of file DDXMLElement.cc.

References attributes_, and myIter_.

Referenced by appendAttributes(), and get().

00302 {
00303   myIter_ = attributes_.end();
00304   return attributes_.end();
00305 }

const std::string & DDXMLElement::get ( const std::string &  name,
size_t  aIndex = 0 
) const [virtual]

Returns a specific value from the aIndex set of attributes.

Definition at line 156 of file DDXMLElement.cc.

References attributes_, DCOUT_V, end(), lat::endl(), it, itostr(), alivecheck_mergeAndRegister::msg, and throwError().

00157 {
00158   static const std::string sts;
00159   if (aIndex < attributes_.size())
00160     {
00161       DDXMLAttribute::const_iterator it = attributes_[aIndex].find(name);
00162       if (attributes_[aIndex].end() == it)
00163         {
00164           DCOUT_V('P', "WARNING: DDXMLElement::get did not find the requested attribute: "  << name << std::endl << *this);
00165           return sts;
00166         }
00167       else
00168         return (it->second);
00169     }
00170   std::string msg = "DDXMLElement:get failed.  It was asked for attribute " + name;
00171   msg += " in position " + itostr(int(aIndex)) + " when there are only ";
00172   msg += itostr(int(attributes_.size())) + " in the element storage.\n";
00173   throwError(msg);
00174   // meaningless...
00175   return sts;
00176 
00177 }

const std::string & DDXMLElement::getAttribute ( const std::string &  name  )  const [virtual]

Access to attributes by name.

Definition at line 83 of file DDXMLElement.cc.

References attributes_.

00084 {
00085   static const std::string ldef;
00086   if (attributes_.size())
00087     return get(name, attributes_.size() - 1);
00088   return ldef;
00089 }

const DDXMLAttribute & DDXMLElement::getAttributeSet ( size_t  aIndex = 0  )  const [virtual]

Get a "row" of attributes, i.e. one attribute set.

Definition at line 91 of file DDXMLElement.cc.

References attributes_.

Referenced by DDLBooleanSolid::dumpBooleanSolid(), DDLRotationAndReflection::isLeftHanded(), DDLRotationAndReflection::makeX(), DDLRotationAndReflection::makeY(), DDLRotationAndReflection::makeZ(), DDLVector::processElement(), DDLTrapezoid::processElement(), DDLSpecPar::processElement(), DDLRotationSequence::processElement(), DDLBooleanSolid::processElement(), DDLDivision::processElement(), DDLCone::processElement(), DDLCompositeMaterial::processElement(), DDLRotationAndReflection::processElement(), DDLLogicalPart::processElement(), DDLString::processElement(), DDLPseudoTrap::processElement(), DDLPosPart::processElement(), DDLNumeric::processElement(), DDLRotationByAxis::processElement(), DDLAlgorithm::processElement(), DDLTubs::processElement(), DDLElementaryMaterial::processElement(), DDLBox::processElement(), DDLAlgoPosPart::processElement(), DDLPolyGenerator::processElement(), DDLTorus::processElement(), DDLMap::processElement(), DDLSolid::setReference(), and DDLMaterial::setReference().

00092 {
00093   //  if (aIndex < attributes_.size())
00094   return attributes_[aIndex];  
00095 }

const DDName DDXMLElement::getDDName ( const std::string &  defaultNS,
const std::string &  attname = std::string("name"),
size_t  aIndex = 0 
) [virtual]

Definition at line 98 of file DDXMLElement.cc.

References attributes_, itostr(), alivecheck_mergeAndRegister::msg, name, and throwError().

Referenced by DDLRotationAndReflection::isLeftHanded(), DDLBooleanSolid::processElement(), DDLRotationSequence::processElement(), DDLSpecPar::processElement(), DDLTrapezoid::processElement(), DDLVector::processElement(), DDLCone::processElement(), DDLDivision::processElement(), DDLCompositeMaterial::processElement(), DDLShapelessSolid::processElement(), DDLLogicalPart::processElement(), DDLReflectionSolid::processElement(), DDLRotationAndReflection::processElement(), DDLPseudoTrap::processElement(), DDLString::processElement(), DDLNumeric::processElement(), DDLPosPart::processElement(), DDLRotationByAxis::processElement(), DDLAlgorithm::processElement(), DDLElementaryMaterial::processElement(), DDLTubs::processElement(), DDLBox::processElement(), DDLAlgoPosPart::processElement(), DDLPolyGenerator::processElement(), DDLTorus::processElement(), and DDLMap::processElement().

00099 {
00100   if (aIndex < attributes_.size()
00101       && attributes_[aIndex].find(attname) != attributes_[aIndex].end()) { 
00102     std::string ns = defaultNS;
00103     const std::string & name = attributes_[aIndex].find(attname)->second;
00104     std::string rn = name;
00105     size_t foundColon= name.find(':');
00106     if (foundColon != std::string::npos) {
00107       ns = name.substr(0,foundColon);
00108       rn = name.substr(foundColon+1);
00109 
00110     }
00111     //    std::cout << "Name: " << rn << " Namespace: " << ns << std::endl;
00112     return DDName(rn, ns);
00113   }
00114   //  std::cout << "no " << attname <<  " default namespace: " << defaultNS << " at index " << aIndex << std::endl;
00115   std::string msg = "DDXMLElement:getDDName failed.  It was asked to make ";
00116   msg += "a DDName using attribute: " + attname;
00117   msg += " in position: " + itostr(int(aIndex)) + ".  There are ";
00118   msg += itostr(int(attributes_.size())) + " entries in the element.";
00119   throwError(msg);
00120   return DDName("justToCompile", "justToCompile"); // used to make sure that 
00121   // the method will compile with some compilers that are picky.
00122 } 

const std::string DDXMLElement::getName ( const std::string &  attname,
size_t  aIndex = 0 
) [virtual]

Gets the value of the name part of an attribute of the form ns:name.

Definition at line 140 of file DDXMLElement.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and name.

00142 {
00143   std::cout << "DEPRECATED: PLEASE DO NOT USE getName ANYMORE!!" << std::endl;
00144   std::string rn;
00145   const std::string & name = get(attname, aIndex);
00146   size_t foundColon= name.find(':');
00147   if (foundColon != std::string::npos)
00148     rn = name.substr(foundColon+1);
00149   {
00150     rn = name;
00151   }
00152   return rn;
00153 }

std::string DDXMLElement::getNameSpace ( const std::string &  defaultNS,
const std::string &  attname,
size_t  aIndex = 0 
) [virtual]

Gets the namespace of an attribute of the form ns:name.

Definition at line 124 of file DDXMLElement.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and name.

00126 {
00127   std::cout << "DEPRECATED: PLEASE DO NOT USE getNameSpace ANYMORE!" << std::endl;
00128   std::string ns;
00129   const std::string & name = get(attname, aIndex);
00130   size_t foundColon= name.find(':');
00131   if (foundColon != std::string::npos)
00132     ns = name.substr(0,foundColon);
00133   else
00134     {
00135       ns = defaultNS;
00136     }
00137   return ns;
00138 }

const std::string DDXMLElement::getText ( size_t  tindex = 0  )  const

retrieve the text blob.

Definition at line 241 of file DDXMLElement.cc.

References alivecheck_mergeAndRegister::msg, text_, and throwError().

Referenced by DDLVector::processElement(), and DDLMap::processElement().

00242 {
00243   if (tindex > text_.size()) {
00244     std::string msg = "DDXMLElement::getText tindex is greater than text_.size()).";
00245     throwError(msg);
00246   }
00247   return text_[tindex];
00248 }

std::vector< std::string > DDXMLElement::getVectorAttribute ( const std::string &  name  )  [virtual]

Returns a set of values as a std::vector of strings, given the attribute name.

Definition at line 181 of file DDXMLElement.cc.

References appendAttributes(), attributeAccumulator_, attributes_, DCOUT_V, and size().

00182 {
00183 
00184   //  The idea here is that the attributeAccumulator_ is a cache of
00185   //  on-the-fly generation from the std::vector<DDXMLAttribute> and the 
00186   //  reason is simply to speed things up if it is requested more than once.
00187   std::vector<std::string> tv;
00188   AttrAccumType::const_iterator ita = attributeAccumulator_.find(name);
00189   if (ita != attributeAccumulator_.end())
00190     {
00191       tv = attributeAccumulator_[name];
00192       if (tv.size() < attributes_.size())
00193         {
00194           appendAttributes(tv, name);
00195         }
00196       DCOUT_V('P', "DDXMLElement::getAttribute found attribute named " << name << " in a map of size " << size());
00197     }
00198   else
00199     {
00200       if (attributes_.size())
00201         {
00202           appendAttributes(tv, name);
00203         }
00204       else
00205         {
00206       DCOUT_V('P', "DDXMLAttributeAccumulator::getAttribute was asked to provide a std::vector of values for an attribute named " << name << " but there was no such attribute.");
00207               //      throw DDException(msg);
00208         }
00209     } 
00210   return tv;
00211 }

bool DDXMLElement::gotText (  )  const [virtual]

gotText()? kind of like gotMilk? Yes = text has already been encountered.

Definition at line 250 of file DDXMLElement.cc.

References text_.

Referenced by DDLSAX2FileHandler::characters().

00251  {
00252    if (text_.size() != 0)
00253      return true;
00254    return false;
00255  }

bool DDXMLElement::isEmpty (  )  const [virtual]

Have any elements of this type been encountered but not processed?

Definition at line 327 of file DDXMLElement.cc.

References attributes_.

00328 {
00329   return (attributes_.size() == 0 ? true : false);
00330 }

std::string DDXMLElement::itostr ( int  i  )  [static]

WARNING: abused by other classes in this system: yet another conversion from int to std::string...

Definition at line 320 of file DDXMLElement.cc.

Referenced by DDDividedPolyconeZ::checkParametersValidity(), get(), getDDName(), DDDividedConsRho::makeDDLogicalPart(), DDDividedTrdZ::makeDDLogicalPart(), DDDividedConsZ::makeDDLogicalPart(), DDDividedPolyhedraRho::makeDDLogicalPart(), DDDividedTubsRho::makeDDLogicalPart(), DDDividedPolyhedraZ::makeDDLogicalPart(), DDDividedPolyconeRho::makeDDLogicalPart(), DDDividedPolyconeZ::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDRotation(), DDDividedConsPhi::makeDDRotation(), DDDividedTubsPhi::makeDDRotation(), and DDDividedPolyhedraPhi::makeDDRotation().

00321 {
00322   std::ostringstream ostr;
00323   ostr << in;
00324   return ostr.str();
00325 }

void DDXMLElement::loadAttributes ( const std::string &  elemName,
const std::vector< std::string > &  names,
const std::vector< std::string > &  values,
const std::string &  nmspace 
)

Load the element attributes.

The loadAttributes method loads the attributes of the element into a std::map<std::string, std::string> which is used to store Name-Value pairs. It takes as input two std::vectors of strings containing "synchronized" names and values.

In the SAX2 based calling process, this is done on a startElement event.

Definition at line 54 of file DDXMLElement.cc.

References attributes_, DCOUT_V, i, and preProcessElement().

Referenced by DDLRotationByAxis::processElement(), DDLSolid::setReference(), DDLMaterial::setReference(), and DDLSAX2FileHandler::startElement().

00058 {
00059 
00060   attributes_.resize(attributes_.size()+1);
00061   DDXMLAttribute & tAttributes =  attributes_.back();
00062   
00063   // adds attributes
00064   for (size_t i = 0; i < names.size(); ++i)
00065     {
00066       //      tAttributes[ names[i] ] = values[i];
00067       tAttributes.insert(std::make_pair(names[i], values[i]));
00068     }
00069 
00070   preProcessElement( elemName, nmspace );
00071   DCOUT_V('P', "DDXMLElement::loadAttributes completed. " << *this);
00072 }

void DDXMLElement::loadText ( const std::string &  inText  ) 

Used to load both text and XML comments into this object.

At the current time this is done simply as a way for the user of this class to accumulate text and/or comments as std::vector of strings, each one matching the std::vector of attributes. Therefore loadText starts a new text storage.

Definition at line 222 of file DDXMLElement.cc.

References text_.

Referenced by DDLSAX2FileHandler::characters(), processElement(), and DDLSAX2FileHandler::startElement().

00223 {
00224   text_.push_back(inText);
00225   //  std::cout << "just put a std::string using loadText. size is now: " << text_.size() << std::endl;
00226 }

std::vector< DDXMLAttribute >::const_iterator & DDXMLElement::operator++ ( int  inc  ) 

Allow the elements of this type to be iterated over using ++ operator.

Definition at line 307 of file DDXMLElement.cc.

References myIter_.

00308 {
00309   myIter_ = myIter_ + inc;
00310   return myIter_;
00311 }

const std::string & DDXMLElement::parent (  )  const

Who's yer pa?

Definition at line 314 of file DDXMLElement.cc.

References DDLParser::getDDLSAX2FileHandler(), DDLParser::instance(), and DDLSAX2FileHandler::parent().

Referenced by DDLVector::processElement(), DDLDivision::processElement(), DDLString::processElement(), DDLNumeric::processElement(), DDLRotationByAxis::processElement(), DDLAlgoPosPart::processElement(), DDLMap::processElement(), and DDLSolid::setReference().

00314                                             {
00315   DDLSAX2FileHandler* s2han = DDLParser::instance()->getDDLSAX2FileHandler();
00316   return s2han->parent();
00317 }

void DDXMLElement::preProcessElement ( const std::string &  name,
const std::string &  nmspace 
) [virtual]

Called by loadAttributes AFTER attributes are loaded.

The preProcessElement method can assume that the attributes are loaded and perform any code that is necessary at the start of an element.

This would allow users to call their own code to setup anything necessary for the continued processing of the child elements.

Reimplemented in DDLAlgorithm, DDLBooleanSolid, DDLCompositeMaterial, DDLDivision, DDLLogicalPart, DDLMap, DDLNumeric, DDLPolyGenerator, DDLPosPart, DDLReflectionSolid, DDLRotationByAxis, DDLRotationSequence, DDLShapelessSolid, DDLString, and DDLVector.

Definition at line 48 of file DDXMLElement.cc.

References DCOUT_V.

Referenced by loadAttributes().

00049 {
00050   DCOUT_V('P', "DDXMLElement::preProcessElementBase default, do nothing) started-completed.");
00051 }

void DDXMLElement::processElement ( const std::string &  name,
const std::string &  nmspace 
) [virtual]

Processing the element.

The processElement method completes any necessary work to process the XML element.

For example, this can be used to call the DDCore to make the geometry in memory. There is a default for this so that if not declared in the inheriting class, no processing is done.

Reimplemented in DDLAlgoPosPart, DDLAlgorithm, DDLBooleanSolid, DDLBox, DDLCompositeMaterial, DDLCone, DDLDivision, DDLElementaryMaterial, DDLLogicalPart, DDLMap, DDLNumeric, DDLPolyGenerator, DDLPosPart, DDLPseudoTrap, DDLReflectionSolid, DDLRotationAndReflection, DDLRotationByAxis, DDLRotationSequence, DDLShapelessSolid, DDLSpecPar, DDLString, DDLTorus, DDLTrapezoid, DDLTubs, and DDLVector.

Definition at line 214 of file DDXMLElement.cc.

References autoClear_, clear(), DCOUT_V, and loadText().

Referenced by DDLSAX2FileHandler::endElement().

00215 {
00216   DCOUT_V('P', "DDXMLElement::processElementBase (default, do nothing) started-completed");
00217   loadText(std::string());
00218   if ( autoClear_ ) clear(); 
00219   
00220 }

size_t DDXMLElement::size ( void   )  const [virtual]

Number of elements accumulated.

Definition at line 290 of file DDXMLElement.cc.

References attributes_.

Referenced by DDLBooleanSolid::dumpBooleanSolid(), getVectorAttribute(), DDLSpecPar::processElement(), DDLRotationSequence::processElement(), DDLBooleanSolid::processElement(), DDLCompositeMaterial::processElement(), DDLReflectionSolid::processElement(), DDLPosPart::processElement(), DDLAlgorithm::processElement(), DDLAlgoPosPart::processElement(), DDLPolyGenerator::processElement(), and DDLMaterial::setReference().

00291 {
00292   return attributes_.size();
00293 }

void DDXMLElement::stream ( std::ostream &  os  )  const [virtual]

Allow for the elements to have their own streaming method, but also provide a default.

Definition at line 263 of file DDXMLElement.cc.

References attributes_, lat::endl(), and it.

Referenced by operator<<().

00264 {
00265   os << "Output of current element attributes:" << std::endl;
00266   for (std::vector<DDXMLAttribute>::const_iterator itv = attributes_.begin();
00267        itv != attributes_.end(); ++itv)
00268     {
00269       for (DDXMLAttribute::const_iterator it = itv->begin(); 
00270            it != itv->end(); ++it)
00271         os << it->first <<  " = " << it->second << "\t";
00272       os << std::endl;
00273     }
00274 }                        

void DDXMLElement::throwError ( const std::string &  keyMessage  )  const

format std::string for throw an error.

Definition at line 332 of file DDXMLElement.cc.

References DDLParser::getCurrFileName(), DDLParser::getDDLSAX2FileHandler(), DDLParser::instance(), alivecheck_mergeAndRegister::msg, and DDLSAX2FileHandler::self().

Referenced by appendText(), DDLMap::errorOut(), DDLVector::errorOut(), get(), getDDName(), getText(), DDLDivision::makeDivider(), DDLTrapezoid::processElement(), DDLBooleanSolid::processElement(), DDLDivision::processElement(), DDLCompositeMaterial::processElement(), DDLRotationAndReflection::processElement(), DDLTubs::processElement(), DDLAlgoPosPart::processElement(), DDLPolyGenerator::processElement(), and DDLRotationByAxis::processOne().

00333 {
00334     std::string msg = keyMessage + "\n";
00335     msg += " Element " + DDLParser::instance()->getDDLSAX2FileHandler()->self() +"\n";
00336     msg += " File " + DDLParser::instance()->getCurrFileName() + ".\n";
00337     throw DDException(msg);
00338 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const DDXMLElement element 
) [friend]

Definition at line 257 of file DDXMLElement.cc.

00258 {
00259   element.stream(os);
00260   return os;
00261 }


Member Data Documentation

AttrAccumType DDXMLElement::attributeAccumulator_ [private]

Definition at line 186 of file DDXMLElement.h.

Referenced by clear(), and getVectorAttribute().

std::vector<DDXMLAttribute> DDXMLElement::attributes_ [private]

Definition at line 184 of file DDXMLElement.h.

Referenced by appendAttributes(), begin(), clear(), end(), get(), getAttribute(), getAttributeSet(), getDDName(), getVectorAttribute(), isEmpty(), loadAttributes(), size(), and stream().

bool DDXMLElement::autoClear_ [private]

Definition at line 187 of file DDXMLElement.h.

Referenced by processElement().

std::vector<DDXMLAttribute>::const_iterator DDXMLElement::myIter_ [private]

Definition at line 188 of file DDXMLElement.h.

Referenced by begin(), end(), and operator++().

std::vector<std::string> DDXMLElement::text_ [private]

Definition at line 185 of file DDXMLElement.h.

Referenced by appendText(), clear(), getText(), gotText(), and loadText().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:21 2009 for CMSSW by  doxygen 1.5.4