dng_memory_data Class Reference

Class to provide resource acquisition is instantiation discipline for small memory allocations. More...

#include <dng_memory.h>

List of all members.


Public Member Functions

 dng_memory_data ()
 dng_memory_data (uint32 size)
 ~dng_memory_data ()
 Release memory buffer using free.
void Allocate (uint32 size)
void Clear ()
void * Buffer ()
const void * Buffer () const
char * Buffer_char ()
const char * Buffer_char () const
uint8 * Buffer_uint8 ()
const uint8 * Buffer_uint8 () const
uint16 * Buffer_uint16 ()
const uint16 * Buffer_uint16 () const
int16 * Buffer_int16 ()
const int16 * Buffer_int16 () const
uint32 * Buffer_uint32 ()
const uint32 * Buffer_uint32 () const
int32 * Buffer_int32 ()
const int32 * Buffer_int32 () const
uint64 * Buffer_uint64 ()
const uint64 * Buffer_uint64 () const
int64 * Buffer_int64 ()
const int64 * Buffer_int64 () const
real32 * Buffer_real32 ()
const real32 * Buffer_real32 () const
real64 * Buffer_real64 ()
const real64 * Buffer_real64 () const

Detailed Description

Class to provide resource acquisition is instantiation discipline for small memory allocations.

Support for memory allocation. This class does not use dng_memory_allocator for memory allocation.


Constructor & Destructor Documentation

dng_memory_data::dng_memory_data (  ) 

Construct an empty memory buffer using malloc.

Exceptions:
dng_memory_full with fErrorCode equal to dng_error_memory.

dng_memory_data::dng_memory_data ( uint32  size  ) 

Construct memory buffer of size bytes using malloc.

Parameters:
size Number of bytes of memory needed.
Exceptions:
dng_memory_full with fErrorCode equal to dng_error_memory.

References Allocate().


Member Function Documentation

void dng_memory_data::Allocate ( uint32  size  ) 

Clear existing memory buffer and allocate new memory of size bytes.

Parameters:
size Number of bytes of memory needed.
Exceptions:
dng_memory_full with fErrorCode equal to dng_error_memory.

References Clear(), and ThrowMemoryFull().

Referenced by dng_memory_data().

const void* dng_memory_data::Buffer (  )  const [inline]

Return pointer to allocated memory as a const void *.

Return values:
const void * valid for as many bytes as were allocated.

void* dng_memory_data::Buffer (  )  [inline]

Return pointer to allocated memory as a void *..

Return values:
void * valid for as many bytes as were allocated.

Referenced by Buffer_char(), Buffer_int16(), Buffer_int32(), Buffer_int64(), Buffer_real32(), Buffer_real64(), Buffer_uint16(), Buffer_uint32(), Buffer_uint64(), Buffer_uint8(), dng_stream::CopyToStream(), and dng_stream::PutZeros().

const char* dng_memory_data::Buffer_char (  )  const [inline]

Return pointer to allocated memory as a const char *.

Return values:
const char * valid for as many bytes as were allocated.

References Buffer().

char* dng_memory_data::Buffer_char (  )  [inline]

Return pointer to allocated memory as a char *.

Return values:
char * valid for as many bytes as were allocated.

References Buffer().

const int16* dng_memory_data::Buffer_int16 (  )  const [inline]

Return pointer to allocated memory as a const int16 *.

Return values:
const int16 * valid for as many bytes as were allocated.

References Buffer().

int16* dng_memory_data::Buffer_int16 (  )  [inline]

Return pointer to allocated memory as a int16 *.

Return values:
int16 * valid for as many bytes as were allocated.

References Buffer().

const int32* dng_memory_data::Buffer_int32 (  )  const [inline]

Return pointer to allocated memory as a const int32 *.

Return values:
const int32 * valid for as many bytes as were allocated.

References Buffer().

int32* dng_memory_data::Buffer_int32 (  )  [inline]

Return pointer to allocated memory as a const int32 *.

Return values:
const int32 * valid for as many bytes as were allocated.

References Buffer().

const int64* dng_memory_data::Buffer_int64 (  )  const [inline]

Return pointer to allocated memory as a const int64 *.

Return values:
const int64 * valid for as many bytes as were allocated.

References Buffer().

int64* dng_memory_data::Buffer_int64 (  )  [inline]

Return pointer to allocated memory as a const int64 *.

Return values:
const int64 * valid for as many bytes as were allocated.

References Buffer().

const real32* dng_memory_data::Buffer_real32 (  )  const [inline]

Return pointer to allocated memory as a const real32 *.

Return values:
const real32 * valid for as many bytes as were allocated.

References Buffer().

real32* dng_memory_data::Buffer_real32 (  )  [inline]

Return pointer to allocated memory as a real32 *.

Return values:
real32 * valid for as many bytes as were allocated.

References Buffer().

const real64* dng_memory_data::Buffer_real64 (  )  const [inline]

Return pointer to allocated memory as a const real64 *.

Return values:
const real64 * valid for as many bytes as were allocated.

References Buffer().

real64* dng_memory_data::Buffer_real64 (  )  [inline]

Return pointer to allocated memory as a real64 *.

Return values:
real64 * valid for as many bytes as were allocated.

References Buffer().

const uint16* dng_memory_data::Buffer_uint16 (  )  const [inline]

Return pointer to allocated memory as a const uint16 *.

Return values:
const uint16 * valid for as many bytes as were allocated.

References Buffer().

uint16* dng_memory_data::Buffer_uint16 (  )  [inline]

Return pointer to allocated memory as a uint16 *.

Return values:
uint16 * valid for as many bytes as were allocated.

References Buffer().

const uint32* dng_memory_data::Buffer_uint32 (  )  const [inline]

Return pointer to allocated memory as a uint32 *.

Return values:
uint32 * valid for as many bytes as were allocated.

References Buffer().

uint32* dng_memory_data::Buffer_uint32 (  )  [inline]

Return pointer to allocated memory as a uint32 *.

Return values:
uint32 * valid for as many bytes as were allocated.

References Buffer().

Referenced by dng_image_writer::WriteDNG().

const uint64* dng_memory_data::Buffer_uint64 (  )  const [inline]

Return pointer to allocated memory as a uint64 *.

Return values:
uint64 * valid for as many bytes as were allocated.

References Buffer().

uint64* dng_memory_data::Buffer_uint64 (  )  [inline]

Return pointer to allocated memory as a uint64 *.

Return values:
uint64 * valid for as many bytes as were allocated.

References Buffer().

const uint8* dng_memory_data::Buffer_uint8 (  )  const [inline]

Return pointer to allocated memory as a const uint8 *.

Return values:
const uint8 * valid for as many bytes as were allocated.

References Buffer().

uint8* dng_memory_data::Buffer_uint8 (  )  [inline]

Return pointer to allocated memory as a uint8 *.

Return values:
uint8 * valid for as many bytes as were allocated.

References Buffer().

void dng_memory_data::Clear (  ) 

Release any allocated memory using free. Object is still valid and Allocate can be called again.

Referenced by Allocate(), and ~dng_memory_data().


The documentation for this class was generated from the following files:

Copyright © 2006-2009 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google