blob: b58b41f289180052820a14acc13d8da77598151c [file] [log] [blame]
Ilya Moiseenko171afe12011-08-23 16:02:16 -07001/* -*- 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 Moiseenkod26e6822011-08-23 17:48:38 -070032#include "ns3/ccnx-name-components.h"
Ilya Moiseenko171afe12011-08-23 16:02:16 -070033#include "ns3/pointer.h"
Ilya Moiseenko946b87b2011-08-23 17:37:54 -070034#include "ns3/ccnx-local-face.h"
Ilya Moiseenko171afe12011-08-23 16:02:16 -070035
36namespace ns3
37{
38/**
39 * \brief A helper to make it easier to instantiate an ns3::CcnxInterestSenderApplication
40 * on a set of nodes.
41 */
42
43class CcnxInterestSenderHelper
44{
45
46public:
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 Moiseenko946b87b2011-08-23 17:37:54 -070069 ApplicationContainer Install (NodeContainer c);
Ilya Moiseenko171afe12011-08-23 16:02:16 -070070
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 Moiseenko946b87b2011-08-23 17:37:54 -070078 ApplicationContainer Install (Ptr<Node> node);
Ilya Moiseenko171afe12011-08-23 16:02:16 -070079
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 Moiseenko946b87b2011-08-23 17:37:54 -070087 ApplicationContainer Install (std::string nodeName);
Ilya Moiseenko171afe12011-08-23 16:02:16 -070088
89private:
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 Moiseenko946b87b2011-08-23 17:37:54 -070098 Ptr<Application> InstallPriv (Ptr<Node> node);
Ilya Moiseenko171afe12011-08-23 16:02:16 -070099 ObjectFactory m_factory;
100};
101}
102
103#endif
104