NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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 #include "ns3/ndnSIM/model/ndn-face.hpp"
31 
32 namespace ns3 {
33 namespace ndn {
34 
44 class FaceContainer : public SimpleRefCount<FaceContainer> {
45 private:
46  typedef std::vector<shared_ptr<Face>> Container;
47 
48 public:
49  typedef Container::const_iterator Iterator;
50 
54  FaceContainer();
55 
61  FaceContainer(const FaceContainer& other);
62 
71  operator=(const FaceContainer& other);
72 
78  void
79  Add(shared_ptr<Face> face);
80 
86  void
87  AddAll(Ptr<FaceContainer> other);
88 
94  void
95  AddAll(const FaceContainer& other);
96 
97 public: // accessors
104  Iterator
105  Begin() const;
106 
113  Iterator
114  End() const;
115 
121  uint32_t
122  GetN() const;
123 
130  shared_ptr<Face>
131  Get(size_t pos) const;
132 
133 private:
134  Container m_faces;
135 };
136 
137 } // namespace ndn
138 } // namespace ns3
139 
140 #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.
Copyright (c) 2011-2015 Regents of the University of California.
void Add(shared_ptr< Face > face)
Add an entry to 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.
A pool for Ndn faces.
FaceContainer()
Create an empty FaceContainer.
Container::const_iterator Iterator
Iterator over FaceContainer.