blob: 1d7b2836ca3700b5a2570ec3c46845cf25e2db69 [file] [log] [blame]
Alexander Afanasyevea9b3e62012-08-13 19:02:54 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2011 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
21#include "ndn-limits.h"
22
23#include "ns3/log.h"
24#include "ns3/simulator.h"
Alexander Afanasyev6a3bb132012-08-15 09:47:35 -070025#include "ns3/random-variable.h"
Alexander Afanasyevea9b3e62012-08-13 19:02:54 -070026
27NS_LOG_COMPONENT_DEFINE ("ndn.Limits");
28
29namespace ns3 {
30namespace ndn {
31
Alexander Afanasyevea9b3e62012-08-13 19:02:54 -070032TypeId
33Limits::GetTypeId ()
34{
35 static TypeId tid = TypeId ("ns3::ndn::Limits")
36 .SetGroupName ("Ndn")
37 .SetParent <Object> ()
Alexander Afanasyev6a3bb132012-08-15 09:47:35 -070038
Alexander Afanasyevea9b3e62012-08-13 19:02:54 -070039 ;
40 return tid;
41}
42
Alexander Afanasyev08ab5722012-11-06 17:22:25 -080043Limits::Limits ()
44 : m_maxRate (-1)
45 , m_maxDelay (1.0)
46 , m_handler (MakeNullCallback<void> ())
Alexander Afanasyeva8f5d882012-11-09 14:22:48 -080047 , m_linkDelay (0)
Alexander Afanasyev08ab5722012-11-06 17:22:25 -080048{
49}
50
51
52void
53Limits::RegisterAvailableSlotCallback (CallbackHandler handler)
54{
55 m_handler = handler;
56}
57
58void
59Limits::FireAvailableSlotCallback ()
60{
61 if (!m_handler.IsNull ())
62 m_handler ();
63}
64
65
Alexander Afanasyevea9b3e62012-08-13 19:02:54 -070066} // namespace ndn
67} // namespace ns3