NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
nfd-face-traits.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_MANAGEMENT_NFD_FACE_TRAITS_HPP
23
#define NDN_MANAGEMENT_NFD_FACE_TRAITS_HPP
24
25
#include "../encoding/tlv-nfd.hpp"
26
27
namespace
ndn
{
28
namespace
nfd
{
29
35
template
<
class
C>
36
class
FaceTraits
37
{
38
public
:
39
class
Error
:
public
tlv::Error
40
{
41
public
:
42
explicit
43
Error
(
const
std::string& what)
44
: tlv::
Error
(what)
45
{
46
}
47
};
48
49
FaceTraits
()
50
:
m_faceId
(0)
51
,
m_faceScope
(
FACE_SCOPE_NON_LOCAL
)
52
,
m_facePersistency
(
FACE_PERSISTENCY_PERSISTENT
)
53
,
m_linkType
(
LINK_TYPE_POINT_TO_POINT
)
54
{
55
}
56
57
uint64_t
58
getFaceId
()
const
59
{
60
return
m_faceId
;
61
}
62
63
C&
64
setFaceId
(uint64_t faceId)
65
{
66
wireReset
();
67
m_faceId
= faceId;
68
return
static_cast<
C&
>
(*this);
69
}
70
71
const
std::string&
72
getRemoteUri
()
const
73
{
74
return
m_remoteUri
;
75
}
76
77
C&
78
setRemoteUri
(
const
std::string& remoteUri)
79
{
80
wireReset
();
81
m_remoteUri
= remoteUri;
82
return
static_cast<
C&
>
(*this);
83
}
84
85
const
std::string&
86
getLocalUri
()
const
87
{
88
return
m_localUri
;
89
}
90
91
C&
92
setLocalUri
(
const
std::string& localUri)
93
{
94
wireReset
();
95
m_localUri
= localUri;
96
return
static_cast<
C&
>
(*this);
97
}
98
99
FaceScope
100
getFaceScope
()
const
101
{
102
return
m_faceScope
;
103
}
104
105
C&
106
setFaceScope
(
FaceScope
faceScope)
107
{
108
wireReset
();
109
m_faceScope
= faceScope;
110
return
static_cast<
C&
>
(*this);
111
}
112
113
FacePersistency
114
getFacePersistency
()
const
115
{
116
return
m_facePersistency
;
117
}
118
119
C&
120
setFacePersistency
(
FacePersistency
facePersistency)
121
{
122
wireReset
();
123
m_facePersistency
= facePersistency;
124
return
static_cast<
C&
>
(*this);
125
}
126
127
LinkType
128
getLinkType
()
const
129
{
130
return
m_linkType
;
131
}
132
133
C&
134
setLinkType
(
LinkType
linkType)
135
{
136
wireReset
();
137
m_linkType
= linkType;
138
return
static_cast<
C&
>
(*this);
139
}
140
141
protected
:
142
virtual
void
143
wireReset
()
const
= 0;
144
145
protected
:
146
uint64_t
m_faceId
;
147
std::string
m_remoteUri
;
148
std::string
m_localUri
;
149
FaceScope
m_faceScope
;
150
FacePersistency
m_facePersistency
;
151
LinkType
m_linkType
;
152
};
153
154
}
// namespace nfd
155
}
// namespace ndn
156
157
#endif // NDN_MANAGEMENT_NFD_FACE_TRAITS_HPP
ndn::nfd::FaceTraits::getLocalUri
const std::string & getLocalUri() const
Definition:
nfd-face-traits.hpp:86
ndn::nfd::FaceScope
FaceScope
Definition:
nfd-constants.hpp:34
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::nfd::FaceTraits::getFacePersistency
FacePersistency getFacePersistency() const
Definition:
nfd-face-traits.hpp:114
ndn::nfd::FaceTraits::m_localUri
std::string m_localUri
Definition:
nfd-face-traits.hpp:148
ndn::nfd::FaceTraits::m_remoteUri
std::string m_remoteUri
Definition:
nfd-face-traits.hpp:147
ndn::nfd::LinkType
LinkType
Definition:
nfd-constants.hpp:65
ndn::nfd::FACE_SCOPE_NON_LOCAL
face is non-local
Definition:
nfd-constants.hpp:37
ndn::nfd::FaceTraits::m_facePersistency
FacePersistency m_facePersistency
Definition:
nfd-face-traits.hpp:150
ndn::nfd::FaceTraits::getFaceScope
FaceScope getFaceScope() const
Definition:
nfd-face-traits.hpp:100
ndn::nfd::FaceTraits::setFaceId
C & setFaceId(uint64_t faceId)
Definition:
nfd-face-traits.hpp:64
ndn::nfd::FaceTraits::getRemoteUri
const std::string & getRemoteUri() const
Definition:
nfd-face-traits.hpp:72
ndn::nfd::FaceTraits::setLocalUri
C & setLocalUri(const std::string &localUri)
Definition:
nfd-face-traits.hpp:92
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
ndn::nfd::LINK_TYPE_POINT_TO_POINT
link is point-to-point
Definition:
nfd-constants.hpp:68
ndn::nfd::FaceTraits::wireReset
virtual void wireReset() const =0
ndn::nfd::FaceTraits::setRemoteUri
C & setRemoteUri(const std::string &remoteUri)
Definition:
nfd-face-traits.hpp:78
ndn::nfd::FaceTraits::m_linkType
LinkType m_linkType
Definition:
nfd-face-traits.hpp:151
ndn::nfd::FaceTraits::setFaceScope
C & setFaceScope(FaceScope faceScope)
Definition:
nfd-face-traits.hpp:106
ndn::nfd::FACE_PERSISTENCY_PERSISTENT
face is persistent
Definition:
nfd-constants.hpp:51
ndn::nfd::FaceTraits::m_faceId
uint64_t m_faceId
Definition:
nfd-face-traits.hpp:146
ndn::nfd::FacePersistency
FacePersistency
Definition:
nfd-constants.hpp:48
ndn::nfd::FaceTraits::FaceTraits
FaceTraits()
Definition:
nfd-face-traits.hpp:49
ndn::nfd::FaceTraits
providers getters and setters of face information fields
Definition:
nfd-face-traits.hpp:36
ndn::nfd::FaceTraits::Error
Definition:
nfd-face-traits.hpp:39
ndn::nfd::FaceTraits::setLinkType
C & setLinkType(LinkType linkType)
Definition:
nfd-face-traits.hpp:134
ndn::nfd::FaceTraits::getFaceId
uint64_t getFaceId() const
Definition:
nfd-face-traits.hpp:58
ndn::nfd::FaceTraits::m_faceScope
FaceScope m_faceScope
Definition:
nfd-face-traits.hpp:149
ndn::nfd::FaceTraits::setFacePersistency
C & setFacePersistency(FacePersistency facePersistency)
Definition:
nfd-face-traits.hpp:120
ndn::nfd::FaceTraits::Error::Error
Error(const std::string &what)
Definition:
nfd-face-traits.hpp:43
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition:
tlv.hpp:50
ndn::nfd::FaceTraits::getLinkType
LinkType getLinkType() const
Definition:
nfd-face-traits.hpp:128
ndnSIM
ndn-cxx
src
management
nfd-face-traits.hpp
Generated on Fri Feb 23 2018 12:30:54 for ndnSIM by
1.8.14