Magick++ 7.1.2-32
Convert, Edit, Or Compose Bitmap Images
Loading...
Searching...
No Matches
Magick::BlobRef Class Reference

Public Member Functions

 BlobRef (const void *data_, const size_t length_)
size_t decrease ()
void increase ()

Data Fields

Blob::Allocator allocator
size_t length
void * data

Private Member Functions

 BlobRef (const BlobRef &)

Private Attributes

MutexLock _mutexLock
size_t _refCount

Detailed Description

Definition at line 23 of file BlobRef.h.

Constructor & Destructor Documentation

◆ BlobRef()

Magick::BlobRef::BlobRef ( const void * data_,
const size_t length_ )

Definition at line 20 of file BlobRef.cpp.

21 : allocator(Magick::Blob::NewAllocator),
22 length(length_),
23 data((void*) NULL),
24 _mutexLock(),
25 _refCount(1)
26{
27 if (data_ != (const void*) NULL)
28 {
29 data=new unsigned char[length_];
30 memcpy(data,data_,length_);
31 }
32}

◆ ~BlobRef()

Magick::BlobRef::~BlobRef ( void )

Definition at line 34 of file BlobRef.cpp.

35{
36 if (allocator == Magick::Blob::NewAllocator)
37 {
38 delete[] static_cast<unsigned char*>(data);
39 data=(void *) NULL;
40 }
41 else if (allocator == Magick::Blob::MallocAllocator)
42 data=(void *) RelinquishMagickMemory(data);
43}

Member Function Documentation

◆ decrease()

size_t Magick::BlobRef::decrease ( )

Definition at line 45 of file BlobRef.cpp.

46{
47 size_t
48 count;
49
50 _mutexLock.lock();
51 if (_refCount == 0)
52 {
53 _mutexLock.unlock();
54 throwExceptionExplicit(MagickCore::OptionError,
55 "Invalid call to decrease");
56 return(0);
57 }
58 count=--_refCount;
59 _mutexLock.unlock();
60 return(count);
61}

◆ increase()

void Magick::BlobRef::increase ( )

Definition at line 63 of file BlobRef.cpp.

64{
65 _mutexLock.lock();
66 _refCount++;
67 _mutexLock.unlock();
68}

Field Documentation

◆ _mutexLock

MutexLock Magick::BlobRef::_mutexLock
private

Definition at line 47 of file BlobRef.h.

◆ _refCount

size_t Magick::BlobRef::_refCount
private

Definition at line 48 of file BlobRef.h.

◆ allocator

Blob::Allocator Magick::BlobRef::allocator

Definition at line 39 of file BlobRef.h.

◆ data

void* Magick::BlobRef::data

Definition at line 41 of file BlobRef.h.

◆ length

size_t Magick::BlobRef::length

Definition at line 40 of file BlobRef.h.


The documentation for this class was generated from the following files:
  • /home/cristy/Attic/Build/ImageMagick-7.1.2/rpmbuild/BUILD/ImageMagick-7.1.2-build/ImageMagick-7.1.2-32/Magick++/lib/Magick++/BlobRef.h
  • /home/cristy/Attic/Build/ImageMagick-7.1.2/rpmbuild/BUILD/ImageMagick-7.1.2-build/ImageMagick-7.1.2-32/Magick++/lib/BlobRef.cpp