00001 // Copyright (C) 2000, International Business Machines 00002 // Corporation and others. All Rights Reserved. 00003 #ifndef _BCP_INDEXED_PRICING_H 00004 #define _BCP_INDEXED_PRICING_H 00005 00006 #include "BCP_enum.hpp" 00007 #include "BCP_vector.hpp" 00008 00009 class BCP_buffer; 00010 00011 class BCP_indexed_pricing_list { 00012 private: 00013 inline void clean() { _del_pos.clear(); _indices.clear(); } 00014 private: 00015 BCP_pricing_status _pr_status; 00016 BCP_storage_t _storage; 00017 BCP_vec<int> _del_pos; 00018 BCP_vec<int> _indices; 00019 public: 00020 BCP_indexed_pricing_list() : 00021 _pr_status(BCP_PriceNothing), _storage(BCP_Storage_Explicit), 00022 _del_pos(), _indices() {} 00023 ~BCP_indexed_pricing_list() {} 00024 00025 // default assignment operator and copy constructors are fine 00026 00027 inline BCP_pricing_status get_status() const { return _pr_status; } 00028 inline BCP_storage_t get_storage() const{ return _storage; } 00029 inline const BCP_vec<int>& get_indices() const { return _indices; } 00030 00031 inline void empty(const BCP_storage_t storage) { 00032 clean(); 00033 _storage = storage; 00034 } 00035 00036 inline void set_status(BCP_pricing_status new_stat) { 00037 _pr_status = new_stat; } 00038 inline void set_indices(BCP_vec<int>& new_indices) { 00039 _indices.swap(new_indices); } 00040 00041 void swap(BCP_indexed_pricing_list& x); 00042 void update(const BCP_indexed_pricing_list& change); 00043 BCP_indexed_pricing_list* 00044 as_change(const BCP_indexed_pricing_list& old_list) const; 00045 00046 int pack_size() const; // *INLINE ?* 00047 void pack(BCP_buffer& buf) const; // *INLINE ?* 00048 void unpack(BCP_buffer& buf); // *INLINE ?* 00049 }; 00050 00051 #endif