CMS 3D CMS Logo

FWModelId.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWModelId_h
2 #define Fireworks_Core_FWModelId_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWModelId
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Fri Jan 18 12:44:26 EST 2008
19 //
20 
21 // system include files
22 
23 // user include files
24 class FWEventItem;
25 
26 // forward declarations
27 
28 class FWModelId {
29 public:
30  enum { kContainerIndex = -1 };
31  FWModelId(const FWEventItem* iItem = nullptr, int iIndex = kContainerIndex) : m_item(iItem), m_index(iIndex) {}
32  //virtual ~FWModelId();
33 
34  // ---------- const member functions ---------------------
35  bool operator<(const FWModelId& iRHS) const {
36  return m_item == iRHS.m_item ? m_index < iRHS.m_index : m_item < iRHS.m_item;
37  }
38 
39  const FWEventItem* item() const { return m_item; }
40 
41  int index() const { return m_index; }
42  // ---------- static member functions --------------------
43 
44  // ---------- member functions ---------------------------
45  void unselect() const;
46  void select() const;
47  void toggleSelect() const;
48  void setIndex(int iIndex) { m_index = iIndex; }
49 
50 private:
51  //FWModelId(const FWModelId&); // stop default
52 
53  //const FWModelId& operator=(const FWModelId&); // stop default
54 
55  // ---------- member data --------------------------------
57  int m_index;
58 };
59 
60 #endif
void setIndex(int iIndex)
Definition: FWModelId.h:48
FWModelId(const FWEventItem *iItem=nullptr, int iIndex=kContainerIndex)
Definition: FWModelId.h:31
bool operator<(const FWModelId &iRHS) const
Definition: FWModelId.h:35
const FWEventItem * m_item
Definition: FWModelId.h:56
void unselect() const
Definition: FWModelId.cc:65
int index() const
Definition: FWModelId.h:41
void select() const
Definition: FWModelId.cc:70
int m_index
Definition: FWModelId.h:57
void toggleSelect() const
Definition: FWModelId.cc:76
const FWEventItem * item() const
Definition: FWModelId.h:39