CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Friends
DDSpecifics Class Reference

Interface to attach user specific data to nodes in the expanded-view. More...

#include <DDSpecifics.h>

Inheritance diagram for DDSpecifics:
DDBase< DDName, DDI::Specific * >

Public Member Functions

 DDSpecifics ()
 Creates a uninitialized reference-object (see DDLogicalPart documentation for details on reference objects) More...
 
 DDSpecifics (const DDName &name)
 Creates a initialized reference-object or a reference to an allready defined specifcs. More...
 
 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. More...
 
std::pair< bool, DDExpandedViewnode () const
 Calculates the geometrical history of a fully specified PartSelector. More...
 
bool nodes (DDNodes &nds) const
 Calculates all expanded-nodes which are selected by the selection-strings. More...
 
const std::vector
< DDPartSelection > & 
selection () const
 Gives a reference to the collection of part-selections. More...
 
const DDsvalues_typespecifics () const
 Reference to the user-data attached to all nodes selected by the selections-strings given through selection. More...
 
 ~DDSpecifics ()
 
- Public Member Functions inherited from DDBase< DDName, DDI::Specific * >
 DDBase ()
 
const DDNameddname () const
 
def_type isDefined () const
 
bool isValid () const
 true, if the wrapped pointer is valid More...
 
const DDNamename () const
 
 operator bool () const
 
bool operator< (const DDBase &b) const
 
bool operator== (const DDBase &b) const
 
bool operator> (const DDBase &b) const
 
const DDI::rep_traits< DDName,
DDI::Specific * >::reference 
rep () const
 
DDI::rep_traits< DDName,
DDI::Specific * >::reference 
rep ()
 
std::string toString () const
 
const DDI::rep_traits< DDName,
DDI::Specific * >::reference 
val () const
 
const DDI::rep_traits< DDName,
DDI::Specific * >::reference 
val ()
 
virtual ~DDBase ()
 

Friends

std::ostream & operator<< (std::ostream &, const DDSpecifics &)
 

Additional Inherited Members

- Public Types inherited from DDBase< DDName, DDI::Specific * >
typedef std::pair< const
DDName *, bool > 
def_type
 
typedef DDI::Specificpimpl_type
 
typedef DDI::rep_type< DDName,
pimpl_type > * 
prep_type
 
typedef DDI::Singleton
< DDI::Store< DDName,
DDI::Specific * > > 
StoreT
 
- Static Public Member Functions inherited from DDBase< DDName, DDI::Specific * >
static DDI::Store< DDName,
DDI::Specific * >::iterator 
begin ()
 
static void clear ()
 
static DDI::Store< DDName,
DDI::Specific * >::iterator 
end ()
 
static size_t size ()
 
- Protected Attributes inherited from DDBase< DDName, DDI::Specific * >
prep_type prep_
 

Detailed Description

Interface to attach user specific data to nodes in the expanded-view.

used to attach specific (user defined) data to nodes in the expanded view.

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.

Constructor & Destructor Documentation

DDSpecifics::DDSpecifics ( )

Creates a uninitialized reference-object (see DDLogicalPart documentation for details on reference objects)

Definition at line 15 of file DDSpecifics.cc.

16 { }
Definition: DDBase.h:14
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 19 of file DDSpecifics.cc.

References DDI::Singleton< I >::instance(), and DDBase< DDName, DDI::Specific * >::prep_.

20 {
21  prep_ = StoreT::instance().create(name);
22 }
Definition: DDBase.h:14
static value_type & instance()
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

Syntax of the selection std::string

bla, bla, bla

Definition at line 25 of file DDSpecifics.cc.

References DCOUT, edm::hlt::Exception, DDI::Singleton< I >::instance(), DDBase< DDName, DDI::Specific * >::prep_, DDBase< DDName, DDI::Specific * >::rep(), AlCaHLTBitMon_QueryRunRegistry::string, and findQualityFiles::v.

30 {
31  prep_ = StoreT::instance().create(name, new Specific(partSelections,svalues,doRegex));
32  typedef std::vector<std::pair<DDLogicalPart,std::pair<const DDPartSelection*, const DDsvalues_type*> > > strange_type;
33  strange_type v;
34  rep().updateLogicalPart(v);
35  strange_type::iterator it = v.begin();
36  for(; it != v.end(); ++it) {
37  if (it->first.isDefined().second) {
38  it->first.addSpecifics(it->second);
39  DCOUT('C', "add specifics to LP: partsel=" << *(it->second.first) );
40  }
41  else {
42  std::string serr("Definition of LogicalPart missing! name=");
43  serr+= it->first.ddname().fullname();
44  throw cms::Exception("DDException") << serr;
45  }
46  }
47 }
Definition: DDBase.h:14
const DDI::rep_traits< DDName, DDI::Specific * >::reference rep() const
Definition: DDBase.h:89
static value_type & instance()
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
DDSpecifics::~DDSpecifics ( )

Definition at line 50 of file DDSpecifics.cc.

50 { }

Member Function Documentation

std::pair< bool, DDExpandedView > DDSpecifics::node ( ) const

Calculates the geometrical history of a fully specified PartSelector.

node() will only work, if

  • there is only one PartSelection std::string
  • the PartSelection std::string specifies exactly one full path concatenating always direct children including their copy-number and will return (true,const DDGeoHistory&) if the std::string matches an expanded-part in the ExpandedView, else it will return (false, xxx), whereas xxx is a history which is not valid.

Definition at line 77 of file DDSpecifics.cc.

References DDBase< DDName, DDI::Specific * >::rep().

78 {
79  return rep().node();
80 }
const DDI::rep_traits< DDName, DDI::Specific * >::reference rep() const
Definition: DDBase.h:89
bool DDSpecifics::nodes ( DDNodes nds) const

Calculates all expanded-nodes which are selected by the selection-strings.

Definition at line 64 of file DDSpecifics.cc.

References DDBase< DDName, DDI::Specific * >::rep().

65 {
66  return rep().nodes(result);
67 }
const DDI::rep_traits< DDName, DDI::Specific * >::reference rep() const
Definition: DDBase.h:89
tuple result
Definition: query.py:137
const std::vector< DDPartSelection > & DDSpecifics::selection ( ) const

Gives a reference to the collection of part-selections.

Definition at line 53 of file DDSpecifics.cc.

References DDBase< DDName, DDI::Specific * >::rep().

Referenced by Vispa.Plugins.ConfigEditor.CodeTableView.CodeTableView::keyPressEvent(), Vispa.Views.AbstractView.AbstractView::restoreSelection(), DDCoreToDDXMLOutput::specpar(), and DDStreamer::specs_write().

54 {
55  return rep().selection();
56 }
const DDI::rep_traits< DDName, DDI::Specific * >::reference rep() const
Definition: DDBase.h:89
const DDsvalues_type & DDSpecifics::specifics ( void  ) const

Reference to the user-data attached to all nodes selected by the selections-strings given through selection.

Definition at line 59 of file DDSpecifics.cc.

References DDBase< DDName, DDI::Specific * >::rep().

Referenced by DDCoreToDDXMLOutput::specpar(), and DDStreamer::specs_write().

60 {
61  return rep().specifics();
62 }
const DDI::rep_traits< DDName, DDI::Specific * >::reference rep() const
Definition: DDBase.h:89

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const DDSpecifics sp 
)
friend

Definition at line 88 of file DDSpecifics.cc.

89 {
91  if (defined.first) {
92  os << *(defined.first) << " ";
93  if (defined.second) {
94  sp.rep().stream(os);
95  }
96  else {
97  os << "* specific not defined * ";
98  }
99  }
100  else {
101  os << "* specific not declared * ";
102  }
103  return os;
104 
105 }
Definition: DDBase.h:14
const DDI::rep_traits< N, C >::reference rep() const
Definition: DDBase.h:89
def_type isDefined() const
Definition: DDBase.h:115