NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
ndn-content-store.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20
#include "
ndn-content-store.hpp
"
21
22
#include "ns3/log.h"
23
#include "ns3/packet.h"
24
25
NS_LOG_COMPONENT_DEFINE(
"ndn.cs.ContentStore"
);
26
27
namespace
ns3 {
28
namespace
ndn {
29
30
NS_OBJECT_ENSURE_REGISTERED
(
ContentStore
);
31
32
TypeId
33
ContentStore::GetTypeId
(
void
)
34
{
35
static
TypeId tid =
36
TypeId(
"ns3::ndn::ContentStore"
)
37
.SetGroupName(
"Ndn"
)
38
.SetParent<Object>()
39
40
.AddTraceSource(
"CacheHits"
,
"Trace called every time there is a cache hit"
,
41
MakeTraceSourceAccessor(&
ContentStore::m_cacheHitsTrace
))
42
43
.AddTraceSource(
"CacheMisses"
,
"Trace called every time there is a cache miss"
,
44
MakeTraceSourceAccessor(&
ContentStore::m_cacheMissesTrace
));
45
46
return
tid;
47
}
48
49
ContentStore::~ContentStore
()
50
{
51
}
52
53
namespace
cs {
54
56
57
Entry::Entry
(Ptr<ContentStore> cs, shared_ptr<const Data> data)
58
: m_cs(cs)
59
, m_data(data)
60
{
61
}
62
63
const
Name
&
64
Entry::GetName
()
const
65
{
66
return
m_data->getName();
67
}
68
69
shared_ptr<const Data>
70
Entry::GetData
()
const
71
{
72
return
m_data;
73
}
74
75
Ptr<ContentStore>
76
Entry::GetContentStore
()
77
{
78
return
m_cs;
79
}
80
81
}
// namespace cs
82
}
// namespace ndn
83
}
// namespace ns3
ns3::ndn::cs::Entry::Entry
Entry(Ptr< ContentStore > cs, shared_ptr< const Data > data)
Construct content store entry.
Definition:
ndn-content-store.cpp:57
ns3::ndn::NS_OBJECT_ENSURE_REGISTERED
NS_OBJECT_ENSURE_REGISTERED(ContentStore)
ns3::ndn::ContentStore::m_cacheMissesTrace
TracedCallback< shared_ptr< const Interest > > m_cacheMissesTrace
trace of cache misses
Definition:
ndn-content-store.hpp:190
ns3::ndn::Name
Name
Definition:
ndn-common.cpp:25
ndn-content-store.hpp
ns3::ndn::ContentStore::m_cacheHitsTrace
TracedCallback< shared_ptr< const Interest >, shared_ptr< const Data > > m_cacheHitsTrace
trace of cache hits
Definition:
ndn-content-store.hpp:188
ns3::ndn::ContentStore::~ContentStore
virtual ~ContentStore()
Virtual destructor.
Definition:
ndn-content-store.cpp:49
ns3::ndn::cs::Entry::GetData
shared_ptr< const Data > GetData() const
Get Data of the stored entry.
Definition:
ndn-content-store.cpp:70
ContentStore
ndn cs ContentStore
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-content-store.cpp:25
ns3::ndn::cs::Entry::GetContentStore
Ptr< ContentStore > GetContentStore()
Get pointer to access store, to which this entry is added.
Definition:
ndn-content-store.cpp:76
ns3::ndn::cs::Entry::GetName
const Name & GetName() const
Get prefix of the stored entry.
Definition:
ndn-content-store.cpp:64
ns3::ndn::ContentStore::GetTypeId
static TypeId GetTypeId()
Interface ID.
Definition:
ndn-content-store.cpp:33
ndnSIM
model
cs
ndn-content-store.cpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7