A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ipv4-interface-container.h
1 #ifndef IPV4_INTERFACE_CONTAINER_H
2 #define IPV4_INTERFACE_CONTAINER_H
3 
4 #include <stdint.h>
5 #include <vector>
6 #include "ns3/ipv4.h"
7 #include "ns3/ipv4-address.h"
8 
9 namespace ns3 {
10 
33 {
34 public:
35  typedef std::vector<std::pair<Ptr<Ipv4>, uint32_t> >::const_iterator Iterator;
36 
41 
46  void Add (Ipv4InterfaceContainer other);
47 
68  Iterator Begin (void) const;
69 
90  Iterator End (void) const;
91 
113  uint32_t GetN (void) const;
114 
125  Ipv4Address GetAddress (uint32_t i, uint32_t j = 0) const;
126 
127  void SetMetric (uint32_t i, uint16_t metric);
128 
138  void Add (Ptr<Ipv4> ipv4, uint32_t interface);
139 
148  void Add (std::pair<Ptr<Ipv4>, uint32_t> ipInterfacePair);
149 
160  void Add (std::string ipv4Name, uint32_t interface);
161 
170  std::pair<Ptr<Ipv4>, uint32_t> Get (uint32_t i) const;
171 
172 private:
173 
174  typedef std::vector<std::pair<Ptr<Ipv4>,uint32_t> > InterfaceVector;
175  InterfaceVector m_interfaces;
176 };
177 
178 } // namespace ns3
179 
180 #endif /* IPV4_INTERFACE_CONTAINER_H */
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
std::pair< Ptr< Ipv4 >, uint32_t > Get(uint32_t i) const
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:38
Iterator Begin(void) const
Get an iterator which refers to the first pair in the container.
void Add(Ipv4InterfaceContainer other)
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const