CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/Fireworks/Core/interface/FWModelId.h

Go to the documentation of this file.
00001 #ifndef Fireworks_Core_FWModelId_h
00002 #define Fireworks_Core_FWModelId_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Core
00006 // Class  :     FWModelId
00007 //
00016 //
00017 // Original Author:  Chris Jones
00018 //         Created:  Fri Jan 18 12:44:26 EST 2008
00019 // $Id: FWModelId.h,v 1.6 2009/01/23 21:35:41 amraktad Exp $
00020 //
00021 
00022 // system include files
00023 
00024 // user include files
00025 class FWEventItem;
00026 
00027 // forward declarations
00028 
00029 class FWModelId
00030 {
00031 
00032 public:
00033    enum { kContainerIndex=-1};
00034    FWModelId(const FWEventItem* iItem=0,
00035              int iIndex=kContainerIndex) : m_item(iItem),m_index(iIndex) {
00036    }
00037    //virtual ~FWModelId();
00038 
00039    // ---------- const member functions ---------------------
00040    bool operator<(const FWModelId& iRHS) const
00041    {
00042       return m_item == iRHS.m_item ? m_index<iRHS.m_index : m_item<iRHS.m_item;
00043    }
00044 
00045    const FWEventItem* item() const
00046    {
00047       return m_item;
00048    }
00049 
00050    int index() const
00051    {
00052       return m_index;
00053    }
00054    // ---------- static member functions --------------------
00055 
00056    // ---------- member functions ---------------------------
00057    void unselect() const ;
00058    void select() const;
00059    void toggleSelect() const;
00060    void setIndex(int iIndex) {
00061       m_index=iIndex;
00062    }
00063 private:
00064    //FWModelId(const FWModelId&); // stop default
00065 
00066    //const FWModelId& operator=(const FWModelId&); // stop default
00067 
00068    // ---------- member data --------------------------------
00069    const FWEventItem* m_item;
00070    int m_index;
00071 
00072 };
00073 
00074 
00075 #endif