src/core/model/event-impl.cc
author Josh Pelkey <jpelkey@gatech.edu>
Fri, 13 May 2011 14:52:27 -0400
changeset 7169 358f71a624d8
parent 6821 203367ae7433
child 9134 7a750f032acd
permissions -rw-r--r--
core coding style changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
150
663120712cd9 fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 132
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
9
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2005 INRIA
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 *
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 *
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 *
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 *
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 */
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
#include "event-impl.h"
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
16
99e833adbb46 change yans namespace to ns3
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 9
diff changeset
    23
namespace ns3 {
9
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
EventImpl::~EventImpl ()
7169
358f71a624d8 core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6821
diff changeset
    26
{
358f71a624d8 core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6821
diff changeset
    27
}
9
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
EventImpl::EventImpl ()
5505
c0ac392289c3 replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3812
diff changeset
    30
  : m_cancel (false)
7169
358f71a624d8 core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6821
diff changeset
    31
{
358f71a624d8 core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6821
diff changeset
    32
}
3560
5aa65b1ea001 add realtime simulator and associated tests
Craig Dowell <craigdo@ee.washington.edu>
parents: 1696
diff changeset
    33
7169
358f71a624d8 core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6821
diff changeset
    34
void
122
6b8f1eda5c57 fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 110
diff changeset
    35
EventImpl::Invoke (void)
9
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
{
7169
358f71a624d8 core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6821
diff changeset
    37
  if (!m_cancel)
150
663120712cd9 fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 132
diff changeset
    38
    {
663120712cd9 fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 132
diff changeset
    39
      Notify ();
663120712cd9 fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 132
diff changeset
    40
    }
9
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
}
3560
5aa65b1ea001 add realtime simulator and associated tests
Craig Dowell <craigdo@ee.washington.edu>
parents: 1696
diff changeset
    42
7169
358f71a624d8 core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6821
diff changeset
    43
void
122
6b8f1eda5c57 fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 110
diff changeset
    44
EventImpl::Cancel (void)
9
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    45
{
150
663120712cd9 fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 132
diff changeset
    46
  m_cancel = true;
9
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    47
}
2c31ae7c94db import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    48
7169
358f71a624d8 core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6821
diff changeset
    49
bool
209
8b343b9727d7 fix EventId::IsExpired and Simulator::IsExpired, add EventId::IsRunning, add relevant tests, replace Seconds, MilliSeconds, MicroSeconds, and, NanoSeconds classes by functions named similarly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 203
diff changeset
    50
EventImpl::IsCancelled (void)
8b343b9727d7 fix EventId::IsExpired and Simulator::IsExpired, add EventId::IsRunning, add relevant tests, replace Seconds, MilliSeconds, MicroSeconds, and, NanoSeconds classes by functions named similarly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 203
diff changeset
    51
{
8b343b9727d7 fix EventId::IsExpired and Simulator::IsExpired, add EventId::IsRunning, add relevant tests, replace Seconds, MilliSeconds, MicroSeconds, and, NanoSeconds classes by functions named similarly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 203
diff changeset
    52
  return m_cancel;
8b343b9727d7 fix EventId::IsExpired and Simulator::IsExpired, add EventId::IsRunning, add relevant tests, replace Seconds, MilliSeconds, MicroSeconds, and, NanoSeconds classes by functions named similarly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 203
diff changeset
    53
}
8b343b9727d7 fix EventId::IsExpired and Simulator::IsExpired, add EventId::IsRunning, add relevant tests, replace Seconds, MilliSeconds, MicroSeconds, and, NanoSeconds classes by functions named similarly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 203
diff changeset
    54
3812
6cca59a0fca6 remove event locking
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3560
diff changeset
    55
} // namespace ns3