src/core/trace-source-accessor.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sat, 04 Jul 2009 08:15:48 +0200
changeset 4654 2eaebe77d66b
parent 2463 c77e43117673
permissions -rw-r--r--
Added tag ns-3.5 for changeset c975274c9707
mathieu@2587
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
mathieu@2587
     2
/*
mathieu@2587
     3
 * Copyright (c) 2008 INRIA
mathieu@2587
     4
 *
mathieu@2587
     5
 * This program is free software; you can redistribute it and/or modify
mathieu@2587
     6
 * it under the terms of the GNU General Public License version 2 as
mathieu@2587
     7
 * published by the Free Software Foundation;
mathieu@2587
     8
 *
mathieu@2587
     9
 * This program is distributed in the hope that it will be useful,
mathieu@2587
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
mathieu@2587
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
mathieu@2587
    12
 * GNU General Public License for more details.
mathieu@2587
    13
 *
mathieu@2587
    14
 * You should have received a copy of the GNU General Public License
mathieu@2587
    15
 * along with this program; if not, write to the Free Software
mathieu@2587
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
mathieu@2587
    17
 *
mathieu@2587
    18
 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
mathieu@2587
    19
 */
mathieu@2463
    20
#include "trace-source-accessor.h"
mathieu@2463
    21
mathieu@2463
    22
namespace ns3 {
mathieu@2463
    23
mathieu@2463
    24
TraceSourceAccessor::TraceSourceAccessor ()
mathieu@2463
    25
  : m_count (1)
mathieu@2463
    26
{}
mathieu@2463
    27
TraceSourceAccessor::~TraceSourceAccessor ()
mathieu@2463
    28
{}
mathieu@2463
    29
void 
mathieu@2463
    30
TraceSourceAccessor::Ref (void) const
mathieu@2463
    31
{
mathieu@2463
    32
  m_count++;
mathieu@2463
    33
}
mathieu@2463
    34
void 
mathieu@2463
    35
TraceSourceAccessor::Unref (void) const
mathieu@2463
    36
{
mathieu@2463
    37
  m_count--;
mathieu@2463
    38
  if (m_count == 0)
mathieu@2463
    39
    {
mathieu@2463
    40
      delete this;
mathieu@2463
    41
    }
mathieu@2463
    42
}
mathieu@2463
    43
mathieu@2463
    44
} // namespace ns3