LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
Lifetime-management for memory that goes into FITS memory files. More...
#include <fits.h>
Public Member Functions | |
MemFileManager () | |
Construct a MemFileManager with no initial memory buffer. More... | |
MemFileManager (std::size_t len) | |
Construct a MemFileManager with (len) bytes of initial memory. More... | |
MemFileManager (void *ptr, std::size_t len) | |
Construct a MemFileManager that references and does not manage external memory. More... | |
void | reset () |
Return the manager to the same state it would be if default-constructed. More... | |
void | reset (std::size_t len) |
Set the size of the internal memory buffer, freeing the current buffer if necessary. More... | |
void | reset (void *ptr, std::size_t len) |
Set the internal memory buffer to an manually-managed external block. More... | |
~MemFileManager () | |
void * | getData () const |
Return the buffer. More... | |
std::size_t | getLength () const |
Return the buffer length. More... | |
Private Attributes | |
void * | _ptr |
std::size_t | _len |
bool | _managed |
Friends | |
class | Fits |
Lifetime-management for memory that goes into FITS memory files.
|
inline |
|
inlineexplicit |
Construct a MemFileManager with (len) bytes of initial memory.
The manager will free the memory when it goes out of scope, and cfitsio will be allowed to reallocate the internal memory as needed.
Definition at line 123 of file fits.h.
|
inline |
Construct a MemFileManager that references and does not manage external memory.
The manager will not manage the given pointer, and it will not allow cfitsio to do so either. The user must provide enough initial memory and is responsible for freeing it manually after the FITS file has been closed.
Definition at line 132 of file fits.h.
|
inline |
|
inline |
|
inline |
void lsst::afw::fits::MemFileManager::reset | ( | ) |
Return the manager to the same state it would be if default-constructed.
This must not be called while a FITS file that uses this memory is open.
void lsst::afw::fits::MemFileManager::reset | ( | std::size_t | len | ) |
Set the size of the internal memory buffer, freeing the current buffer if necessary.
This must not be called while a FITS file that uses this memory is open.
Memory allocated with this overload of reset can be reallocated by cfitsio and will be freed when the manager goes out of scope or is reset.
|
inline |
Set the internal memory buffer to an manually-managed external block.
This must not be called while a FITS file that uses this memory is open.
Memory passed to this overload of reset cannot be reallocated by cfitsio and will not be freed when the manager goes out of scope or is reset.
Definition at line 159 of file fits.h.