LTP GCOV extension - code coverage report
Current view: directory - src/cpp/prod/lib - object.cpp
Test: YAORB-0.2.info
Date: 2006-02-27 Instrumented lines: 25
Code covered: 64.0 % Executed lines: 16

       1                 : //==============================================================================
       2                 : // File <$/src/cpp/prod/lib/object.cpp>
       3                 : // This file is part of YaOrb : Yet Another Object Request Broker,
       4                 : // Copyright (c) 2000-2003, Marc Alff.
       5                 : //
       6                 : // This program is free software; you can redistribute it and/or
       7                 : // modify it under the terms of the GNU General Public License
       8                 : // as published by the Free Software Foundation; either version 2
       9                 : // of the License, or (at your option) any later version.
      10                 : //
      11                 : // This program is distributed in the hope that it will be useful,
      12                 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
      13                 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14                 : // GNU General Public License for more details.
      15                 : //
      16                 : // You should have received a copy of the GNU General Public License
      17                 : // along with this program; if not, write to the Free Software
      18                 : // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
      19                 : //
      20                 : //==============================================================================
      21                 : 
      22                 : #include <yaorb/CORBA.h>
      23                 : #include <yaorb/YAORB.h>
      24                 : 
      25                 : #include "src/cpp/prod/tool/DEVELOPMENT.h"
      26                 : #include "src/cpp/prod/tool/Assert.h"
      27                 : 
      28                 : #define DEAD_COUNT 0xFFFFFFFF
      29                 : 
      30              14 : CORBA::Object::Object()
      31              14 : : _refCount(1)
      32                 : {
      33                 : }
      34                 : 
      35              13 : CORBA::Object::~Object()
      36                 : {
      37                 :    ASSERT(_refCount == 0) ;
      38              13 :    _refCount = DEAD_COUNT ;
      39               0 : }
      40                 : 
      41              28 : CORBA::Object_ptr CORBA::Object::_nil(void)
      42                 : {
      43                 :    return NULL ;
      44                 : }
      45                 : 
      46              22 : CORBA::Object_ptr CORBA::Object::_duplicate(CORBA::Object_ptr obj)
      47                 : {
      48              22 :    if (obj)
      49                 :    {
      50              22 :       obj->IncRefCount() ;
      51                 :    }
      52                 :    return obj ;
      53                 : }
      54                 : 
      55              22 : void CORBA::Object::IncRefCount(void)
      56                 : {
      57                 :    ASSERT(_refCount != DEAD_COUNT) ;
      58              22 :    _refCount ++ ;
      59                 : }
      60                 : 
      61              37 : void CORBA::Object::DecRefCount(void)
      62                 : {
      63                 :    ASSERT(_refCount != DEAD_COUNT) ;
      64                 :    ASSERT(_refCount != 0) ;
      65                 : 
      66              37 :    _refCount -- ;
      67                 : 
      68              37 :    if (_refCount == 0)
      69                 :    {
      70              13 :       Destroy() ;
      71                 :    }
      72                 : }
      73                 : 
      74              13 : void CORBA::Object::Destroy(void)
      75                 : {
      76              13 :    delete this ;
      77                 : }
      78                 : 
      79               0 : void CORBA::Object::cdr(YAORB::CDR*)
      80                 : {
      81               0 :    NON_DEV("CORBA::Object::cdr") ;
      82                 : }
      83                 : 
      84               0 : CORBA::Object_ptr CORBA::Object::_bind(YAORB::CDR*)
      85                 : {
      86               0 :    NON_DEV("CORBA::Object::_bind") ;
      87               0 :    return _nil() ;
      88                 : }
      89                 : 
      90               0 : bool CORBA::Object::_isA(const YAORB::ClassInfo* info, void*& that) const
      91                 : {
      92               0 :    NON_DEV("CORBA::Object::_isA") ;
      93               0 :    that = (CORBA::Object*) this ;
      94                 :    return false ;
      95                 : }
      96                 : 

Generated by: LTP GCOV extension version 1.4