vil_stream.cxx
Go to the documentation of this file.
1 // This is core/vil/vil_stream.cxx
2 
3 #include "vil_stream.h"
4 
5 #include <cassert>
6 #ifdef _MSC_VER
7 # include <vcl_msvc_warnings.h>
8 #endif
9 
10 #define log_xtor 0
11 #if log_xtor
12 # include <std::iostream.h>
13 #endif
14 
16 : refcount_(0)
17 {
18 #if log_xtor
19  std::cerr << __FILE__ ", vil_stream ctor : this = " << (void*)this << std::endl;
20 #endif
21 }
22 
24 {
25 #if log_xtor
26  std::cerr << __FILE__ ", vil_stream dtor : this = " << (void*)this << std::endl;
27 #endif
28 }
29 
30 
32 {
33  assert(refcount_ >= 0); // negative refcount is very serious
34  if (--refcount_ == 0)
35  delete this;
36 }
Stream interface for VIL image loaders.
vcl_atomic_count refcount_
Definition: vil_stream.h:54
virtual ~vil_stream()
Definition: vil_stream.cxx:23
void unref()
Definition: vil_stream.cxx:31