A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
global-value.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008 INRIA
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@sophia.inria.fr>
19
*/
20
#ifndef GLOBAL_VALUE_H
21
#define GLOBAL_VALUE_H
22
23
#include <string>
24
#include <vector>
25
#include "
ptr.h
"
26
#include "
attribute.h
"
27
34
class
GlobalValueTestCase
;
35
36
namespace
ns3
{
37
54
class
GlobalValue
55
{
56
typedef
std::vector<GlobalValue *>
Vector
;
57
public
:
58
typedef
Vector::const_iterator
Iterator
;
59
70
GlobalValue
(std::string name, std::string help,
71
const
AttributeValue
&initialValue,
72
Ptr<const AttributeChecker>
checker);
73
77
std::string
GetName
(
void
)
const
;
81
std::string
GetHelp
(
void
)
const
;
85
void
GetValue
(
AttributeValue
&value)
const
;
89
Ptr<const AttributeChecker>
GetChecker
(
void
)
const
;
93
bool
SetValue
(
const
AttributeValue
&value);
94
95
void
ResetInitialValue
(
void
);
96
106
static
void
Bind
(std::string name,
const
AttributeValue
&value);
107
116
static
bool
BindFailSafe
(std::string name,
const
AttributeValue
&value);
117
121
static
Iterator
Begin
(
void
);
125
static
Iterator
End
(
void
);
126
127
136
static
bool
GetValueByNameFailSafe
(std::string name,
AttributeValue
&value);
137
147
static
void
GetValueByName
(std::string name,
AttributeValue
&value);
148
149
150
private
:
151
friend
class ::GlobalValueTestCase;
152
153
static
Vector *
GetVector
(
void
);
154
void
InitializeFromEnv
(
void
);
155
std::string
m_name
;
156
std::string
m_help
;
157
Ptr<AttributeValue>
m_initialValue
;
158
Ptr<AttributeValue>
m_currentValue
;
159
Ptr<const AttributeChecker>
m_checker
;
160
};
161
162
}
// namespace ns3
163
164
#endif
/* GLOBAL_VALUE_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::GlobalValue::m_help
std::string m_help
Definition:
global-value.h:156
ptr.h
Smart pointer implementation.
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:68
ns3::GlobalValue::Iterator
Vector::const_iterator Iterator
Definition:
global-value.h:58
ns3::GlobalValue::m_initialValue
Ptr< AttributeValue > m_initialValue
Definition:
global-value.h:157
ns3::GlobalValue
hold a so-called 'global value'.
Definition:
global-value.h:54
ns3::GlobalValue::GlobalValue
GlobalValue(std::string name, std::string help, const AttributeValue &initialValue, Ptr< const AttributeChecker > checker)
Definition:
global-value.cc:42
ns3::GlobalValue::GetName
std::string GetName(void) const
Definition:
global-value.cc:105
ns3::GlobalValue::ResetInitialValue
void ResetInitialValue(void)
Definition:
global-value.cc:201
ns3::GlobalValue::GetVector
static Vector * GetVector(void)
Definition:
global-value.cc:233
ns3::GlobalValue::Begin
static Iterator Begin(void)
Definition:
global-value.cc:187
attribute.h
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
ns3::GlobalValue::m_checker
Ptr< const AttributeChecker > m_checker
Definition:
global-value.h:159
ns3::GlobalValue::Vector
std::vector< GlobalValue * > Vector
Definition:
global-value.h:56
ns3::GlobalValue::Bind
static void Bind(std::string name, const AttributeValue &value)
Definition:
global-value.cc:155
ns3::GlobalValue::GetValueByNameFailSafe
static bool GetValueByNameFailSafe(std::string name, AttributeValue &value)
finds the GlobalValue with the given name and returns its value
Definition:
global-value.cc:208
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
GlobalValueTestCase
Definition:
global-value-test-suite.cc:29
ns3::GlobalValue::SetValue
bool SetValue(const AttributeValue &value)
Definition:
global-value.cc:141
ns3::GlobalValue::m_name
std::string m_name
Definition:
global-value.h:155
ns3::GlobalValue::m_currentValue
Ptr< AttributeValue > m_currentValue
Definition:
global-value.h:158
ns3::GlobalValue::End
static Iterator End(void)
Definition:
global-value.cc:194
ns3::GlobalValue::BindFailSafe
static bool BindFailSafe(std::string name, const AttributeValue &value)
Definition:
global-value.cc:173
ns3::GlobalValue::GetHelp
std::string GetHelp(void) const
Definition:
global-value.cc:111
ns3::GlobalValue::GetValueByName
static void GetValueByName(std::string name, AttributeValue &value)
finds the GlobalValue with the given name and returns its value.
Definition:
global-value.cc:223
ns3::GlobalValue::GetChecker
Ptr< const AttributeChecker > GetChecker(void) const
Definition:
global-value.cc:133
ns3::GlobalValue::InitializeFromEnv
void InitializeFromEnv(void)
Definition:
global-value.cc:67
ns3::GlobalValue::GetValue
void GetValue(AttributeValue &value) const
Definition:
global-value.cc:117
src
core
model
global-value.h
Generated on Wed May 13 2015 14:59:11 for ns-3 by
1.8.9.1