diff -r 76420d9f6e62 -r bb780f1beb9b servlib/bundling/BPQCacheEntry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/servlib/bundling/BPQCacheEntry.h Wed Oct 05 13:57:27 2011 +0100 @@ -0,0 +1,60 @@ +/* + * Copyright 2004-2006 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __BPQ_CACHE_ENTRY__ +#define __BPQ_CACHE_ENTRY__ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include "Bundle.h" +#include "BundleRef.h" +#include "BundleList.h" + +namespace dtn { + +class Bundle; + +class BPQCacheEntry : public oasys::Logger { +public: + BPQCacheEntry() : + Logger("BPQCacheEntry", "/dtn/bundle/bpq"), + fragments_("cache_entry") {} + + int add_response(Bundle* bundle); + int reassemble_fragments(); + + /// accessors + bool is_complete() { return is_complete_; } + BundleRef& bundle() { return bundle_; } + BundleList& fragment_list() { return fragments_; } + + + +private: + bool check_complete() const; + + bool is_complete_; ///< + BundleRef bundle_; ///< The complete bundle + BundleList fragments_; ///< List of partial fragments +}; + +} // namespace dtn + +#endif