IBR-DTNSuite
0.12
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_ */
ibrdtn
ibrdtn
data
Dictionary.h
Generated on Thu Mar 27 2014 09:26:21 for IBR-DTNSuite by
1.8.4