00001 #ifndef ANALOGDELAYOBJECTMAP_H_
00002 #define ANALOGDELAYOBJECTMAP_H_
00003
00004 #include "pcsim_hash.h"
00005 #include <boost/functional/hash.hpp>
00006 #include <utility>
00007
00008 using std::pair;
00009
00010 #include "AnalogDelayObject.h"
00011 #include "hash_ext.h"
00012
00013 class AnalogDelayObjectMap
00014 {
00015 public:
00016 AnalogDelayObjectMap();
00017 virtual ~AnalogDelayObjectMap();
00018
00019 AnalogDelayObject *find(SimObject *owner, int port=0);
00020
00021 AnalogDelayObject *find(SimObject *owner, string fieldname);
00022
00023 void insert(SimObject *owner, string fieldname, AnalogDelayObject *delayObject);
00024
00025 void insert(SimObject *owner, int port, AnalogDelayObject *delayObject);
00026
00027 protected:
00028
00029 typedef hash_map< pair<SimObject *, int>, AnalogDelayObject *, PCSIM::hash<pair<SimObject *,int> > > port_maptype;
00030
00031 typedef hash_map< pair<SimObject *,string>, AnalogDelayObject *, PCSIM::hash< pair<SimObject *,string> > > field_maptype;
00032
00033 port_maptype port_map;
00034 field_maptype field_map;
00035 };
00036
00037 #endif