Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef DICTIONARY_H_
00011 #define DICTIONARY_H_
00012
00013 #include "ibrdtn/data/EID.h"
00014 #include <list>
00015 #include <sstream>
00016 #include <list>
00017
00018 using namespace std;
00019
00020 namespace dtn
00021 {
00022 namespace data
00023 {
00024 class Dictionary
00025 {
00026 public:
00030 Dictionary();
00031
00035 Dictionary(const Dictionary &d);
00036
00040 Dictionary& operator=(const Dictionary &d);
00041
00045 virtual ~Dictionary();
00046
00050 void add(const EID &eid);
00051
00055 void add(const list<EID> &eids);
00056
00060 EID get(size_t scheme, size_t ssp);
00061
00065 void clear();
00066
00070 size_t getSize() const;
00071
00075 pair<size_t, size_t> getRef(const EID &eid) const;
00076
00077 friend std::ostream &operator<<(std::ostream &stream, const dtn::data::Dictionary &obj);
00078 friend std::istream &operator>>(std::istream &stream, dtn::data::Dictionary &obj);
00079
00080 private:
00081 bool exists(const std::string) const;
00082 void add(const std::string);
00083 size_t get(const std::string) const;
00084
00085 stringstream _bytestream;
00086 };
00087 }
00088 }
00089
00090 #endif