CMS 3D CMS Logo

IgRepSet.h

Go to the documentation of this file.
00001 #ifndef IGUANA_FRAMEWORK_IG_REP_SET_H
00002 # define IGUANA_FRAMEWORK_IG_REP_SET_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "Iguana/Framework/interface/config.h"
00007 # include <map>
00008 
00009 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00010 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00011 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00012 
00013 class IgRepresentable;
00014 class IgRepContext;
00015 class IgRep;
00016 class IgModel;
00017 
00018 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00019 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00020 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00021 
00033 class IGUANA_FRAMEWORK_API IgRepSet
00034 {
00035 public:
00036     ~IgRepSet (void);
00037 
00038     static IgRepSet *           associate (IgRepresentable *object,
00039                                            bool create = false);
00040     static IgRep *              lookup (IgRepresentable *object,
00041                                         IgModel *model,
00042                                         bool create = false);
00043     static IgRep *              lookup (IgRepContext *context,
00044                                         IgModel *model,
00045                                         bool create = false);
00046     static void                 update (IgRepresentable *object,
00047                                         unsigned field);
00048     static void                 update (IgRepContext *context,
00049                                         unsigned field);
00050     static void                 update (IgRepresentable *object,
00051                                         IgModel *model,
00052                                         unsigned field);
00053     static void                 invalidate (IgRepresentable *object,
00054                                             unsigned field);
00055     static void                 invalidate (IgRepContext *context,
00056                                             unsigned field);
00057     static void                 invalidate (IgRepresentable *object,
00058                                             IgModel *model,
00059                                             unsigned field);
00060 
00061     IgRepresentable *           object (void) const;
00062     IgRepContext *              contexts (void) const;
00063     void                        add (IgRepContext *context);
00064     void                        remove (IgRepContext *context);
00065     IgRepContext *              lookup (IgModel *model) const;
00066 
00067 protected:
00068     IgRepSet (IgRepresentable *object);
00069 
00070 private:
00071     // FIXME: should be a hash table
00072     // FIXME: get this out of this class
00073     typedef std::map<IgRepresentable *, IgRepSet *> LookupTable;
00074     static LookupTable &        table (void);
00075 
00076     IgRepresentable             *m_object; 
00079     IgRepContext                *m_first;  
00084     // no semantics
00085     IgRepSet (const IgRepSet &);
00086     IgRepSet &operator= (const IgRepSet &);
00087 };
00088 
00089 
00090 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00091 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00092 
00094 inline IgRepresentable *
00095 IgRepSet::object (void) const
00096 { return m_object; }
00097 
00099 inline IgRepContext *
00100 IgRepSet::contexts (void) const
00101 { return m_first; }
00102 
00103 #endif // IGUANA_FRAMEWORK_IG_REP_SET_H

Generated on Tue Jun 9 17:38:27 2009 for CMSSW by  doxygen 1.5.4