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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
#ifndef BOOLEAN_H
9
#define BOOLEAN_H
10
11
#include "
attribute-helper.h
"
12
#include "
attribute.h
"
13
14
/**
15
* \file
16
* \ingroup attribute_Boolean
17
* ns3::BooleanValue attribute value declarations.
18
*/
19
20
namespace
ns3
21
{
22
23
// Doxygen for this class is auto-generated by
24
// utils/print-introspected-doxygen.h
25
class
BooleanValue
:
public
AttributeValue
26
{
27
public
:
28
BooleanValue
();
29
BooleanValue
(
const
bool
& value);
30
void
Set
(
bool
value);
31
bool
Get
()
const
;
32
template
<
typename
T>
33
bool
GetAccessor
(T& v)
const
;
34
35
/**
36
* Functor returning the value.
37
* \returns The value.
38
*/
39
operator
bool()
const
;
40
41
Ptr<AttributeValue>
Copy
()
const override
;
42
std::string
SerializeToString
(
Ptr<const AttributeChecker>
checker)
const override
;
43
bool
DeserializeFromString
(std::string value,
Ptr<const AttributeChecker>
checker)
override
;
44
45
private
:
46
bool
m_value
;
47
};
48
49
template
<
typename
T>
50
bool
51
BooleanValue::GetAccessor
(T& v)
const
52
{
53
v = T(
m_value
);
54
return
true
;
55
}
56
57
/**
58
* \ingroup attribute_Boolean
59
* Output streamer.
60
*
61
* The value is printed as "true" or "false".
62
*
63
* \param [in,out] os The stream.
64
* \param [in] value The BooleanValue to print.
65
* \returns The stream.
66
*/
67
std::ostream&
operator<<
(std::ostream& os,
const
BooleanValue
& value);
68
69
ATTRIBUTE_CHECKER_DEFINE
(Boolean);
70
ATTRIBUTE_ACCESSOR_DEFINE
(Boolean);
71
72
}
// namespace ns3
73
74
#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:59
ns3::BooleanValue
Definition
boolean.h:26
ns3::BooleanValue::Get
bool Get() const
Definition
boolean.cc:44
ns3::BooleanValue::Copy
Ptr< AttributeValue > Copy() const override
Definition
boolean.cc:70
ns3::BooleanValue::DeserializeFromString
bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker) override
Definition
boolean.cc:93
ns3::BooleanValue::BooleanValue
BooleanValue()
Definition
boolean.cc:24
ns3::BooleanValue::Set
void Set(bool value)
Definition
boolean.cc:37
ns3::BooleanValue::m_value
bool m_value
Definition
boolean.h:46
ns3::BooleanValue::GetAccessor
bool GetAccessor(T &v) const
Definition
boolean.h:51
ns3::BooleanValue::SerializeToString
std::string SerializeToString(Ptr< const AttributeChecker > checker) const override
Definition
boolean.cc:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ATTRIBUTE_ACCESSOR_DEFINE
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type .
Definition
attribute-helper.h:163
ATTRIBUTE_CHECKER_DEFINE
#define ATTRIBUTE_CHECKER_DEFINE(type)
Declare the AttributeChecker class typeChecker and the MaketypeChecker function for class type .
Definition
attribute-helper.h:261
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:148
src
core
model
boolean.h
Generated on Fri Nov 8 2024 13:58:59 for ns-3 by
1.11.0