CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
edm::ElementID Class Reference

#include <ElementID.h>

Public Types

using key_type = unsigned int
 

Public Member Functions

 ElementID ()=default
 
 ElementID (edm::ProductID id, key_type ind)
 
ProductID id () const
 
key_type index () const
 
bool isValid () const
 
key_type key () const
 
void reset ()
 
void swap (ElementID &other)
 

Private Attributes

ProductID id_
 
key_type index_ = 0
 

Detailed Description

ElementID is a unique identifier for an element within a container. It extends the ProductID concept by adding an index to an object within a container.

It provides both index() and key() methods so that it can be used in place of Ref/Ptr in the interfaces of e.g. ValueMap or Association.

Definition at line 17 of file ElementID.h.

Member Typedef Documentation

◆ key_type

using edm::ElementID::key_type = unsigned int

Definition at line 19 of file ElementID.h.

Constructor & Destructor Documentation

◆ ElementID() [1/2]

edm::ElementID::ElementID ( )
default

◆ ElementID() [2/2]

edm::ElementID::ElementID ( edm::ProductID  id,
key_type  ind 
)
inlineexplicit

Definition at line 22 of file ElementID.h.

22 : index_(ind), id_(id) {}

Member Function Documentation

◆ id()

ProductID edm::ElementID::id ( ) const
inline

Definition at line 25 of file ElementID.h.

25 { return id_; }

References id_.

Referenced by edm::operator<(), and edm::operator==().

◆ index()

key_type edm::ElementID::index ( ) const
inline

Definition at line 26 of file ElementID.h.

26 { return index_; }

References index_.

Referenced by BeautifulSoup.PageElement::insert(), edm::operator<(), and edm::operator==().

◆ isValid()

bool edm::ElementID::isValid ( void  ) const
inline

Definition at line 24 of file ElementID.h.

24 { return id_.isValid(); }

References id_, and edm::ProductID::isValid().

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

◆ key()

key_type edm::ElementID::key ( ) const
inline

Definition at line 27 of file ElementID.h.

27 { return index_; }

References index_.

◆ reset()

void edm::ElementID::reset ( void  )
inline

Definition at line 28 of file ElementID.h.

28  {
29  index_ = 0;
30  id_.reset();
31  }

References id_, index_, and edm::ProductID::reset().

◆ swap()

void edm::ElementID::swap ( ElementID other)

Definition at line 6 of file ElementID.cc.

6  {
7  std::swap(index_, other.index_);
8  edm::swap(id_, other.id_);
9  }

References id_, index_, trackingPlots::other, edm::swap(), and std::swap().

Member Data Documentation

◆ id_

ProductID edm::ElementID::id_
private

Definition at line 37 of file ElementID.h.

Referenced by id(), isValid(), reset(), and swap().

◆ index_

key_type edm::ElementID::index_ = 0
private

Definition at line 36 of file ElementID.h.

Referenced by index(), key(), reset(), and swap().

edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
trackingPlots.other
other
Definition: trackingPlots.py:1465
edm::ElementID::id_
ProductID id_
Definition: ElementID.h:37
edm::ProductID::isValid
bool isValid() const
Definition: ProductID.h:32
edm::ElementID::index_
key_type index_
Definition: ElementID.h:36
edm::ProductID::reset
void reset()
Definition: ProductID.h:36