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
47
#define NS_OBJECT_ENSURE_REGISTERED(type) \
48
static struct X ## type ## RegistrationClass \
49
{ \
50
X ## type ## RegistrationClass () { \
51
ns3::TypeId tid = type::GetTypeId (); \
52
tid.GetParent (); \
53
} \
54
} x_ ## type ## RegistrationVariable
55
56
namespace
ns3 {
57
58
class
AttributeConstructionList;
59
70
class
ObjectBase
71
{
72
public
:
76
static
TypeId
GetTypeId
(
void
);
77
81
virtual
~ObjectBase
();
82
91
virtual
TypeId
GetInstanceTypeId
(
void
)
const
= 0;
92
100
void
SetAttribute
(std::string name,
const
AttributeValue
&value);
107
bool
SetAttributeFailSafe
(std::string name,
const
AttributeValue
&value);
115
void
GetAttribute
(std::string name,
AttributeValue
&value)
const
;
121
bool
GetAttributeFailSafe
(std::string name,
AttributeValue
&attribute)
const
;
122
130
bool
TraceConnect
(std::string name, std::string context,
const
CallbackBase
&cb);
137
bool
TraceConnectWithoutContext
(std::string name,
const
CallbackBase
&cb);
145
bool
TraceDisconnect
(std::string name, std::string context,
const
CallbackBase
&cb);
152
bool
TraceDisconnectWithoutContext
(std::string name,
const
CallbackBase
&cb);
153
154
protected
:
161
virtual
void
NotifyConstructionCompleted
(
void
);
173
void
ConstructSelf
(
const
AttributeConstructionList
&attributes);
174
175
private
:
176
bool
DoSet
(
Ptr<const AttributeAccessor>
spec,
177
Ptr<const AttributeChecker>
checker,
178
const
AttributeValue
&value);
179
180
};
181
182
}
// namespace ns3
183
184
#endif
/* OBJECT_BASE_H */
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::ObjectBase::~ObjectBase
virtual ~ObjectBase()
Virtual destructor.
Definition:
object-base.cc:54
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:56
ns3::CallbackBase
Base class for Callback class.
Definition:
callback.h:844
ns3::ObjectBase::SetAttributeFailSafe
bool SetAttributeFailSafe(std::string name, const AttributeValue &value)
Definition:
object-base.cc:181
ns3::ObjectBase::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
object-base.cc:47
ns3::ObjectBase
implement the ns-3 type and attribute system
Definition:
object-base.h:70
callback.h
ns3::ObjectBase::TraceDisconnect
bool TraceDisconnect(std::string name, std::string context, const CallbackBase &cb)
Definition:
object-base.cc:308
ns3::AttributeConstructionList
Definition:
attribute-construction-list.h:28
ns3::ObjectBase::NotifyConstructionCompleted
virtual void NotifyConstructionCompleted(void)
This method is invoked once all member attributes have been initialized.
Definition:
object-base.cc:60
ns3::ObjectBase::TraceDisconnectWithoutContext
bool TraceDisconnectWithoutContext(std::string name, const CallbackBase &cb)
Definition:
object-base.cc:295
ns3::ObjectBase::TraceConnectWithoutContext
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Definition:
object-base.cc:269
type-id.h
ns3::ObjectBase::ConstructSelf
void ConstructSelf(const AttributeConstructionList &attributes)
Definition:
object-base.cc:66
ns3::ObjectBase::GetAttribute
void GetAttribute(std::string name, AttributeValue &value) const
Definition:
object-base.cc:199
ns3::ObjectBase::DoSet
bool DoSet(Ptr< const AttributeAccessor > spec, Ptr< const AttributeChecker > checker, const AttributeValue &value)
Definition:
object-base.cc:146
ns3::ObjectBase::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const =0
ns3::ObjectBase::TraceConnect
bool TraceConnect(std::string name, std::string context, const CallbackBase &cb)
Definition:
object-base.cc:282
ns3::ObjectBase::GetAttributeFailSafe
bool GetAttributeFailSafe(std::string name, AttributeValue &attribute) const
Definition:
object-base.cc:234
ns3::ObjectBase::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Definition:
object-base.cc:161
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
src
core
model
object-base.h
Generated on Sat Apr 19 2014 14:06:52 for ns-3 by
1.8.6