src/simulator/event-impl.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu Nov 12 13:01:01 2009 +0100 (2009-11-12)
changeset 5505 c0ac392289c3
parent 3812 6cca59a0fca6
permissions -rw-r--r--
replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
mathieu@150
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
mathieu@9
     2
/*
mathieu@9
     3
 * Copyright (c) 2005 INRIA
mathieu@9
     4
 *
mathieu@9
     5
 * This program is free software; you can redistribute it and/or modify
mathieu@9
     6
 * it under the terms of the GNU General Public License version 2 as
mathieu@9
     7
 * published by the Free Software Foundation;
mathieu@9
     8
 *
mathieu@9
     9
 * This program is distributed in the hope that it will be useful,
mathieu@9
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
mathieu@9
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
mathieu@9
    12
 * GNU General Public License for more details.
mathieu@9
    13
 *
mathieu@9
    14
 * You should have received a copy of the GNU General Public License
mathieu@9
    15
 * along with this program; if not, write to the Free Software
mathieu@9
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
mathieu@9
    17
 *
mathieu@9
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
mathieu@9
    19
 */
mathieu@9
    20
mathieu@9
    21
#include "event-impl.h"
mathieu@9
    22
mathieu@16
    23
namespace ns3 {
mathieu@9
    24
mathieu@9
    25
EventImpl::~EventImpl ()
mathieu@9
    26
{}
mathieu@9
    27
mathieu@9
    28
EventImpl::EventImpl ()
mathieu@5505
    29
  : m_cancel (false)
mathieu@9
    30
{}
craigdo@3560
    31
mathieu@9
    32
void 
mathieu@122
    33
EventImpl::Invoke (void)
mathieu@9
    34
{
mathieu@150
    35
  if (!m_cancel) 
mathieu@150
    36
    {
mathieu@150
    37
      Notify ();
mathieu@150
    38
    }
mathieu@9
    39
}
craigdo@3560
    40
mathieu@9
    41
void 
mathieu@122
    42
EventImpl::Cancel (void)
mathieu@9
    43
{
mathieu@150
    44
  m_cancel = true;
mathieu@9
    45
}
mathieu@9
    46
mathieu@209
    47
bool 
mathieu@209
    48
EventImpl::IsCancelled (void)
mathieu@209
    49
{
mathieu@209
    50
  return m_cancel;
mathieu@209
    51
}
mathieu@209
    52
mathieu@3812
    53
} // namespace ns3