A Discrete-Event Network Simulator
API
attribute-construction-list.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Mathieu Lacage
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  * Authors: Mathieu Lacage <mathieu.lacage@gmail.com>
19  */
20 #ifndef ATTRIBUTE_CONSTRUCTION_LIST_H
21 #define ATTRIBUTE_CONSTRUCTION_LIST_H
22 
23 #include "attribute.h"
24 #include <list>
25 
32 namespace ns3 {
33 
40 {
41 public:
43  struct Item
44  {
50  std::string name;
51  };
53  typedef std::list<struct Item>::const_iterator CIterator;
54 
57 
65  void Add (std::string name, Ptr<const AttributeChecker> checker,
66  Ptr<AttributeValue> value);
67 
76 
78  CIterator Begin (void) const;
80  CIterator End (void) const;
81 
82 private:
83 
85  std::list<struct Item> m_list;
86 };
87 
88 } // namespace ns3
89 
90 #endif /* ATTRIBUTE_CONSTRUCTION_LIST_H */
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::AttributeConstructionList::Find
Ptr< AttributeValue > Find(Ptr< const AttributeChecker > checker) const
Find an Attribute in the list from its AttributeChecker.
Definition: attribute-construction-list.cc:62
ns3::AttributeConstructionList::Item
A single Attribute triple.
Definition: attribute-construction-list.h:44
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::AttributeConstructionList::m_list
std::list< struct Item > m_list
The list of Items.
Definition: attribute-construction-list.h:85
attribute.h
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
ns3::AttributeConstructionList::CIterator
std::list< struct Item >::const_iterator CIterator
Iterator type.
Definition: attribute-construction-list.h:53
ns3::AttributeConstructionList::Item::checker
Ptr< const AttributeChecker > checker
Checker used to validate serialized values.
Definition: attribute-construction-list.h:46
ns3::AttributeConstructionList::End
CIterator End(void) const
Definition: attribute-construction-list.cc:83
ns3::AttributeConstructionList::AttributeConstructionList
AttributeConstructionList()
Constructor.
Definition: attribute-construction-list.cc:33
ns3::AttributeConstructionList::Item::name
std::string name
The name of the Attribute.
Definition: attribute-construction-list.h:50
ns3::AttributeConstructionList::Item::value
Ptr< AttributeValue > value
The value of the Attribute.
Definition: attribute-construction-list.h:48
ns3::AttributeConstructionList::Begin
CIterator Begin(void) const
Definition: attribute-construction-list.cc:77
ns3::AttributeConstructionList
List of Attribute name, value and checker triples used to construct Objects.
Definition: attribute-construction-list.h:40
ns3::AttributeConstructionList::Add
void Add(std::string name, Ptr< const AttributeChecker > checker, Ptr< AttributeValue > value)
Add an Attribute to the list.
Definition: attribute-construction-list.cc:39