core/vil/vil_stream.cxx
Go to the documentation of this file.
00001 // This is core/vil/vil_stream.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 
00006 #include "vil_stream.h"
00007 
00008 #include <vcl_cassert.h>
00009 
00010 #define log_xtor 0
00011 #if log_xtor
00012 # include <vcl_iostream.h>
00013 #endif
00014 
00015 vil_stream::vil_stream()
00016 : refcount_(0)
00017 {
00018 #if log_xtor
00019   vcl_cerr << __FILE__ ", vil_stream ctor : this = " << (void*)this << vcl_endl;
00020 #endif
00021 }
00022 
00023 vil_stream::~vil_stream()
00024 {
00025 #if log_xtor
00026   vcl_cerr << __FILE__ ", vil_stream dtor : this = " << (void*)this << vcl_endl;
00027 #endif
00028 }
00029 
00030 
00031 void vil_stream::unref()
00032 {
00033   assert(refcount_ >= 0); // negative refcount is very serious
00034   if (--refcount_ == 0)
00035     delete this;
00036 }