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
boolean.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 BOOLEAN_H
21
#define BOOLEAN_H
22
23
#include "
attribute.h
"
24
#include "
attribute-helper.h
"
25
32
namespace
ns3 {
33
34
class
BooleanValue
:
public
AttributeValue
35
{
36
public
:
37
BooleanValue
();
43
BooleanValue
(
bool
value);
44
void
Set
(
bool
value);
45
bool
Get
(
void
)
const
;
46
template
<
typename
T>
47
bool
GetAccessor
(T &v)
const
;
48
53
operator
bool ()
const
;
54
55
virtual
Ptr<AttributeValue>
Copy
(
void
)
const
;
56
virtual
std::string
SerializeToString
(
Ptr<const AttributeChecker>
checker)
const
;
57
virtual
bool
DeserializeFromString
(std::string value,
Ptr<const AttributeChecker>
checker);
58
private
:
59
bool
m_value
;
60
};
61
62
template
<
typename
T>
63
bool
BooleanValue::GetAccessor
(T &v)
const
64
{
65
v = T (
m_value
);
66
return
true
;
67
}
68
78
std::ostream &
operator <<
(std::ostream &os,
const
BooleanValue
&value);
79
80
ATTRIBUTE_CHECKER_DEFINE
(Boolean);
81
ATTRIBUTE_ACCESSOR_DEFINE
(Boolean);
82
83
}
// namespace ns3
84
85
#endif
/* BOOLEAN_H */
ns3::BooleanValue::Copy
virtual Ptr< AttributeValue > Copy(void) const
Definition:
boolean.cc:75
ns3::BooleanValue::Get
bool Get(void) const
Definition:
boolean.cc:51
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition:
boolean.h:34
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:68
ns3::BooleanValue::DeserializeFromString
virtual bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker)
Definition:
boolean.cc:96
ATTRIBUTE_CHECKER_DEFINE
#define ATTRIBUTE_CHECKER_DEFINE(type)
Declare the AttributeChecker class <type>Checker and the MakeTypeChecker function for class type...
Definition:
attribute-helper.h:252
ns3::BooleanValue::Set
void Set(bool value)
Set the value.
Definition:
boolean.cc:45
ns3::BooleanValue::GetAccessor
bool GetAccessor(T &v) const
Access the Boolean value as type T.
Definition:
boolean.h:63
attribute.h
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
ns3::BooleanValue::BooleanValue
BooleanValue()
Definition:
boolean.cc:34
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition:
angles.cc:42
attribute-helper.h
Declaration of Attribute helper macros.
ns3::BooleanValue::SerializeToString
virtual std::string SerializeToString(Ptr< const AttributeChecker > checker) const
Definition:
boolean.cc:82
ATTRIBUTE_ACCESSOR_DEFINE
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type.
Definition:
attribute-helper.h:152
ns3::BooleanValue::m_value
bool m_value
The stored Boolean instance.
Definition:
boolean.h:59
src
core
model
boolean.h
Generated on Wed Jul 6 2016 17:11:25 for ns-3 by
1.8.6