2007-02-08 11:13:49 +01:00
|
|
|
// -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*-
|
2007-02-08 11:11:24 +01:00
|
|
|
//
|
|
|
|
|
// Copyright (c) 2006 Georgia Tech Research Corporation
|
|
|
|
|
// All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License version 2 as
|
|
|
|
|
// published by the Free Software Foundation;
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
//
|
|
|
|
|
// Author: George F. Riley<riley@ece.gatech.edu>
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
// Define the basic Node object for ns3.
|
|
|
|
|
// George F. Riley, Georgia Tech, Fall 2006
|
|
|
|
|
|
2007-03-22 14:54:20 -04:00
|
|
|
#ifndef __NODE_H__
|
|
|
|
|
#define __NODE_H__
|
2007-02-08 11:11:24 +01:00
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2007-05-11 18:42:39 +02:00
|
|
|
#include "ns3/interface.h"
|
2007-03-19 22:19:38 -07:00
|
|
|
|
2007-02-08 11:11:24 +01:00
|
|
|
namespace ns3 {
|
|
|
|
|
|
2007-03-18 14:06:51 -07:00
|
|
|
class TraceContext;
|
|
|
|
|
class TraceResolver;
|
2007-04-30 10:16:04 +02:00
|
|
|
class NetDevice;
|
2007-02-08 11:11:24 +01:00
|
|
|
|
2007-05-11 18:52:05 +02:00
|
|
|
class Node : public Interface
|
2007-05-02 13:44:41 +02:00
|
|
|
{
|
2007-02-08 11:11:24 +01:00
|
|
|
public:
|
2007-05-06 11:20:12 +02:00
|
|
|
static const Iid iid;
|
2007-05-03 11:08:13 +02:00
|
|
|
|
2007-02-08 11:11:24 +01:00
|
|
|
Node();
|
2007-03-19 22:19:38 -07:00
|
|
|
Node(uint32_t); // Specify which system for a distributed simulation
|
2007-02-08 11:11:24 +01:00
|
|
|
virtual ~Node();
|
2007-02-12 16:01:18 +01:00
|
|
|
|
2007-03-18 14:06:51 -07:00
|
|
|
virtual TraceResolver *CreateTraceResolver (TraceContext const &context) = 0;
|
|
|
|
|
|
2007-02-12 16:01:18 +01:00
|
|
|
uint32_t GetId (void) const;
|
|
|
|
|
uint32_t GetSystemId (void) const;
|
|
|
|
|
void SetSystemId(uint32_t s);
|
2007-02-08 11:11:24 +01:00
|
|
|
|
2007-05-10 20:19:26 +02:00
|
|
|
uint32_t AddDevice (Ptr<NetDevice> device);
|
|
|
|
|
Ptr<NetDevice> GetDevice (uint32_t index) const;
|
2007-04-30 10:16:04 +02:00
|
|
|
uint32_t GetNDevices (void) const;
|
|
|
|
|
|
2007-05-03 12:33:08 +02:00
|
|
|
protected:
|
|
|
|
|
virtual void DoDispose (void);
|
2007-04-30 10:16:04 +02:00
|
|
|
private:
|
2007-05-10 20:19:26 +02:00
|
|
|
virtual void DoAddDevice (Ptr<NetDevice> device) const = 0;
|
2007-04-30 10:16:04 +02:00
|
|
|
|
2007-02-12 16:01:18 +01:00
|
|
|
uint32_t m_id; // Node id for this node
|
|
|
|
|
uint32_t m_sid; // System id for this node
|
2007-05-10 20:19:26 +02:00
|
|
|
std::vector<Ptr<NetDevice> > m_devices;
|
2007-02-08 11:11:24 +01:00
|
|
|
};
|
|
|
|
|
|
2007-03-19 22:19:38 -07:00
|
|
|
} //namespace ns3
|
2007-02-08 11:11:24 +01:00
|
|
|
#endif
|