NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  AddAll(Ptr<FaceContainer> other);
80 
86  void
87  AddAll(const FaceContainer& other);
88 
95  Iterator
96  Begin() const;
97 
104  Iterator
105  End() const;
106 
112  uint32_t
113  GetN() const;
114 
115  // /**
116  // * \brief Set a metric for all faces in the container
117  // *
118  // * \param metric value of metric to assign to all faces in the container
119  // */
120  // void SetMetricToAll (uint16_t metric);
121 
129  void
130  Add(const shared_ptr<Face>& face);
131 
141  shared_ptr<Face>
142  Get(Iterator i) const;
143 
144 private:
145  Container m_faces;
146 };
147 
148 } // namespace ndn
149 } // namespace ns3
150 
151 #endif /* NDN_FACE_CONTAINER_H */
void AddAll(Ptr< FaceContainer > other)
Add all entries from other container.
void Add(const shared_ptr< Face > &face)
Set a metric for all faces in the container.
FaceContainer & operator=(const FaceContainer &other)
Copy operator for FaceContainer.
Iterator Begin() const
Get an iterator which refers to the first pair in the container.
shared_ptr< Face > Get(Iterator i) const
Get a smart pointer to Face-derived object stored 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.
A pool for Ndn faces.
FaceContainer()
Create an empty FaceContainer.
Container::const_iterator Iterator
Iterator over FaceContainer.