CMS 3D CMS Logo

Public Member Functions

DDLString Class Reference

DDLString handles String Elements. More...

#include <DDLString.h>

Inheritance diagram for DDLString:
DDXMLElement

List of all members.

Public Member Functions

 DDLString (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.
 ~DDLString (void)

Detailed Description

DDLString handles String Elements.

Author:
Michael Case

DDLString.h - description ------------------- begin: Fri Nov 21 2003 email: case@ucdhep.ucdavis.edu

Definition at line 26 of file DDLString.h.


Constructor & Destructor Documentation

DDLString::DDLString ( DDLElementRegistry myreg)

Definition at line 12 of file DDLString.cc.

  : DDXMLElement( myreg )
{}
DDLString::~DDLString ( void  )

Definition at line 16 of file DDLString.cc.

{}

Member Function Documentation

void DDLString::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 20 of file DDLString.cc.

{}
void DDLString::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 24 of file DDLString.cc.

References DDXMLElement::clear(), DCOUT_V, spr::find(), DDXMLElement::getAttributeSet(), DDXMLElement::getDDName(), DDXMLElement::parent(), edm::second(), and AlCaHLTBitMon_QueryRunRegistry::string.

{
  DCOUT_V('P', "DDLString::processElement started");
  if (parent() == "ConstantsSection" || parent() == "DDDefinition")
  {
    // I do not like "newing" things without my control.  But this is
    // the only way I was able to get this to work.

    std::string * ts = new std::string((getAttributeSet().find("value"))->second);
    DDName ddn = getDDName(nmspace);
    DDString (ddn 
              , ts
      );

    clear();
  }

  DCOUT_V('P', "DDLString::processElement completed");
}