OLD | NEW |
(Empty) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2013 Mohammed J.F. Alenazi |
| 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 * Author: Mohammed J.F. Alenazi <malenazi@ittc.ku.edu> |
| 19 * |
| 20 * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director |
| 21 * ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets |
| 22 * Information and Telecommunication Technology Center (ITTC) |
| 23 * and Department of Electrical Engineering and Computer Science |
| 24 * The University of Kansas Lawrence, KS USA. |
| 25 * |
| 26 * Work supported by King Saud University and |
| 27 * the ITTC at The University of Kansas. |
| 28 */ |
| 29 |
| 30 #include "epidemic-helper.h" |
| 31 #include "ns3/epidemic-routing-protocol.h" |
| 32 |
| 33 /** |
| 34 * \file |
| 35 * \ingroup epidemic |
| 36 * ns3::EpidemicHelper implementation. |
| 37 */ |
| 38 |
| 39 namespace ns3 { |
| 40 |
| 41 NS_LOG_COMPONENT_DEFINE ("EpidemicHelper"); |
| 42 |
| 43 EpidemicHelper::~EpidemicHelper () |
| 44 { |
| 45 NS_LOG_FUNCTION (this); |
| 46 } |
| 47 |
| 48 EpidemicHelper::EpidemicHelper () : Ipv4RoutingHelper () |
| 49 { |
| 50 NS_LOG_FUNCTION (this); |
| 51 m_agentFactory.SetTypeId ("ns3::Epidemic::RoutingProtocol"); |
| 52 } |
| 53 |
| 54 EpidemicHelper* EpidemicHelper::Copy (void) const |
| 55 { |
| 56 NS_LOG_FUNCTION (this); |
| 57 return new EpidemicHelper (*this); |
| 58 } |
| 59 |
| 60 Ptr<Ipv4RoutingProtocol> EpidemicHelper::Create (Ptr<Node> node) const |
| 61 { |
| 62 NS_LOG_FUNCTION (this << node); |
| 63 Ptr<Epidemic::RoutingProtocol> |
| 64 agent = m_agentFactory.Create<Epidemic::RoutingProtocol> (); |
| 65 node->AggregateObject (agent); |
| 66 return agent; |
| 67 } |
| 68 |
| 69 void EpidemicHelper::Set (std::string name, const AttributeValue &value) |
| 70 { |
| 71 NS_LOG_FUNCTION (this << name); |
| 72 m_agentFactory.Set (name, value); |
| 73 } |
| 74 |
| 75 } //end namespace ns3 |
OLD | NEW |