Template class that encapsulates a fixed-sized array of elements of type T. More...
#include <rw/db/tbuffer.h>
Public Member Functions | |
RWDBTBuffer (RWSize_T entries=1, RWSize_T width=0) | |
RWDBTBuffer (T *data, RWSize_T entries=1, RWSize_T width=0) | |
RWDBTBuffer (T *data, RWDBNullIndicator *indicator, RWSize_T entries=1, RWSize_T width=0) | |
virtual | ~RWDBTBuffer () |
size_t | entries () const |
bool | isNull (size_t index) const |
const T & | operator[] (size_t index) const |
T & | operator[] (size_t index) |
void | paramType (RWDBColumn::ParamType newType) |
RWDBColumn::ParamType | paramType () const |
void | setData (const T &newData) |
void | setData (size_t index, const T &newData) |
void | setNull () |
void | setNull (size_t index) |
void | unsetNull () |
void | unsetNull (size_t index) |
Class RWDBTBuffer encapsulates a fixed-sized array of elements of type T
. Memory for these type T
elements can be managed explicitly in your applications, or by an RWDBTBuffer itself. In addition, this class keeps a null indicator vector that indicates whether any item in the array is NULL
. The class also provides mechanisms for converting buffer items to and from RWDBValue objects, if the chosen type T
can be converted.
The parameter T
represents the type of object to be inserted into the array, either a class or a fundamental data type. The class T
must have:
T::T(const T&)
or the equivalentT::operator=(const T&)
or the equivalent<rw/db/tbuffer_ustr.h>
instead of <rw/db/tbuffer.h>
.
|
inline |
Constructs an RWDBTBuffer with entries entries, and width width. Allocates the array of element-type T
of length entries, whose memory is managed by self. entries must be greater than or equal to 1
. Allocates the array of null indicators, of length entries, and sets them to false
. Memory for the null indicator array is managed by self. If width = 0
, the object uses the default width for type T
.
|
inline |
Same as RWDBTBuffer(RWSize_T,RWSize_T), but the RWDBTBuffer uses data and does not allocate or manage memory for the array. Also, the null indicator array is set to false
, and its memory is managed by self.
|
inline |
Same as RWDBTBuffer(T*,RWSize_T,RWSize_T), but the RWDBTBuffer uses the null indicator array passed as indicator, and does not allocate or manage memory for the null indicator array.
|
inlinevirtual |
Deletes all data owned by self.
|
inline |
Returns the number of entries.
|
inlinevirtual |
Performs a bounds check on index in debug mode. Returns true
if the entry at index is NULL
.
Reimplemented from RWDBAbstractBuffer.
|
inline |
Performs a bounds check on index in debug mode. Returns the entry at index in the array by value. The returned reference may be used as an rvalue
.
|
inline |
Performs a bounds check on index in debug mode. Returns a reference to the entry at index in the array. The returned reference may be used as an lvalue
. If using this method to assign a new value to this entry, an explicit call to unsetNull(size_t) using index is needed.
|
inline |
Changes the paramType
attribute of self to newType. By default, the paramType
is set to RWDBColumn::inParameter
. Note that this does not change the definition of the parameter in the database.
|
inline |
Returns a value indicating the parameter type of the column.
|
inline |
Sets all the contents of the array to be newData. Unsets NULL
for each entry.
|
inline |
Sets the entry at index of the array to be newData. Unsets NULL
for the entry at index.
|
inlinevirtual |
Sets NULL
for all entries.
Reimplemented from RWDBAbstractBuffer.
|
inlinevirtual |
Sets NULL
for the entry at index.
Reimplemented from RWDBAbstractBuffer.
|
inlinevirtual |
Unsets NULL
for all entries.
Reimplemented from RWDBAbstractBuffer.
|
inlinevirtual |
Unsets NULL
for the entry at index.
Reimplemented from RWDBAbstractBuffer.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |