00001 // Copyright (C) 2003, International Business Machines 00002 // Corporation and others. All Rights Reserved. 00003 00004 #ifndef _BB_CUT_H 00005 #define _BB_CUT_H 00006 00007 #include "BCP_cut.hpp" 00008 #include "BCP_mempool.hpp" 00009 #include "OsiRowCut.hpp" 00010 00011 class BCP_buffer; 00012 00015 /****************************************************************************/ 00016 class BB_cut : public BCP_cut_algo, public OsiRowCut { 00017 00018 private: 00019 00020 static BCP_MemPool memPool; 00021 00022 public: 00023 00024 static inline void * operator new(size_t size) { 00025 return memPool.alloc(size); 00026 } 00027 00028 static inline void operator delete(void *p, size_t size) { 00029 memPool.free(p, size); 00030 } 00031 00033 void pack(BCP_buffer& buf) const; 00034 00037 00038 BB_cut(BCP_buffer& buf); 00039 00041 BB_cut(const OsiRowCut& cut); 00042 00044 ~BB_cut() {} 00045 }; 00046 00047 /****************************************************************************/ 00048 static inline void 00049 BB_pack_cut(const BCP_cut_algo* cut, BCP_buffer& buf) 00050 { 00051 const BB_cut* bb_cut = dynamic_cast<const BB_cut*>(cut); 00052 if (!bb_cut) 00053 throw BCP_fatal_error("BB_lp::pack_cut_algo() : unknown cut type!\n"); 00054 bb_cut->pack(buf); 00055 } 00056 00057 #endif 00058