src/energy/model/device-energy-model-container.h
author Mitch Watrous <watrous@u.washington.edu>
Tue, 22 Mar 2011 16:40:32 -0700
changeset 6938 85d201f1c67f
parent 6535 src/contrib/energy/model/device-energy-model-container.h@0a90ef2b29a9
child 7238 85a7e87bb4cc
permissions -rw-r--r--
Move energy module out of contrib directory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6535
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
     2
/*
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
     3
 * Copyright (c) 2008 INRIA
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
     4
 * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
     5
 *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
     6
 * This program is free software; you can redistribute it and/or modify
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
     7
 * it under the terms of the GNU General Public License version 2 as
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
     8
 * published by the Free Software Foundation;
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
     9
 *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    13
 * GNU General Public License for more details.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    14
 *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    16
 * along with this program; if not, write to the Free Software
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    18
 *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    19
 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    20
 *          Sidharth Nabar <snabar@uw.edu>, He Wu <mdzz@u.washington.edu>
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    21
 */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    22
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    23
#ifndef DEVICE_ENERGY_MODEL_CONTAINER_H
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    24
#define DEVICE_ENERGY_MODEL_CONTAINER_H
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    25
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    26
#include "ns3/device-energy-model.h"
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    27
#include <vector>
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    28
#include <stdint.h>
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    29
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    30
namespace ns3 {
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    31
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    32
/**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    33
 * \brief Holds a vector of ns3::DeviceEnergyModel pointers.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    34
 *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    35
 * DeviceEnergyModelContainer returns a list of DeviceEnergyModel pointers
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    36
 * installed on a node. Users can use this list to access DeviceEnergyModel
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    37
 * objects to obtain total device energy consumption on a node easily.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    38
 *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    39
 * \see NetDeviceContainer
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    40
 */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    41
class DeviceEnergyModelContainer
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    42
{
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    43
public:
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    44
  typedef std::vector< Ptr<DeviceEnergyModel> >::const_iterator Iterator;
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    45
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    46
public:
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    47
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    48
   * Creates an empty DeviceEnergyModelContainer.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    49
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    50
  DeviceEnergyModelContainer ();
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    51
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    52
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    53
   * \param model Pointer to a DeviceEnergyModel.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    54
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    55
   * Creates a DeviceEnergyModelContainer with exactly one DeviceEnergyModel
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    56
   * previously instantiated.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    57
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    58
  DeviceEnergyModelContainer (Ptr<DeviceEnergyModel> model);
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    59
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    60
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    61
   * \param modelName Name of DeviceEnergyModel.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    62
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    63
   * Creates an DeviceEnergyModelContainer with exactly one DeviceEnergyModel
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    64
   * previously instantiated and assigned a name using the Object name service.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    65
   * This DeviceEnergyModel is specified by its assigned name.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    66
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    67
  DeviceEnergyModelContainer (std::string modelName);
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    68
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    69
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    70
   * \param a A DeviceEnergyModelContainer.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    71
   * \param b Another DeviceEnergyModelContainer.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    72
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    73
   * Creates a DeviceEnergyModelContainer by concatenating DeviceEnergyModelContainer b
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    74
   * to DeviceEnergyModelContainer a.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    75
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    76
   * \note Can be used to concatenate 2 Ptr<DeviceEnergyModel> directly. C++
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    77
   * will be calling DeviceEnergyModelContainer constructor with Ptr<DeviceEnergyModel>
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    78
   * first.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    79
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    80
  DeviceEnergyModelContainer (const DeviceEnergyModelContainer &a,
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    81
                              const DeviceEnergyModelContainer &b);
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    82
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    83
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    84
   * \brief Get an iterator which refers to the first DeviceEnergyModel pointer
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    85
   * in the container.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    86
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    87
   * \returns An iterator which refers to the first DeviceEnergyModel in container.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    88
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    89
   * DeviceEnergyModels can be retrieved from the container in two ways. First,
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    90
   * directly by an index into the container, and second, using an iterator.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    91
   * This method is used in the iterator method and is typically used in a
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    92
   * for-loop to run through the DeviceEnergyModels.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    93
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    94
   * \code
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    95
   *   DeviceEnergyModelContainer::Iterator i;
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    96
   *   for (i = container.Begin (); i != container.End (); ++i)
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    97
   *     {
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    98
   *       (*i)->method ();  // some DeviceEnergyModel method
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
    99
   *     }
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   100
   * \endcode
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   101
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   102
  Iterator Begin (void) const;
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   103
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   104
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   105
   * \brief Get an iterator which refers to the last DeviceEnergyModel pointer
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   106
   * in the container.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   107
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   108
   * \returns An iterator which refers to the last DeviceEnergyModel in container.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   109
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   110
   * DeviceEnergyModels can be retrieved from the container in two ways. First,
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   111
   * directly by an index into the container, and second, using an iterator.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   112
   * This method is used in the iterator method and is typically used in a
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   113
   * for-loop to run through the DeviceEnergyModels.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   114
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   115
   * \code
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   116
   *   DeviceEnergyModelContainer::Iterator i;
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   117
   *   for (i = container.Begin (); i != container.End (); ++i)
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   118
   *     {
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   119
   *       (*i)->method ();  // some DeviceEnergyModel method
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   120
   *     }
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   121
   * \endcode
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   122
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   123
  Iterator End (void) const;
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   124
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   125
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   126
   * \brief Get the number of Ptr<DeviceEnergyModel> stored in this container.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   127
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   128
   * \returns The number of Ptr<DeviceEnergyModel> stored in this container.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   129
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   130
  uint32_t GetN (void) const;
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   131
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   132
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   133
   * \brief Get the i-th Ptr<DeviceEnergyModel> stored in this container.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   134
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   135
   * \param i Index of the requested Ptr<DeviceEnergyModel>.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   136
   * \returns The requested Ptr<DeviceEnergyModel>.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   137
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   138
  Ptr<DeviceEnergyModel> Get (uint32_t i) const;
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   139
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   140
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   141
   * \param container Another DeviceEnergyModelContainer.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   142
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   143
   * Appends the contents of another DeviceEnergyModelContainer to the end of
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   144
   * this DeviceEnergyModelContainer.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   145
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   146
  void Add (DeviceEnergyModelContainer container);
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   147
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   148
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   149
   * \brief Append a single Ptr<DeviceEnergyModel> to the end of this container.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   150
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   151
   * \param model Pointer to an DeviceEnergyModel.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   152
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   153
  void Add (Ptr<DeviceEnergyModel> model);
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   154
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   155
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   156
   * \brief Append a single Ptr<DeviceEnergyModel> referred to by its object
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   157
   * name to the end of this container.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   158
   *
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   159
   * \param modelName Name of DeviceEnergyModel object.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   160
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   161
  void Add (std::string modelName);
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   162
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   163
  /**
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   164
   * \brief Removes all elements in the container.
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   165
   */
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   166
  void Clear (void);
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   167
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   168
private:
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   169
  std::vector< Ptr<DeviceEnergyModel> > m_models;
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   170
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   171
};
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   172
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   173
} // namespace ns3
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   174
0a90ef2b29a9 Apply energy model changes of http://codereview.appspot.com/1008043/show patchset 13
He Wu <mdzz@u.washington.edu>
parents:
diff changeset
   175
#endif /* DEVICE_ENERGY_MODEL_CONTAINER_H */