A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
attribute-construction-list.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Mathieu Lacage
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Mathieu Lacage <mathieu.lacage@gmail.com>
7
*/
8
#ifndef ATTRIBUTE_CONSTRUCTION_LIST_H
9
#define ATTRIBUTE_CONSTRUCTION_LIST_H
10
11
#include "
attribute.h
"
12
13
#include <list>
14
15
/**
16
* \file
17
* \ingroup object
18
* ns3::AttributeConstructionList declaration.
19
*/
20
21
namespace
ns3
22
{
23
24
/**
25
* \ingroup object
26
* List of Attribute name, value and checker triples used
27
* to construct Objects.
28
*/
29
class
AttributeConstructionList
30
{
31
public
:
32
/** A single Attribute triple */
33
struct
Item
34
{
35
/** Checker used to validate serialized values. */
36
Ptr<const AttributeChecker>
checker
;
37
/** The value of the Attribute. */
38
Ptr<AttributeValue>
value
;
39
/** The name of the Attribute. */
40
std::string
name
;
41
};
42
43
/** Iterator type. */
44
typedef
std::list<Item>::const_iterator
CIterator
;
45
46
/** Constructor */
47
AttributeConstructionList
();
48
49
/**
50
* Add an Attribute to the list.
51
*
52
* \param [in] name The Attribute name.
53
* \param [in] checker The checker to use for this Attribute.
54
* \param [in] value The AttributeValue to add.
55
*/
56
void
Add
(std::string name,
Ptr<const AttributeChecker>
checker,
Ptr<AttributeValue>
value);
57
58
/**
59
* Find an Attribute in the list from its AttributeChecker.
60
*
61
* \param [in] checker The AttributeChecker to find. Typically this is the
62
* AttributeChecker from TypeId::AttributeInformation.
63
* \returns The AttributeValue.
64
*/
65
Ptr<AttributeValue>
Find
(
Ptr<const AttributeChecker>
checker)
const
;
66
67
/** \returns The first item in the list */
68
CIterator
Begin
()
const
;
69
/** \returns The end of the list (iterator to one past the last). */
70
CIterator
End
()
const
;
71
72
private
:
73
/** The list of Items */
74
std::list<Item>
m_list
;
75
};
76
77
}
// namespace ns3
78
79
#endif
/* ATTRIBUTE_CONSTRUCTION_LIST_H */
attribute.h
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
ns3::AttributeConstructionList
List of Attribute name, value and checker triples used to construct Objects.
Definition
attribute-construction-list.h:30
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:54
ns3::AttributeConstructionList::Begin
CIterator Begin() const
Definition
attribute-construction-list.cc:69
ns3::AttributeConstructionList::End
CIterator End() const
Definition
attribute-construction-list.cc:76
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:29
ns3::AttributeConstructionList::m_list
std::list< Item > m_list
The list of Items.
Definition
attribute-construction-list.h:74
ns3::AttributeConstructionList::AttributeConstructionList
AttributeConstructionList()
Constructor.
Definition
attribute-construction-list.cc:23
ns3::AttributeConstructionList::CIterator
std::list< Item >::const_iterator CIterator
Iterator type.
Definition
attribute-construction-list.h:44
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::AttributeConstructionList::Item
A single Attribute triple.
Definition
attribute-construction-list.h:34
ns3::AttributeConstructionList::Item::name
std::string name
The name of the Attribute.
Definition
attribute-construction-list.h:40
ns3::AttributeConstructionList::Item::checker
Ptr< const AttributeChecker > checker
Checker used to validate serialized values.
Definition
attribute-construction-list.h:36
ns3::AttributeConstructionList::Item::value
Ptr< AttributeValue > value
The value of the Attribute.
Definition
attribute-construction-list.h:38
src
core
model
attribute-construction-list.h
Generated on Fri Nov 8 2024 13:58:59 for ns-3 by
1.11.0