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
attribute.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 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 */
src
core
model
attribute.h
Generated on Tue May 14 2013 11:08:17 for ns-3 by
1.8.1.2