00001 /* -*- mode: c++; c-basic-offset: 4; -*- */ 00002 #ifndef SENDS_SEG_POOL_MGR 00003 #define SENDS_SEG_POOL_MGR 00004 00005 #include "pool_mgr.hh" 00006 #include <vector> 00007 00008 namespace sends { 00009 00010 class buffer; 00011 class buffer_pool; 00012 00019 class seg_pool_mgr : public pool_mgr { 00020 public: 00023 using pool_mgr::select_type; 00024 00027 using pool_mgr::bufclass_type; 00028 00031 enum buffer_class_id { 00032 kSmallBuf, 00033 kLargeBuf 00034 }; 00035 00036 public: 00040 seg_pool_mgr(void); 00041 00045 ~seg_pool_mgr(void); 00046 00054 void add_pool(bufclass_type id, long nbuf, long lbuf); 00055 00061 virtual bufclass_type get_buffer_class(select_type selid) const; 00062 00068 virtual buffer* get_buffer(select_type selclass); 00069 00075 virtual buffer* get_buffer_now(select_type selclass); 00076 00077 private: 00078 typedef std::vector<buffer_pool*> class_vect; 00079 class_vect mPools; 00080 }; 00081 00082 } // namespace sends 00083 00084 #endif // !defined(SENDS_POOL_MGR)
1.5.5