src/helper/application-container.h
author Craig Dowell <craigdo@ee.washington.edu>
Tue, 20 Jan 2009 17:39:18 -0800
changeset 4140 6bbf05bf4826
parent 3997 a66553c56a8f
child 5361 e8989b44bffb
permissions -rw-r--r--
Brute force all of the helpers to use object name service
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2833
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
     2
/*
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
     3
 * Copyright (c) 2008 INRIA
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
     4
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
     7
 * published by the Free Software Foundation;
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
     8
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
    12
 * GNU General Public License for more details.
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
    13
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
    14
 * You should have received a copy of the GNU General Public License
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
    15
 * along with this program; if not, write to the Free Software
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
    17
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2731
diff changeset
    19
 */
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    20
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    21
#ifndef APPLICATION_CONTAINER_H
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    22
#define APPLICATION_CONTAINER_H
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
#include <stdint.h>
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
#include <vector>
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    26
#include "ns3/application.h"
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
namespace ns3 {
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    30
/**
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    31
 * \brief holds a vector of ns3::Application pointers
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    32
 *
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    33
 */
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    34
class ApplicationContainer
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
{
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
public:
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    37
  /**
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    38
   * Create an empty ApplicationContainer.
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    39
   */
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    40
  ApplicationContainer ();
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    41
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    42
  /**
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    43
   * Create an ApplicationContainer with exactly one application
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    44
   *
3997
a66553c56a8f make a pass through doxygen fixing errors
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
    45
   * \param application The application to add to the container
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    46
   */
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    47
  ApplicationContainer (Ptr<Application> application);
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 2836
diff changeset
    48
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    49
  /**
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    50
   * Create an ApplicationContainer with exactly one application
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    51
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    52
   * \param name The name of the application object to add to the container
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    53
   */
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    54
  ApplicationContainer (std::string name);
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    55
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    56
  typedef std::vector<Ptr<Application> >::const_iterator Iterator;
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    57
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    58
  /**
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    59
   * \returns an iterator which points to the start of the array of pointers.
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    60
   */
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
  Iterator Begin (void) const;
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    62
  /**
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    63
   * \returns an iterator which points to the end of the array of pointers.
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    64
   */
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    65
  Iterator End (void) const;
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    66
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    67
  /**
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    68
   * \returns the number of application pointers stored in this container.
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    69
   */
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    70
  uint32_t GetN (void) const;
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    71
  /**
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    72
   * \param i the index of the requested application pointer.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    73
   * \returns the requested application pointer.
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    74
   */
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    75
  Ptr<Application> Get (uint32_t i) const;
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    76
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    77
  /**
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    78
   * Append to the end of this container the other input container.
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    79
   *
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    80
   * \param other another application container
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    81
   */
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    82
  void Add (ApplicationContainer other);
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    83
  /**
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    84
   * Append to the end of this container the input application pointer.
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    85
   *
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    86
   * \param application another netdevice pointer.
2698
4074ec514771 doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2603
diff changeset
    87
   */
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    88
  void Add (Ptr<Application> application);
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    89
  /**
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    90
   * Append to the end of this container the application specified by the name.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    91
   *
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    92
   * \param name The name of the application object to add to the container.
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    93
   */
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3997
diff changeset
    94
  void Add (std::string name);
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    95
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    96
  void Start (Time start);
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
    97
  void Stop (Time stop);
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    98
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    99
private:
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
   100
  std::vector<Ptr<Application> > m_applications;
2417
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   101
};
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   102
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   103
} // namespace ns3
004ac83aca83 add device/node containers for helper API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   104
2731
9eb9988afd08 a bunch of new helpers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2698
diff changeset
   105
#endif /* APPLICATION_CONTAINER_H */