IBR-DTN
1.0.0
Main Page
Namespaces
Classes
Files
File List
File Members
Dictionary.h
Go to the documentation of this file.
1
/*
2
* Dictionary.h
3
*
4
* Copyright (C) 2011 IBR, TU Braunschweig
5
*
6
* Written-by: Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
7
*
8
* Licensed under the Apache License, Version 2.0 (the "License");
9
* you may not use this file except in compliance with the License.
10
* You may obtain a copy of the License at
11
*
12
* http://www.apache.org/licenses/LICENSE-2.0
13
*
14
* Unless required by applicable law or agreed to in writing, software
15
* distributed under the License is distributed on an "AS IS" BASIS,
16
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
* See the License for the specific language governing permissions and
18
* limitations under the License.
19
*
20
*/
21
22
23
24
#ifndef DICTIONARY_H_
25
#define DICTIONARY_H_
26
27
#include "
ibrdtn/data/EID.h
"
28
#include "
ibrdtn/data/Number.h
"
29
#include <list>
30
#include <sstream>
31
#include <list>
32
#include <stdint.h>
33
34
namespace
dtn
35
{
36
namespace
data
37
{
38
class
Bundle;
39
40
class
Dictionary
41
{
42
public
:
43
class
EntryNotFoundException
:
public
dtn::InvalidDataException
44
{
45
public
:
46
EntryNotFoundException
(
string
what =
"The requested dictionary entry is not available."
) throw() : dtn::
InvalidDataException
(what)
47
{
48
};
49
};
50
54
Dictionary
();
55
59
Dictionary
(
const
dtn::data::Bundle
&bundle);
60
64
Dictionary
(
const
Dictionary
&d);
65
69
Dictionary
&
operator=
(
const
Dictionary
&d);
70
74
virtual
~Dictionary
();
75
79
void
add
(
const
EID
&eid);
80
84
void
add
(
const
std::list<EID> &eids);
85
89
void
add
(
const
Bundle
&bundle);
90
94
EID
get
(
const
Number
&scheme,
const
Number
&ssp);
95
99
void
clear
();
100
104
Size
getSize
()
const
;
105
109
typedef
std::pair<Number, Number>
Reference
;
110
Reference
getRef
(
const
EID
&eid)
const
;
111
112
friend
std::ostream &
operator<<
(std::ostream &stream,
const
dtn::data::Dictionary
&obj);
113
friend
std::istream &
operator>>
(std::istream &stream,
dtn::data::Dictionary
&obj);
114
115
private
:
116
bool
exists(
const
std::string&)
const
;
117
void
add
(
const
std::string&);
118
Number
get
(
const
std::string&)
const
throw
(
EntryNotFoundException
);
119
120
std::stringstream _bytestream;
121
};
122
}
123
}
124
125
#endif
/* DICTIONARY_H_ */
dtn::data::Dictionary::~Dictionary
virtual ~Dictionary()
Definition:
Dictionary.cpp:61
dtn::data::Dictionary::EntryNotFoundException::EntryNotFoundException
EntryNotFoundException(string what="The requested dictionary entry is not available.")
Definition:
Dictionary.h:46
dtn::data::SDNV< Size >
dtn::data::Dictionary::EntryNotFoundException
Definition:
Dictionary.h:43
dtn::data::Dictionary
Definition:
Dictionary.h:40
dtn::data::Dictionary::operator=
Dictionary & operator=(const Dictionary &d)
Definition:
Dictionary.cpp:55
dtn::InvalidDataException
Definition:
Exceptions.h:38
dtn::data::Dictionary::getSize
Size getSize() const
Definition:
Dictionary.cpp:173
dtn::data::Dictionary::clear
void clear()
Definition:
Dictionary.cpp:168
dtn::data::EID
Definition:
EID.h:34
dtn::data::Dictionary::Reference
std::pair< Number, Number > Reference
Definition:
Dictionary.h:109
dtn::data::Bundle
Definition:
Bundle.h:52
Number.h
dtn::data::Dictionary::Dictionary
Dictionary()
Definition:
Dictionary.cpp:35
dtn::data::Size
size_t Size
Definition:
Number.h:34
dtn::data::Dictionary::operator>>
friend std::istream & operator>>(std::istream &stream, dtn::data::Dictionary &obj)
Definition:
Dictionary.cpp:194
dtn::data::Dictionary::operator<<
friend std::ostream & operator<<(std::ostream &stream, const dtn::data::Dictionary &obj)
Definition:
Dictionary.cpp:185
dtn::data::Dictionary::add
void add(const EID &eid)
Definition:
Dictionary.cpp:120
EID.h
dtn::data::Dictionary::getRef
Reference getRef(const EID &eid) const
Definition:
Dictionary.cpp:178
ibrdtn
ibrdtn
data
Dictionary.h
Generated on Sun Jan 4 2015 15:27:33 for IBR-DTN by
1.8.6