Class used to manage a block of memory. More...
#include <record.h>
Public Member Functions | |
buffer (size_t size=1) | |
Allocate the block of data. | |
T * | get () const |
Retrieve the memory pointer. | |
~buffer () | |
Free the block of data. | |
Private Attributes | |
T * | f_ptr |
The memory pointer. |
Class used to manage a block of memory.
This class is used internally to manage a block of memory necessary to dynamically bind to a database column of data.
This class derives from the object class that ensures the reference count is properly managed. Buffers are used in smart pointers and thus can safely be pointed as many times as necessary.
Definition at line 46 of file record.h.
odbcpp::buffer< T >::buffer | ( | size_t | size = 1 |
) | [inline] |
Allocate the block of data.
Initializes the buffer by allocating the necessary block of memory.
[in] | size | The size used to allocate the new buffer. |
odbcpp::buffer< T >::~buffer | ( | ) | [inline] |
Free the block of data.
The destructor ensures that the block of memory allocated by the constructor is freed.
Definition at line 66 of file record.h.
References odbcpp::buffer< T >::f_ptr.
T* odbcpp::buffer< T >::get | ( | ) | const [inline] |
Retrieve the memory pointer.
This function returns the memory pointer that the constructor allocated. You can use it as required, but you cannot delete it.
This pointer cannot be null, however, it may pointer to an empty buffer (i.e. 0 size memory block.)
Definition at line 79 of file record.h.
References odbcpp::buffer< T >::f_ptr.
T* odbcpp::buffer< T >::f_ptr [private] |
The memory pointer.
This variable holds the buffer memory pointer.
Definition at line 86 of file record.h.
Referenced by odbcpp::buffer< T >::get(), and odbcpp::buffer< T >::~buffer().