9 # include <vcl_msvc_warnings.h> 21 : data_(new char[n]), size_(n), pixel_format_(pixel_form), ref_count_(0)
30 delete [] reinterpret_cast<char*>(
data_);
35 : data_(new char[d.size()]), size_(d.size()), pixel_format_(d.pixel_format_), ref_count_(0)
43 if (
this==&d)
return *
this;
59 delete [] reinterpret_cast<char*>(
data_);
data_=
nullptr;
75 delete [] reinterpret_cast<char*>(
data_);
virtual void * data()
Pointer to first element of data.
std::size_t size() const
Number of bytes allocated.
virtual void * const_data() const
Pointer to first element of data.
virtual void set_size(unsigned long n, vil_pixel_format pixel_format)
Create space for n bytes.
std::size_t size_
Number of elements (bytes).
vil_memory_chunk & operator=(const vil_memory_chunk &)
Copy operator.
Ref. counted block of data on the heap.
vcl_atomic_count ref_count_
Reference count.
vil_pixel_format pixel_format_
Indicate what format data is (used for binary IO).
vil_pixel_format pixel_format() const
Indicate what format data is to be saved as in binary IO.
virtual ~vil_memory_chunk()
Destructor.
void unref()
Decrement reference count.
vil_memory_chunk()
Dflt ctor.