NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-face-container.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #ifndef NDN_FACE_CONTAINER_H
21 #define NDN_FACE_CONTAINER_H
22 
23 #include "ns3/ndnSIM/model/ndn-common.hpp"
24 
25 #include <stdint.h>
26 #include <vector>
27 
28 #include "ns3/ptr.h"
29 #include "ns3/simple-ref-count.h"
30 
31 namespace ns3 {
32 namespace ndn {
33 
43 class FaceContainer : public SimpleRefCount<FaceContainer> {
44 private:
45  typedef std::vector<shared_ptr<Face>> Container;
46 
47 public:
48  typedef Container::const_iterator Iterator;
49 
53  FaceContainer();
54 
60  FaceContainer(const FaceContainer& other);
61 
70  operator=(const FaceContainer& other);
71 
77  void
78  Add(shared_ptr<Face> face);
79 
85  void
86  AddAll(Ptr<FaceContainer> other);
87 
93  void
94  AddAll(const FaceContainer& other);
95 
96 public: // accessors
103  Iterator
104  Begin() const;
105 
112  Iterator
113  End() const;
114 
120  uint32_t
121  GetN() const;
122 
129  shared_ptr<Face>
130  Get(size_t pos) const;
131 
132 private:
133  Container m_faces;
134 };
135 
136 } // namespace ndn
137 } // namespace ns3
138 
139 #endif /* NDN_FACE_CONTAINER_H */
void AddAll(Ptr< FaceContainer > other)
Add all entries from other container.
Copyright (c) 2011-2015 Regents of the University of California.
FaceContainer & operator=(const FaceContainer &other)
Copy operator for FaceContainer.
Iterator Begin() const
Get an iterator which refers to the first pair in the container.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
uint32_t GetN() const
Get the number of faces stored in this container.
shared_ptr< Face > Get(size_t pos) const
Get a Face stored in the container.
Copyright (c) 2011-2015 Regents of the University of California.
void Add(shared_ptr< Face > face)
Add an entry to the container.
A pool for Ndn faces.
FaceContainer()
Create an empty FaceContainer.
Container::const_iterator Iterator
Iterator over FaceContainer.