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 */
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::GlobalValue::m_help
std::string m_help
Definition:
global-value.h:149
ptr.h
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:56
ns3::GlobalValue::Iterator
Vector::const_iterator Iterator
Definition:
global-value.h:51
ns3::GlobalValue::m_initialValue
Ptr< AttributeValue > m_initialValue
Definition:
global-value.h:150
ns3::GlobalValue
hold a so-called 'global value'.
Definition:
global-value.h:47
ns3::GlobalValue::GlobalValue
GlobalValue(std::string name, std::string help, const AttributeValue &initialValue, Ptr< const AttributeChecker > checker)
Definition:
global-value.cc:37
ns3::GlobalValue::GetName
std::string GetName(void) const
Definition:
global-value.cc:100
ns3::GlobalValue::ResetInitialValue
void ResetInitialValue(void)
Definition:
global-value.cc:196
ns3::GlobalValue::GetVector
static Vector * GetVector(void)
Definition:
global-value.cc:228
ns3::GlobalValue::Begin
static Iterator Begin(void)
Definition:
global-value.cc:182
attribute.h
ns3::GlobalValue::m_checker
Ptr< const AttributeChecker > m_checker
Definition:
global-value.h:152
ns3::GlobalValue::Vector
std::vector< GlobalValue * > Vector
Definition:
global-value.h:49
ns3::GlobalValue::Bind
static void Bind(std::string name, const AttributeValue &value)
Definition:
global-value.cc:150
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:203
ns3::GlobalValue::SetValue
bool SetValue(const AttributeValue &value)
Definition:
global-value.cc:136
ns3::GlobalValue::m_name
std::string m_name
Definition:
global-value.h:148
ns3::GlobalValue::m_currentValue
Ptr< AttributeValue > m_currentValue
Definition:
global-value.h:151
ns3::GlobalValue::End
static Iterator End(void)
Definition:
global-value.cc:189
ns3::GlobalValue::BindFailSafe
static bool BindFailSafe(std::string name, const AttributeValue &value)
Definition:
global-value.cc:168
ns3::GlobalValue::GetHelp
std::string GetHelp(void) const
Definition:
global-value.cc:106
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:218
ns3::GlobalValue::GetChecker
Ptr< const AttributeChecker > GetChecker(void) const
Definition:
global-value.cc:128
ns3::GlobalValueTestCase
Definition:
global-value-test-suite.cc:29
ns3::GlobalValue::InitializeFromEnv
void InitializeFromEnv(void)
Definition:
global-value.cc:62
ns3::GlobalValue::GetValue
void GetValue(AttributeValue &value) const
Definition:
global-value.cc:112
src
core
model
global-value.h
Generated on Sat Apr 19 2014 14:06:51 for ns-3 by
1.8.6