NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ndn-face-container.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2 /*
3  * Copyright (c) 2011 University of California, Los Angeles
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19  */
20 
21 #ifndef NDN_FACE_CONTAINER_H
22 #define NDN_FACE_CONTAINER_H
23 
24 #include <stdint.h>
25 #include <vector>
26 
27 #include "ns3/ptr.h"
28 #include "ns3/simple-ref-count.h"
29 #include "ns3/ndn-face.h"
30 
31 namespace ns3 {
32 namespace ndn {
33 
43 class FaceContainer : public SimpleRefCount<FaceContainer>
44 {
45 private:
46  typedef std::vector< Ptr<Face> > Container;
47 public:
48  typedef Container::const_iterator Iterator;
49 
53  FaceContainer ();
54 
60  FaceContainer (const FaceContainer &other);
61 
69  FaceContainer& operator= (const FaceContainer &other);
70 
76  void AddAll (Ptr<FaceContainer> other);
77 
83  void AddAll (const FaceContainer &other);
84 
91  Iterator Begin () const;
92 
99  Iterator End () const;
100 
106  uint32_t GetN () const;
107 
108  // /**
109  // * \brief Set a metric for all faces in the container
110  // *
111  // * \param metric value of metric to assign to all faces in the container
112  // */
113  // void SetMetricToAll (uint16_t metric);
114 
122  void Add (const Ptr<Face> &face);
123 
133  Ptr<Face> Get (Iterator i) const;
134 
135 private:
136  Container m_faces;
137 };
138 
139 } // namespace ndn
140 } // namespace ns3
141 
142 #endif /* NDN_FACE_CONTAINER_H */
void Add(const Ptr< Face > &face)
Set a metric for all faces in the container.
uint32_t GetN() const
Get the number of faces stored in this container.
Iterator Begin() const
Get an iterator which refers to the first pair in the container.
Ptr< Face > Get(Iterator i) const
Get a smart pointer to Face-derived object stored in the container.
void AddAll(Ptr< FaceContainer > other)
Add all entries from other container.
FaceContainer & operator=(const FaceContainer &other)
Copy operator for FaceContainer.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
FaceContainer()
Create an empty FaceContainer.
A pool for Ndn faces.
Container::const_iterator Iterator
Iterator over FaceContainer.