blob: 31f76dacf16e7813140b86bb451838c6f1b56e26 [file] [log] [blame]
Ilya Moiseenkoa1214112011-08-29 13:03:55 -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_PRODUCER_HELPER_H
22#define CCNX_PRODUCER_HELPER_H
23
Ilya Moiseenkoa1214112011-08-29 13:03:55 -070024#include "ns3/object-factory.h"
Ilya Moiseenkoa1214112011-08-29 13:03:55 -070025#include "ns3/attribute.h"
Ilya Moiseenkoa1214112011-08-29 13:03:55 -070026#include "ns3/node-container.h"
27#include "ns3/application-container.h"
Alexander Afanasyev07827182011-12-13 01:07:32 -080028#include "ns3/ptr.h"
Ilya Moiseenkoa1214112011-08-29 13:03:55 -070029
30namespace ns3
31{
32/**
33* \brief A helper to make it easier to instantiate an ns3::CcnxProducer application
34* on a set of nodes.
35*/
Alexander Afanasyev07827182011-12-13 01:07:32 -080036
37class Node;
38
Ilya Moiseenkoa1214112011-08-29 13:03:55 -070039class CcnxProducerHelper
40{
41public:
42/**
43* Create an CcnxProducerHelper to make it easier to work with CcnxProducer applications
44*
45*/
Ilya Moiseenkofb2362f2011-10-28 13:08:05 -070046CcnxProducerHelper (const std::string &prefix, uint32_t virtualPayloadSize);
Ilya Moiseenkoa1214112011-08-29 13:03:55 -070047
48/**
49* Helper function used to set the underlying application attributes.
50*
51* \param name the name of the application attribute to set
52* \param value the value of the application attribute to set
53*/
54void SetAttribute (std::string name, const AttributeValue &value);
55
56/**
57* Install an ns3::CcnxProducer on each node of the input container
58* configured with all the attributes set with SetAttribute.
59*
60* \param c NodeContainer of the set of nodes on which an CcnxProducer
61* will be installed.
62* \returns Container of Ptr to the applications installed.
63*/
64ApplicationContainer Install (NodeContainer c);
65
66/**
67* Install an ns3::CcnxProducer on the node configured with all the
68* attributes set with SetAttribute.
69*
70* \param node The node on which an CcnxProducer will be installed.
71* \returns Container of Ptr to the applications installed.
72*/
73ApplicationContainer Install (Ptr<Node> node);
74
75/**
76* Install an ns3::CcnxProducer on the node configured with all the
77* attributes set with SetAttribute.
78*
79* \param nodeName The node on which an CcnxProducer will be installed.
80* \returns Container of Ptr to the applications installed.
81*/
82ApplicationContainer Install (std::string nodeName);
83
84private:
85/**
86* \internal
87* Install an ns3::CcnxProducer on the node configured with all the
88* attributes set with SetAttribute.
89*
90* \param node The node on which an CcnxProducer will be installed.
91* \returns Ptr to the application installed.
92*/
93Ptr<Application> InstallPriv (Ptr<Node> node);
94ObjectFactory m_factory;
95
96};
97}
98
99#endif
100