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
object-base.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 OBJECT_BASE_H
21
#define OBJECT_BASE_H
22
23
#include "
type-id.h
"
24
#include "
callback.h
"
25
#include <string>
26
#include <list>
27
32
#define NS_OBJECT_ENSURE_REGISTERED(type) \
33
static struct X ## type ## RegistrationClass \
34
{ \
35
X ## type ## RegistrationClass () { \
36
ns3::TypeId tid = type::GetTypeId (); \
37
tid.GetParent (); \
38
} \
39
} x_ ## type ## RegistrationVariable
40
41
namespace
ns3 {
42
43
class
AttributeConstructionList;
44
55
class
ObjectBase
56
{
57
public
:
58
static
TypeId
GetTypeId
(
void
);
59
60
virtual
~ObjectBase
();
61
70
virtual
TypeId
GetInstanceTypeId
(
void
)
const
= 0;
71
79
void
SetAttribute
(std::string name,
const
AttributeValue
&value);
86
bool
SetAttributeFailSafe
(std::string name,
const
AttributeValue
&value);
94
void
GetAttribute
(std::string name,
AttributeValue
&value)
const
;
100
bool
GetAttributeFailSafe
(std::string name,
AttributeValue
&attribute)
const
;
101
109
bool
TraceConnect
(std::string name, std::string context,
const
CallbackBase
&cb);
116
bool
TraceConnectWithoutContext
(std::string name,
const
CallbackBase
&cb);
124
bool
TraceDisconnect
(std::string name, std::string context,
const
CallbackBase
&cb);
131
bool
TraceDisconnectWithoutContext
(std::string name,
const
CallbackBase
&cb);
132
133
protected
:
140
virtual
void
NotifyConstructionCompleted
(
void
);
152
void
ConstructSelf
(
const
AttributeConstructionList
&attributes);
153
154
private
:
155
bool
DoSet
(
Ptr<const AttributeAccessor>
spec,
156
Ptr<const AttributeChecker>
checker,
157
const
AttributeValue
&value);
158
159
};
160
161
}
// namespace ns3
162
163
#endif
/* OBJECT_BASE_H */
src
core
model
object-base.h
Generated on Fri Dec 21 2012 19:00:32 for ns-3 by
1.8.1.2