Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:01:12

0001 #ifndef Fireworks_Core_FWModelId_h
0002 #define Fireworks_Core_FWModelId_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     FWModelId
0007 //
0008 /**\class FWModelId FWModelId.h Fireworks/Core/interface/FWModelId.h
0009 
0010    Description: identifies a particular model within an FWEventItem
0011 
0012    Usage:
0013     <usage>
0014 
0015  */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Fri Jan 18 12:44:26 EST 2008
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 class FWEventItem;
0025 
0026 // forward declarations
0027 
0028 class FWModelId {
0029 public:
0030   enum { kContainerIndex = -1 };
0031   FWModelId(const FWEventItem* iItem = nullptr, int iIndex = kContainerIndex) : m_item(iItem), m_index(iIndex) {}
0032   //virtual ~FWModelId();
0033 
0034   // ---------- const member functions ---------------------
0035   bool operator<(const FWModelId& iRHS) const {
0036     return m_item == iRHS.m_item ? m_index < iRHS.m_index : m_item < iRHS.m_item;
0037   }
0038 
0039   const FWEventItem* item() const { return m_item; }
0040 
0041   int index() const { return m_index; }
0042   // ---------- static member functions --------------------
0043 
0044   // ---------- member functions ---------------------------
0045   void unselect() const;
0046   void select() const;
0047   void toggleSelect() const;
0048   void setIndex(int iIndex) { m_index = iIndex; }
0049 
0050 private:
0051   //FWModelId(const FWModelId&); // stop default
0052 
0053   //const FWModelId& operator=(const FWModelId&); // stop default
0054 
0055   // ---------- member data --------------------------------
0056   const FWEventItem* m_item;
0057   int m_index;
0058 };
0059 
0060 #endif