00001 /* 00002 * Copyright 2007 Baylor University 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef _PROPHET_BUNDLE_OFFER_H_ 00018 #define _PROPHET_BUNDLE_OFFER_H_ 00019 00020 #include "Bundle.h" 00021 #include "BundleList.h" 00022 #include "AckList.h" 00023 #include "BundleTLVEntryList.h" 00024 #include "FwdStrategy.h" 00025 #include "Decider.h" 00026 00027 #include <list> 00028 00029 namespace prophet 00030 { 00031 00037 class BundleOffer 00038 { 00039 public: 00044 BundleOffer(BundleCore* core, 00045 const BundleList& bundles, 00046 FwdStrategyComp* comp, 00047 Decider* decider); 00048 00052 ~BundleOffer(); 00053 00059 void add_bundle(const Bundle* b); 00060 00064 bool empty() const { return list_.empty(); } 00065 00069 size_t size() const { return list_.size(); } 00070 00075 const BundleOfferList& get_bundle_offer(const Dictionary& ribd, 00076 const AckList* acks); 00077 00078 protected: 00079 typedef std::list<const Bundle*> List; 00080 00081 BundleCore* const core_; 00082 List list_; 00083 BundleOfferList bolist_; 00084 FwdStrategyComp* comp_; 00085 Decider* decider_; 00086 }; // class BundleOffer 00087 00088 }; // namespace prophet 00089 00090 #endif // _PROPHET_BUNDLE_OFFER_H_