Skip to content

Commit

Permalink
Make sure DDConstants get filled
Browse files Browse the repository at this point in the history
Once the expression pass has finished, we force the update of the
DDConstants from the ClhepEvaluator being used.
  • Loading branch information
Dr15Jones committed Jun 15, 2018
1 parent f8dfba2 commit f94ca14
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions DetectorDescription/Parser/interface/DDLSAX2FileHandler.h
Expand Up @@ -52,15 +52,16 @@ class DDLSAX2FileHandler : public DDLSAX2Handler
void characters( const XMLCh* chars, XMLSize_t length) override;
void comment( const XMLCh* chars, XMLSize_t length ) override;

//! creates all DDConstant from the evaluator which has been already 'filled' in the first scan of the documents
void createDDConstants() const;

protected:
DDLElementRegistry& registry() { return registry_; }
private:
virtual const std::string& parent() const;
virtual const std::string& self() const;

private:
//! creates all DDConstant from the evaluator which has been already 'filled' in the first scan of the documents
void createDDConstants() const;

std::vector< std::string > namesMap_;
std::vector< size_t > names_;
Expand Down
5 changes: 4 additions & 1 deletion DetectorDescription/Parser/src/DDLParser.cc
Expand Up @@ -119,7 +119,7 @@ DDLParser::parseOneFile( const std::string& fullname )

LogDebug ("DDLParser") << "ParseOneFile() Parsing: " << fileNames_[fIndex].second << std::endl;
parseFile( fIndex );

expHandler_->createDDConstants();
// PASS 2:

SAX2Parser_->setContentHandler(fileHandler_);
Expand All @@ -141,6 +141,8 @@ DDLParser::parse( const std::vector<unsigned char>& ablob, unsigned int bsize )
char* dummy(nullptr);
MemBufInputSource mbis( &*ablob.begin(), bsize, dummy );
SAX2Parser_->parse(mbis);
expHandler_->createDDConstants();

}

int
Expand Down Expand Up @@ -202,6 +204,7 @@ DDLParser::parse( const DDLDocumentProvider& dp )
parseFile(i);
}
}
expHandler_->createDDConstants();

// PASS 2:

Expand Down
1 change: 0 additions & 1 deletion DetectorDescription/Parser/src/DDLSAX2FileHandler.cc
Expand Up @@ -19,7 +19,6 @@ DDLSAX2FileHandler::DDLSAX2FileHandler( DDCompactView & cpv, DDLElementRegistry&
void
DDLSAX2FileHandler::init()
{
createDDConstants();
namesMap_.emplace_back("*** root ***");
names_.emplace_back(namesMap_.size() - 1);
}
Expand Down

0 comments on commit f94ca14

Please sign in to comment.