Ilya Moiseenko | 171afe1 | 2011-08-23 16:02:16 -0700 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2011 University of California, Los Angeles |
| 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: Ilya Moiseenko <iliamo@cs.ucla.edu> |
| 19 | */ |
| 20 | |
| 21 | #ifndef CCNX_INTEREST_SENDER_HELPER_H |
| 22 | #define CCNX_INTEREST_SENDER_HELPER_H |
| 23 | |
| 24 | #include <stdint.h> |
| 25 | #include <string> |
| 26 | #include "ns3/object-factory.h" |
| 27 | #include "ns3/address.h" |
| 28 | #include "ns3/attribute.h" |
| 29 | #include "ns3/net-device.h" |
| 30 | #include "ns3/node-container.h" |
| 31 | #include "ns3/application-container.h" |
Ilya Moiseenko | d26e682 | 2011-08-23 17:48:38 -0700 | [diff] [blame] | 32 | #include "ns3/ccnx-name-components.h" |
Ilya Moiseenko | 171afe1 | 2011-08-23 16:02:16 -0700 | [diff] [blame] | 33 | #include "ns3/pointer.h" |
Ilya Moiseenko | 946b87b | 2011-08-23 17:37:54 -0700 | [diff] [blame] | 34 | #include "ns3/ccnx-local-face.h" |
Ilya Moiseenko | 171afe1 | 2011-08-23 16:02:16 -0700 | [diff] [blame] | 35 | |
| 36 | namespace ns3 |
| 37 | { |
| 38 | /** |
| 39 | * \brief A helper to make it easier to instantiate an ns3::CcnxInterestSenderApplication |
| 40 | * on a set of nodes. |
| 41 | */ |
| 42 | |
| 43 | class CcnxInterestSenderHelper |
| 44 | { |
| 45 | |
| 46 | public: |
| 47 | /** |
| 48 | * Create an CcnxInterestSenderHelper to make it easier to work with CcnxInterestSenderApps |
| 49 | * |
| 50 | */ |
| 51 | CcnxInterestSenderHelper (Ptr<CcnxNameComponents> interestName); |
| 52 | |
| 53 | /** |
| 54 | * Helper function used to set the underlying application attributes. |
| 55 | * |
| 56 | * \param name the name of the application attribute to set |
| 57 | * \param value the value of the application attribute to set |
| 58 | */ |
| 59 | void SetAttribute (std::string name, const AttributeValue &value); |
| 60 | |
| 61 | /** |
| 62 | * Install an ns3::CcnxInterestSender on each node of the input container |
| 63 | * configured with all the attributes set with SetAttribute. |
| 64 | * |
| 65 | * \param c NodeContainer of the set of nodes on which an CcnxInterestSender |
| 66 | * will be installed. |
| 67 | * \returns Container of Ptr to the applications installed. |
| 68 | */ |
Ilya Moiseenko | 946b87b | 2011-08-23 17:37:54 -0700 | [diff] [blame] | 69 | ApplicationContainer Install (NodeContainer c); |
Ilya Moiseenko | 171afe1 | 2011-08-23 16:02:16 -0700 | [diff] [blame] | 70 | |
| 71 | /** |
| 72 | * Install an ns3::CcnxInterestSender on the node configured with all the |
| 73 | * attributes set with SetAttribute. |
| 74 | * |
| 75 | * \param node The node on which an CcnxInterestSender will be installed. |
| 76 | * \returns Container of Ptr to the applications installed. |
| 77 | */ |
Ilya Moiseenko | 946b87b | 2011-08-23 17:37:54 -0700 | [diff] [blame] | 78 | ApplicationContainer Install (Ptr<Node> node); |
Ilya Moiseenko | 171afe1 | 2011-08-23 16:02:16 -0700 | [diff] [blame] | 79 | |
| 80 | /** |
| 81 | * Install an ns3::CcnxInterestSender on the node configured with all the |
| 82 | * attributes set with SetAttribute. |
| 83 | * |
| 84 | * \param nodeName The node on which an CcnxInterestSender will be installed. |
| 85 | * \returns Container of Ptr to the applications installed. |
| 86 | */ |
Ilya Moiseenko | 946b87b | 2011-08-23 17:37:54 -0700 | [diff] [blame] | 87 | ApplicationContainer Install (std::string nodeName); |
Ilya Moiseenko | 171afe1 | 2011-08-23 16:02:16 -0700 | [diff] [blame] | 88 | |
| 89 | private: |
| 90 | /** |
| 91 | * \internal |
| 92 | * Install an ns3::CcnxInterestSender on the node configured with all the |
| 93 | * attributes set with SetAttribute. |
| 94 | * |
| 95 | * \param node The node on which an CcnxInterestSender will be installed. |
| 96 | * \returns Ptr to the application installed. |
| 97 | */ |
Ilya Moiseenko | 946b87b | 2011-08-23 17:37:54 -0700 | [diff] [blame] | 98 | Ptr<Application> InstallPriv (Ptr<Node> node); |
Ilya Moiseenko | 171afe1 | 2011-08-23 16:02:16 -0700 | [diff] [blame] | 99 | ObjectFactory m_factory; |
| 100 | }; |
| 101 | } |
| 102 | |
| 103 | #endif |
| 104 | |