A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
attribute-default-iterator.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-2.0-only
3 *
4 * Authors: Faker Moatamri <faker.moatamri@sophia.inria.fr>
5 * Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
6 */
7
8#ifndef ATTRIBUTE_DEFAULT_ITERATOR_H
9#define ATTRIBUTE_DEFAULT_ITERATOR_H
10
11#include "ns3/type-id.h"
12
13#include <string>
14
15namespace ns3
16{
17
18/**
19 * \ingroup configstore
20 *
21 * \brief Iterator to iterate on the default values of attributes of an ns3::Object
22 */
24{
25 public:
26 virtual ~AttributeDefaultIterator() = 0;
27 /**
28 * \brief This function will go through all the TypeIds and get only the attributes which are
29 * explicit values (not vectors or pointer or arrays) and apply StartVisitTypeId
30 * and VisitAttribute on the attributes in one TypeId. At the end of each TypeId
31 * EndVisitTypeId is called.
32 */
33 void Iterate();
34
35 private:
36 /**
37 * \brief Begin the analysis of a TypeId
38 * \param name TypeId name
39 */
40 virtual void StartVisitTypeId(std::string name);
41 /**
42 * \brief End the analysis of a TypeId
43 */
44 virtual void EndVisitTypeId();
45 /**
46 * \brief Visit an Attribute
47 * \param tid the TypeId the attribute belongs to
48 * \param name the Attribute name
49 * \param defaultValue the attribute default value
50 * \param index the index of the Attribute
51 */
52 virtual void VisitAttribute(TypeId tid,
53 std::string name,
54 std::string defaultValue,
55 uint32_t index);
56 /**
57 * \brief Visit an Attribute
58 * \param name the Attribute name
59 * \param defaultValue the attribute default value
60 */
61 virtual void DoVisitAttribute(std::string name, std::string defaultValue);
62};
63
64} // namespace ns3
65
66#endif /* ATTRIBUTE_DEFAULT_ITERATOR_H */
Iterator to iterate on the default values of attributes of an ns3::Object.
virtual void VisitAttribute(TypeId tid, std::string name, std::string defaultValue, uint32_t index)
Visit an Attribute.
virtual void EndVisitTypeId()
End the analysis of a TypeId.
void Iterate()
This function will go through all the TypeIds and get only the attributes which are explicit values (...
virtual void DoVisitAttribute(std::string name, std::string defaultValue)
Visit an Attribute.
virtual void StartVisitTypeId(std::string name)
Begin the analysis of a TypeId.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.