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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
boolean.h
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
26
namespace
ns3 {
27
38
class
BooleanValue
:
public
AttributeValue
39
{
40
public
:
41
BooleanValue
();
42
BooleanValue
(
bool
value);
43
void
Set (
bool
value);
44
bool
Get (
void
)
const
;
45
template
<
typename
T>
46
bool
GetAccessor (T &v)
const
;
47
48
operator
bool ()
const
;
49
50
virtual
Ptr<AttributeValue>
Copy
(
void
)
const
;
51
virtual
std::string
SerializeToString
(
Ptr<const AttributeChecker>
checker)
const
;
52
virtual
bool
DeserializeFromString
(std::string value,
Ptr<const AttributeChecker>
checker);
53
private
:
54
bool
m_value;
55
};
56
57
template
<
typename
T>
58
bool
BooleanValue::GetAccessor (T &v)
const
59
{
60
v = T (m_value);
61
return
true
;
62
}
63
64
std::ostream &
operator <<
(std::ostream &os,
const
BooleanValue &value);
65
66
ATTRIBUTE_CHECKER_DEFINE
(Boolean);
67
ATTRIBUTE_ACCESSOR_DEFINE
(Boolean);
68
69
}
// namespace ns3
70
71
#endif
/* BOOLEAN_H */
ns3::BooleanValue::Copy
virtual Ptr< AttributeValue > Copy(void) const
Definition:
boolean.cc:69
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::BooleanValue
Hold a bool native type.
Definition:
boolean.h:38
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:51
ns3::BooleanValue::DeserializeFromString
virtual bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker)
Definition:
boolean.cc:90
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:43
ATTRIBUTE_CHECKER_DEFINE
#define ATTRIBUTE_CHECKER_DEFINE(type)
Definition:
attribute-helper.h:162
ns3::BooleanValue::SerializeToString
virtual std::string SerializeToString(Ptr< const AttributeChecker > checker) const
Definition:
boolean.cc:76
ATTRIBUTE_ACCESSOR_DEFINE
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Definition:
attribute-helper.h:100
src
core
model
boolean.h
Generated on Sun Mar 16 2014 11:25:02 for ns-3 by
1.8.6