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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
28
29
namespace
ns3 {
30
47
class
GlobalValue
48
{
49
typedef
std::vector<GlobalValue *>
Vector
;
50
public
:
51
typedef
Vector::const_iterator
Iterator
;
52
63
GlobalValue
(std::string name, std::string help,
64
const
AttributeValue
&initialValue,
65
Ptr<const AttributeChecker>
checker);
66
70
std::string
GetName
(
void
)
const
;
74
std::string
GetHelp
(
void
)
const
;
78
void
GetValue
(
AttributeValue
&value)
const
;
82
Ptr<const AttributeChecker>
GetChecker
(
void
)
const
;
86
bool
SetValue
(
const
AttributeValue
&value);
87
88
void
ResetInitialValue
(
void
);
89
99
static
void
Bind
(std::string name,
const
AttributeValue
&value);
100
109
static
bool
BindFailSafe
(std::string name,
const
AttributeValue
&value);
110
114
static
Iterator
Begin
(
void
);
118
static
Iterator
End
(
void
);
119
120
129
static
bool
GetValueByNameFailSafe
(std::string name,
AttributeValue
&value);
130
140
static
void
GetValueByName
(std::string name,
AttributeValue
&value);
141
142
143
private
:
144
friend
class
GlobalValueTestCase
;
145
146
static
Vector
*
GetVector
(
void
);
147
void
InitializeFromEnv
(
void
);
148
std::string
m_name
;
149
std::string
m_help
;
150
Ptr<AttributeValue>
m_initialValue
;
151
Ptr<AttributeValue>
m_currentValue
;
152
Ptr<const AttributeChecker>
m_checker
;
153
};
154
155
}
// namespace ns3
156
157
#endif
/* GLOBAL_VALUE_H */
src
core
model
global-value.h
Generated on Tue May 14 2013 11:08:17 for ns-3 by
1.8.1.2