DDLNumeric handles Numeric Elements. More...
#include <DDLNumeric.h>
Public Member Functions | |
DDLNumeric (DDLElementRegistry *myreg) | |
void | preProcessElement (const std::string &name, const std::string &nmspace, DDCompactView &cpv) |
Called by loadAttributes AFTER attributes are loaded. | |
void | processElement (const std::string &name, const std::string &nmspace, DDCompactView &cpv) |
Processing the element. | |
~DDLNumeric (void) |
DDLNumeric handles Numeric Elements.
DDLNumeric.h - description ------------------- begin: Fri Nov 21 2003 email: case@ucdhep.ucdavis.edu
Definition at line 26 of file DDLNumeric.h.
DDLNumeric::DDLNumeric | ( | DDLElementRegistry * | myreg | ) |
Definition at line 13 of file DDLNumeric.cc.
: DDXMLElement( myreg ) {}
DDLNumeric::~DDLNumeric | ( | void | ) |
Definition at line 17 of file DDLNumeric.cc.
{}
void DDLNumeric::preProcessElement | ( | const std::string & | name, |
const std::string & | nmspace, | ||
DDCompactView & | cpv | ||
) | [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 from DDXMLElement.
Definition at line 21 of file DDLNumeric.cc.
{}
void DDLNumeric::processElement | ( | const std::string & | name, |
const std::string & | nmspace, | ||
DDCompactView & | cpv | ||
) | [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 from DDXMLElement.
Definition at line 25 of file DDLNumeric.cc.
References DDXMLElement::clear(), DCOUT_V, spr::find(), DDXMLElement::getAttributeSet(), DDXMLElement::getDDName(), DDI::Singleton< I >::instance(), DDXMLElement::parent(), and edm::second().
{ DCOUT_V( 'P', "DDLNumeric::processElement started" ); if( parent() == "ConstantsSection" || parent() == "DDDefinition" ) { DDNumeric ddnum( getDDName( nmspace ), new double( ExprEvalSingleton::instance().eval( nmspace, getAttributeSet().find( "value" )->second ))); clear(); } // else, save it, don't clear it, because some other element (parent node) will use it. DCOUT_V( 'P', "DDLNumeric::processElement completed" ); }