src/core/traced-callback.h
author Pavel Boyko <boyko@iitp.ru>
Tue, 14 Jul 2009 16:05:23 +0400
changeset 5581 d74aff108ddc
parent 4072 5d226c752e85
permissions -rw-r--r--
AodvProtocol in progress, doesn't work
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     2
/*
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     3
 * Copyright (c) 2005,2006,2007 INRIA
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     4
 *
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     8
 *
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    12
 * GNU General Public License for more details.
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    13
 *
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    17
 *
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    19
 */
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    20
2482
adbc284a5849 EventTraceSource -> TracedCallback, ValueTraceSource -> TracedValue.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2466
diff changeset
    21
#ifndef TRACED_CALLBACK_H
adbc284a5849 EventTraceSource -> TracedCallback, ValueTraceSource -> TracedValue.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2466
diff changeset
    22
#define TRACED_CALLBACK_H
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    23
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    24
#include <list>
1335
d0e45d84f9c6 fix includes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1334
diff changeset
    25
#include "callback.h"
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    26
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    27
namespace ns3 {
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    28
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    29
/**
2779
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    30
 * \brief forward calls to a chain of Callback
1389
93f575998efc s/lowleveltracing/tracing/
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1361
diff changeset
    31
 * \ingroup tracing
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    32
 *
2779
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    33
 * An ns3::TracedCallback has almost exactly the same API as a normal ns3::Callback but
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    34
 * instead of forwarding calls to a single function (as an ns3::Callback normally does),
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    35
 * it forwards calls to a chain of ns3::Callback. TracedCallback::Connect adds a ns3::Callback
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    36
 * at the end of the chain of callbacks. TracedCallback::Disconnect removes a ns3::Callback from
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    37
 * the chain of callbacks.
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    38
 */
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    39
template<typename T1 = empty, typename T2 = empty, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
    40
         typename T3 = empty, typename T4 = empty,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
    41
         typename T5 = empty, typename T6 = empty,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
    42
         typename T7 = empty, typename T8 = empty>
2482
adbc284a5849 EventTraceSource -> TracedCallback, ValueTraceSource -> TracedValue.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2466
diff changeset
    43
class TracedCallback 
2462
93028d4474ba add an IntegerTraceSource which behaves just like an Integer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1419
diff changeset
    44
{
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    45
public:
2482
adbc284a5849 EventTraceSource -> TracedCallback, ValueTraceSource -> TracedValue.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2466
diff changeset
    46
  TracedCallback ();
2779
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    47
  /**
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    48
   * \param callback callback to add to chain of callbacks
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    49
   *
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    50
   * Append the input callback to the end of the internal list 
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    51
   * of ns3::Callback.
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    52
   */
2594
a8f89acd17a1 Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2569
diff changeset
    53
  void ConnectWithoutContext (const CallbackBase & callback);
2779
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    54
  /**
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    55
   * \param callback callback to add to chain of callbacks
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    56
   * \param path the path to send back to the user callback.
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    57
   *
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    58
   * Append the input callback to the end of the internal list 
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    59
   * of ns3::Callback. This method also will make sure that the
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    60
   * input path specified by the user will be give back to the
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    61
   * user's callback as its first argument. 
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    62
   */
2594
a8f89acd17a1 Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2569
diff changeset
    63
  void Connect (const CallbackBase & callback, std::string path);
2779
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    64
  /**
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    65
   * \param callback callback to remove from the chain of callbacks.
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    66
   *
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    67
   * Remove the input callback from the internal list 
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    68
   * of ns3::Callback. This method is really the symmetric
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    69
   * of the TracedCallback::ConnectWithoutContext method.
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    70
   */
2594
a8f89acd17a1 Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2569
diff changeset
    71
  void DisconnectWithoutContext (const CallbackBase & callback);
2779
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    72
  /**
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    73
   * \param callback callback to remove from the chain of callbacks.
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    74
   * \param path the path which is sent back to the user callback.
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    75
   *
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    76
   * Remove the input callback which has a matching path as first argument 
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    77
   * from the internal list of ns3::Callback. This method is really the symmetric
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    78
   * of the TracedCallback::Connect method.
23d3da8fbb79 improve doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2594
diff changeset
    79
   */
2594
a8f89acd17a1 Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2569
diff changeset
    80
  void Disconnect (const CallbackBase & callback, std::string path);
1343
421d8d4712f9 constify
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1335
diff changeset
    81
  void operator() (void) const;
421d8d4712f9 constify
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1335
diff changeset
    82
  void operator() (T1 a1) const;
421d8d4712f9 constify
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1335
diff changeset
    83
  void operator() (T1 a1, T2 a2) const;
421d8d4712f9 constify
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1335
diff changeset
    84
  void operator() (T1 a1, T2 a2, T3 a3) const;
421d8d4712f9 constify
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1335
diff changeset
    85
  void operator() (T1 a1, T2 a2, T3 a3, T4 a4) const;
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
    86
  void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) const;
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
    87
  void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) const;
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
    88
  void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) const;
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
    89
  void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8) const;
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    90
2531
b451b5fc8b57 implement context-based trace connection
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2482
diff changeset
    91
private:  
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
    92
  typedef std::list<Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> > CallbackList;
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    93
  CallbackList m_callbackList;
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    94
};
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    95
2462
93028d4474ba add an IntegerTraceSource which behaves just like an Integer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1419
diff changeset
    96
} // namespace ns3
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    97
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    98
// implementation below.
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    99
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   100
namespace ns3 {
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   101
1419
ac2a81821ab5 add support for NodeList::ConnectPrinterToAll
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1389
diff changeset
   102
template<typename T1, typename T2, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   103
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   104
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   105
         typename T7, typename T8>
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   106
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::TracedCallback ()
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   107
  : m_callbackList () 
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   108
{}
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   109
template<typename T1, typename T2, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   110
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   111
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   112
         typename T7, typename T8>
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   113
void 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   114
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::ConnectWithoutContext (const CallbackBase & callback)
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   115
{
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   116
  Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> cb;
529
cbd7b6a6ca24 use Callback::Assign
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 393
diff changeset
   117
  cb.Assign (callback);
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   118
  m_callbackList.push_back (cb);
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   119
}
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   120
template<typename T1, typename T2, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   121
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   122
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   123
         typename T7, typename T8>
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   124
void 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   125
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::Connect (const CallbackBase & callback, std::string path)
2531
b451b5fc8b57 implement context-based trace connection
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2482
diff changeset
   126
{
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   127
  Callback<void,std::string,T1,T2,T3,T4,T5,T6,T7,T8> cb;
2531
b451b5fc8b57 implement context-based trace connection
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2482
diff changeset
   128
  cb.Assign (callback);
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   129
  Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> realCb = cb.Bind (path);
2531
b451b5fc8b57 implement context-based trace connection
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2482
diff changeset
   130
  m_callbackList.push_back (realCb);
b451b5fc8b57 implement context-based trace connection
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2482
diff changeset
   131
}
b451b5fc8b57 implement context-based trace connection
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2482
diff changeset
   132
template<typename T1, typename T2, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   133
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   134
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   135
         typename T7, typename T8>
2531
b451b5fc8b57 implement context-based trace connection
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2482
diff changeset
   136
void 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   137
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::DisconnectWithoutContext (const CallbackBase & callback)
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   138
{
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   139
  for (typename CallbackList::iterator i = m_callbackList.begin ();
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   140
       i != m_callbackList.end (); /* empty */)
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   141
    {
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   142
      if ((*i).IsEqual (callback))
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   143
	{
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   144
	  i = m_callbackList.erase (i);
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   145
	}
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   146
      else
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   147
	{
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   148
	  i++;
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   149
	}
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   150
    }
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   151
}
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   152
template<typename T1, typename T2, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   153
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   154
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   155
         typename T7, typename T8>
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   156
void 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   157
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::Disconnect (const CallbackBase & callback, std::string path)
2569
d5cff2968984 make Disconnect work with trace contexts.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2531
diff changeset
   158
{
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   159
  Callback<void,std::string,T1,T2,T3,T4,T5,T6,T7,T8> cb;
2569
d5cff2968984 make Disconnect work with trace contexts.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2531
diff changeset
   160
  cb.Assign (callback);
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   161
  Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> realCb = cb.Bind (path);
2594
a8f89acd17a1 Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2569
diff changeset
   162
  DisconnectWithoutContext (realCb);
2569
d5cff2968984 make Disconnect work with trace contexts.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2531
diff changeset
   163
}
d5cff2968984 make Disconnect work with trace contexts.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2531
diff changeset
   164
template<typename T1, typename T2, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   165
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   166
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   167
         typename T7, typename T8>
2569
d5cff2968984 make Disconnect work with trace contexts.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2531
diff changeset
   168
void 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   169
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (void) const
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   170
{
1343
421d8d4712f9 constify
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1335
diff changeset
   171
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   172
       i != m_callbackList.end (); i++)
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   173
    {
2462
93028d4474ba add an IntegerTraceSource which behaves just like an Integer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1419
diff changeset
   174
      (*i) ();
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   175
    }
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   176
}
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   177
template<typename T1, typename T2, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   178
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   179
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   180
         typename T7, typename T8>
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   181
void 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   182
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1) const
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   183
{
1343
421d8d4712f9 constify
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1335
diff changeset
   184
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   185
       i != m_callbackList.end (); i++)
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   186
    {
2462
93028d4474ba add an IntegerTraceSource which behaves just like an Integer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1419
diff changeset
   187
      (*i) (a1);
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   188
    }
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   189
}
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   190
template<typename T1, typename T2, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   191
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   192
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   193
         typename T7, typename T8>
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   194
void 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   195
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2) const
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   196
{
1343
421d8d4712f9 constify
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1335
diff changeset
   197
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   198
       i != m_callbackList.end (); i++)
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   199
    {
2462
93028d4474ba add an IntegerTraceSource which behaves just like an Integer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1419
diff changeset
   200
      (*i) (a1, a2);
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   201
    }
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   202
}
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   203
template<typename T1, typename T2, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   204
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   205
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   206
         typename T7, typename T8>
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   207
void 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   208
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3) const
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   209
{
1343
421d8d4712f9 constify
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1335
diff changeset
   210
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   211
       i != m_callbackList.end (); i++)
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   212
    {
2462
93028d4474ba add an IntegerTraceSource which behaves just like an Integer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1419
diff changeset
   213
      (*i) (a1, a2, a3);
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   214
    }
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   215
}
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   216
template<typename T1, typename T2, 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   217
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   218
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   219
         typename T7, typename T8>
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   220
void 
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   221
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3, T4 a4) const
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   222
{
1343
421d8d4712f9 constify
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1335
diff changeset
   223
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   224
       i != m_callbackList.end (); i++)
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   225
    {
2462
93028d4474ba add an IntegerTraceSource which behaves just like an Integer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1419
diff changeset
   226
      (*i) (a1, a2, a3, a4);
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   227
    }
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   228
}
4072
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   229
template<typename T1, typename T2, 
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   230
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   231
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   232
         typename T7, typename T8>
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   233
void 
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   234
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) const
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   235
{
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   236
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   237
       i != m_callbackList.end (); i++)
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   238
    {
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   239
      (*i) (a1, a2, a3, a4, a5);
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   240
    }
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   241
}
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   242
template<typename T1, typename T2, 
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   243
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   244
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   245
         typename T7, typename T8>
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   246
void 
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   247
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) const
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   248
{
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   249
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   250
       i != m_callbackList.end (); i++)
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   251
    {
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   252
      (*i) (a1, a2, a3, a4, a5, a6);
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   253
    }
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   254
}
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   255
template<typename T1, typename T2, 
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   256
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   257
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   258
         typename T7, typename T8>
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   259
void 
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   260
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) const
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   261
{
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   262
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   263
       i != m_callbackList.end (); i++)
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   264
    {
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   265
      (*i) (a1, a2, a3, a4, a5, a6, a7);
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   266
    }
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   267
}
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   268
template<typename T1, typename T2, 
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   269
         typename T3, typename T4,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   270
         typename T5, typename T6,
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   271
         typename T7, typename T8>
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   272
void 
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   273
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8) const
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   274
{
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   275
  for (typename CallbackList::const_iterator i = m_callbackList.begin ();
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   276
       i != m_callbackList.end (); i++)
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   277
    {
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   278
      (*i) (a1, a2, a3, a4, a5, a6, a7, a8);
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   279
    }
5d226c752e85 bug 412: support more arguments in callbacks.
Providence.Salumu <Providence.Salumu@gmail.com>
parents: 2834
diff changeset
   280
}
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   281
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   282
}//namespace ns3
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   283
2482
adbc284a5849 EventTraceSource -> TracedCallback, ValueTraceSource -> TracedValue.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2466
diff changeset
   284
#endif /* TRACED_CALLBACK_H */