A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
boolean.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
*/
19
#ifndef BOOLEAN_H
20
#define BOOLEAN_H
21
22
#include "
attribute-helper.h
"
23
#include "
attribute.h
"
24
31
namespace
ns3
32
{
33
34
// Doxygen for this class is auto-generated by
35
// utils/print-introspected-doxygen.h
36
class
BooleanValue
:
public
AttributeValue
37
{
38
public
:
39
BooleanValue
();
45
BooleanValue
(
bool
value);
46
void
Set
(
bool
value);
47
bool
Get
()
const
;
48
template
<
typename
T>
49
bool
GetAccessor
(T& v)
const
;
50
55
operator
bool()
const
;
56
57
Ptr<AttributeValue>
Copy
()
const override
;
58
std::string
SerializeToString
(
Ptr<const AttributeChecker>
checker)
const override
;
59
bool
DeserializeFromString
(std::string value,
Ptr<const AttributeChecker>
checker)
override
;
60
61
private
:
62
bool
m_value
;
63
};
64
65
template
<
typename
T>
66
bool
67
BooleanValue::GetAccessor
(T& v)
const
68
{
69
v = T(
m_value
);
70
return
true
;
71
}
72
83
std::ostream&
operator<<
(std::ostream& os,
const
BooleanValue
& value);
84
85
ATTRIBUTE_CHECKER_DEFINE
(Boolean);
86
ATTRIBUTE_ACCESSOR_DEFINE
(Boolean);
87
88
}
// namespace ns3
89
90
#endif
/* BOOLEAN_H */
attribute-helper.h
Attribute helper (ATTRIBUTE_ )macros definition.
attribute.h
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:70
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition:
boolean.h:37
ns3::BooleanValue::Get
bool Get() const
Definition:
boolean.cc:55
ns3::BooleanValue::Copy
Ptr< AttributeValue > Copy() const override
Definition:
boolean.cc:81
ns3::BooleanValue::DeserializeFromString
bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker) override
Definition:
boolean.cc:104
ns3::BooleanValue::BooleanValue
BooleanValue()
Definition:
boolean.cc:35
ns3::BooleanValue::Set
void Set(bool value)
Set the value.
Definition:
boolean.cc:48
ns3::BooleanValue::m_value
bool m_value
The stored Boolean instance.
Definition:
boolean.h:62
ns3::BooleanValue::GetAccessor
bool GetAccessor(T &v) const
Access the Boolean value as type T.
Definition:
boolean.h:67
ns3::BooleanValue::SerializeToString
std::string SerializeToString(Ptr< const AttributeChecker > checker) const override
Definition:
boolean.cc:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:78
ATTRIBUTE_ACCESSOR_DEFINE
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type.
Definition:
attribute-helper.h:174
ATTRIBUTE_CHECKER_DEFINE
#define ATTRIBUTE_CHECKER_DEFINE(type)
Declare the AttributeChecker class typeChecker and the MaketypeChecker function for class type.
Definition:
attribute-helper.h:272
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:129
src
core
model
boolean.h
Generated on Sun Jul 2 2023 18:21:31 for ns-3 by
1.9.6