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
attribute.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 ATTRIBUTE_H
21
#define ATTRIBUTE_H
22
23
#include <string>
24
#include <stdint.h>
25
#include "ptr.h"
26
#include "simple-ref-count.h"
27
28
namespace
ns3 {
29
30
class
AttributeAccessor;
31
class
AttributeChecker;
32
class
Attribute;
33
class
ObjectBase;
34
51
class
AttributeValue
:
public
SimpleRefCount
<AttributeValue>
52
{
53
public
:
54
AttributeValue
();
55
virtual
~
AttributeValue
();
56
60
virtual
Ptr<AttributeValue>
Copy
(
void
)
const
= 0;
70
virtual
std::string
SerializeToString
(
Ptr<const AttributeChecker>
checker)
const
= 0;
84
virtual
bool
DeserializeFromString
(std::string value,
Ptr<const AttributeChecker>
checker) = 0;
85
};
86
97
class
AttributeAccessor
:
public
SimpleRefCount
<AttributeAccessor>
98
{
99
public
:
100
AttributeAccessor
();
101
virtual
~
AttributeAccessor
();
102
111
virtual
bool
Set
(
ObjectBase
*
object
,
const
AttributeValue
&value)
const
= 0;
121
virtual
bool
Get
(
const
ObjectBase
*
object
,
AttributeValue
&attribute)
const
= 0;
122
127
virtual
bool
HasGetter
(
void
)
const
= 0;
132
virtual
bool
HasSetter
(
void
)
const
= 0;
133
};
134
149
class
AttributeChecker
:
public
SimpleRefCount
<AttributeChecker>
150
{
151
public
:
152
AttributeChecker
();
153
virtual
~
AttributeChecker
();
154
155
Ptr<AttributeValue>
CreateValidValue (
const
AttributeValue
&value)
const
;
162
virtual
bool
Check
(
const
AttributeValue
&value)
const
= 0;
171
virtual
std::string
GetValueTypeName
(
void
)
const
= 0;
179
virtual
bool
HasUnderlyingTypeInformation
(
void
)
const
= 0;
184
virtual
std::string
GetUnderlyingTypeInformation
(
void
)
const
= 0;
192
virtual
Ptr<AttributeValue>
Create
(
void
)
const
= 0;
193
194
virtual
bool
Copy (
const
AttributeValue
&source,
AttributeValue
&destination)
const
= 0;
195
196
197
};
198
204
class
EmptyAttributeValue
:
public
AttributeValue
205
{
206
public
:
207
EmptyAttributeValue
();
208
private
:
209
virtual
Ptr<AttributeValue>
Copy
(
void
)
const
;
210
virtual
std::string
SerializeToString
(
Ptr<const AttributeChecker>
checker)
const
;
211
virtual
bool
DeserializeFromString
(std::string value,
Ptr<const AttributeChecker>
checker);
212
};
213
214
}
// namespace ns3
215
216
#endif
/* ATTRIBUTE_H */
ns3::AttributeChecker
Represent the type of an attribute.
Definition:
attribute.h:149
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:51
ns3::AttributeAccessor::Get
virtual bool Get(const ObjectBase *object, AttributeValue &attribute) const =0
ns3::EmptyAttributeValue::DeserializeFromString
virtual bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker)
Definition:
attribute.cc:98
ns3::AttributeAccessor::HasGetter
virtual bool HasGetter(void) const =0
ns3::ObjectBase
implement the ns-3 type and attribute system
Definition:
object-base.h:55
ns3::AttributeChecker::HasUnderlyingTypeInformation
virtual bool HasUnderlyingTypeInformation(void) const =0
ns3::AttributeAccessor::HasSetter
virtual bool HasSetter(void) const =0
ns3::AttributeValue::SerializeToString
virtual std::string SerializeToString(Ptr< const AttributeChecker > checker) const =0
ns3::EmptyAttributeValue
A class for an empty attribute value.
Definition:
attribute.h:204
ns3::AttributeChecker::GetValueTypeName
virtual std::string GetValueTypeName(void) const =0
ns3::EmptyAttributeValue::SerializeToString
virtual std::string SerializeToString(Ptr< const AttributeChecker > checker) const
Definition:
attribute.cc:92
ns3::AttributeAccessor
allow setting and getting the value of an attribute.
Definition:
attribute.h:97
ns3::AttributeValue::Copy
virtual Ptr< AttributeValue > Copy(void) const =0
ns3::AttributeAccessor::Set
virtual bool Set(ObjectBase *object, const AttributeValue &value) const =0
ns3::AttributeChecker::Create
virtual Ptr< AttributeValue > Create(void) const =0
ns3::AttributeValue::DeserializeFromString
virtual bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker)=0
ns3::AttributeChecker::Check
virtual bool Check(const AttributeValue &value) const =0
ns3::AttributeChecker::GetUnderlyingTypeInformation
virtual std::string GetUnderlyingTypeInformation(void) const =0
ns3::SimpleRefCount
A template-based reference counting class.
Definition:
simple-ref-count.h:63
ns3::EmptyAttributeValue::Copy
virtual Ptr< AttributeValue > Copy(void) const
Definition:
attribute.cc:86
src
core
model
attribute.h
Generated on Sun Mar 16 2014 11:25:02 for ns-3 by
1.8.6