#include <DetectorDescription/Core/interface/DDSpecifics.h>
Public Member Functions | |
DDSpecifics (const DDName &name, const selectors_type &partSelections, const DDsvalues_type &svalues, bool doRegex=true) | |
Creates a defined reference-object or replaces a already defined reference-object named name. | |
DDSpecifics (const DDName &name) | |
Creates a initialized reference-object or a reference to an allready defined specifcs. | |
DDSpecifics () | |
Creates a uninitialized reference-object (see DDLogicalPart documentation for details on reference objects). | |
std::pair< bool, DDExpandedView > | node () const |
Calculates the geometrical history of a fully specified PartSelector. | |
bool | nodes (DDNodes &nds) const |
Calculates all expanded-nodes which are selected by the selection-strings. | |
const std::vector < DDPartSelection > & | selection () const |
Gives a reference to the collection of part-selections. | |
const DDsvalues_type & | specifics () const |
Reference to the user-data attached to all nodes selected by the selections-strings given through selection. | |
~DDSpecifics () | |
Static Public Member Functions | |
static void | clear () |
Friends | |
std::ostream & | operator<< (std::ostream &, const DDSpecifics &) |
std::map<std::string,std::string>
) can be attached to single nodes or set of nodes in the detector tree (represented in DDExpandedView). Nodes where user data has to be attached are selected by a very simplified XPath similar notation.DDSpecifics are lightweighted reference-objects. For further information concerning reference-objects refere to the documentation of DDLogicalPart.
Definition at line 40 of file DDSpecifics.h.
DDSpecifics::DDSpecifics | ( | ) |
Creates a uninitialized reference-object (see DDLogicalPart documentation for details on reference objects).
Definition at line 16 of file DDSpecifics.cc.
00016 : DDBase<DDName,Specific*>() 00017 { }
DDSpecifics::DDSpecifics | ( | const DDName & | name | ) |
Creates a initialized reference-object or a reference to an allready defined specifcs.
If a DDSpecifics with name was already defined, this constructor creates a lightweighted reference-object to it. Otherwise a (default) initialized reference-object is registered named name. For further details concerning the usage of reference-objects refere to the documentation of DDLogicalPart.
Definition at line 20 of file DDSpecifics.cc.
References DDI::Singleton< I >::instance(), and DDBase< DDName, DDI::Specific * >::prep_.
00020 : DDBase<DDName,Specific*>() 00021 { 00022 prep_ = StoreT::instance().create(name); 00023 }
DDSpecifics::DDSpecifics | ( | const DDName & | name, | |
const selectors_type & | partSelections, | |||
const DDsvalues_type & | svalues, | |||
bool | doRegex = true | |||
) |
Creates a defined reference-object or replaces a already defined reference-object named name.
name
unique name partSelections
collection of selection-strings which select expanded-nodes svalues
user data attached to nodes selected by partSelections bla, bla, bla
Definition at line 26 of file DDSpecifics.cc.
References DCOUT, DDI::Singleton< I >::instance(), it, DDBase< DDName, DDI::Specific * >::prep_, DDBase< DDName, DDI::Specific * >::rep(), and v.
00030 : DDBase<DDName,Specific*>() 00031 { 00032 prep_ = StoreT::instance().create(name, new Specific(partSelections,svalues,doRegex)); 00033 typedef std::vector<std::pair<DDLogicalPart,std::pair<DDPartSelection*,DDsvalues_type*> > > strange_type; 00034 strange_type v; 00035 rep().updateLogicalPart(v); 00036 strange_type::iterator it = v.begin(); 00037 for(; it != v.end(); ++it) { 00038 if (it->first.isDefined().second) { 00039 it->first.addSpecifics(it->second); 00040 DCOUT('C', "add specifics to LP: partsel=" << *(it->second.first) ); 00041 } 00042 else { 00043 std::string serr("Definition of LogicalPart missing! name="); 00044 serr+= std::string(it->first.ddname()); 00045 throw DDException(serr); 00046 } 00047 } 00048 }
DDSpecifics::~DDSpecifics | ( | ) |
Reimplemented from DDBase< DDName, DDI::Specific * >.
Definition at line 83 of file DDSpecifics.cc.
References DDI::Singleton< I >::instance().
Referenced by DDCompactView::clear().
00084 { 00085 StoreT::instance().clear(); 00086 }
std::pair< bool, DDExpandedView > DDSpecifics::node | ( | ) | const |
Calculates the geometrical history of a fully specified PartSelector.
node() will only work, if
Definition at line 78 of file DDSpecifics.cc.
References DDBase< DDName, DDI::Specific * >::rep().
00079 { 00080 return rep().node(); 00081 }
Calculates all expanded-nodes which are selected by the selection-strings.
Definition at line 65 of file DDSpecifics.cc.
References DDBase< DDName, DDI::Specific * >::rep().
const std::vector< DDPartSelection > & DDSpecifics::selection | ( | ) | const |
Gives a reference to the collection of part-selections.
Definition at line 54 of file DDSpecifics.cc.
References DDBase< DDName, DDI::Specific * >::rep().
Referenced by DDDToPersFactory::specpar(), and DDStreamer::specs_write().
00055 { 00056 return rep().selection(); 00057 }
const DDsvalues_type & DDSpecifics::specifics | ( | ) | const |
Reference to the user-data attached to all nodes selected by the selections-strings given through selection.
Definition at line 60 of file DDSpecifics.cc.
References DDBase< DDName, DDI::Specific * >::rep().
Referenced by DDDToPersFactory::specpar(), and DDStreamer::specs_write().
00061 { 00062 return rep().specifics(); 00063 }
std::ostream& operator<< | ( | std::ostream & | os, | |
const DDSpecifics & | sp | |||
) | [friend] |
Definition at line 89 of file DDSpecifics.cc.
00090 { 00091 DDBase<DDName,DDI::Specific*>::def_type defined(sp.isDefined()); 00092 if (defined.first) { 00093 os << *(defined.first) << " "; 00094 if (defined.second) { 00095 sp.rep().stream(os); 00096 } 00097 else { 00098 os << "* specific not defined * "; 00099 } 00100 } 00101 else { 00102 os << "* specific not declared * "; 00103 } 00104 return os; 00105 00106 }