00001 /* Copyright 2004-2006 BBN Technologies Corporation 00002 * 00003 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 00004 * use this file except in compliance with the License. You may obtain a copy 00005 * of the License at http://www.apache.org/licenses/LICENSE-2.0 00006 * 00007 * Unless required by applicable law or agreed to in writing, software 00008 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 00009 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00010 * 00011 * See the License for the specific language governing permissions and 00012 * limitations under the License. 00013 * 00014 * 00015 * $Id$ 00016 */ 00017 00018 #ifndef _GBOFID_H_ 00019 #define _GBOFID_H_ 00020 00021 #include <oasys/debug/InlineFormatter.h> 00022 00023 #include "naming/EndpointID.h" 00024 #include "bundling/BundleTimestamp.h" 00025 00026 namespace dtn { 00027 00031 class GbofId 00032 { 00033 public: 00034 GbofId(); 00035 GbofId(EndpointID source, 00036 BundleTimestamp creation_ts, 00037 bool is_fragment, 00038 u_int32_t frag_length, 00039 u_int32_t frag_offset); 00040 ~GbofId(); 00041 00045 bool equals(const GbofId& id) const; 00046 00050 bool equals(EndpointID, 00051 BundleTimestamp, 00052 bool, 00053 u_int32_t, 00054 u_int32_t) const; 00055 00059 bool operator==(const GbofId& id) const { 00060 return equals(id); 00061 } 00062 00066 bool operator<(const GbofId& other) const; 00067 00071 std::string str() const; 00072 00073 EndpointID source_; 00074 BundleTimestamp creation_ts_; 00075 bool is_fragment_; 00076 u_int32_t frag_length_; 00077 u_int32_t frag_offset_; 00078 00079 friend class oasys::InlineFormatter<GbofId>; 00080 }; 00081 00082 } // namespace dtn 00083 00084 #endif /* _GBOFID_H_ */