SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWDBBinaryVector Class Reference

Deprecated. Transfers binary arrays between the application and the database. More...

#include <rw/db/dbvector.h>

Inheritance diagram for RWDBBinaryVector:
RWDBTBuffer< T > RWDBAbstractBuffer

Public Member Functions

 RWDBBinaryVector (size_t width, size_t length)
 
size_t length () const
 
RWDBBinaryVectorElement operator[] (size_t i)
 
- Public Member Functions inherited from RWDBTBuffer< T >
 RWDBTBuffer (RWSize_T entries=1, RWSize_T width=0)
 
 RWDBTBuffer (T *data, RWDBNullIndicator *indicator, RWSize_T entries=1, RWSize_T width=0)
 
 RWDBTBuffer (T *data, RWSize_T entries=1, RWSize_T width=0)
 
virtual ~RWDBTBuffer ()
 
size_t entries () const
 
bool isNull (size_t index) const
 
T & operator[] (size_t index)
 
const T & operator[] (size_t index) const
 
RWDBColumn::ParamType paramType () const
 
void paramType (RWDBColumn::ParamType newType)
 
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)
 

Detailed Description

Deprecated
As of SourcePro 6, use RWDBTBuffer and RWDBBlob instead.

RWDBBinaryVector instances are used to transfer binary arrays of width width between the application and the database via classes RWDBBulkReader and RWDBBulkInserter.

Synopsis
#include <rw/db/dbvector.h>
RWDBBinaryVector binaryVector(width, length);
Deprecated. Transfers binary arrays between the application and the database.
Definition dbvector.h:363
size_t length() const
Definition dbvector.h:386
Example

In the following example, the ith element of an RWDBBinaryVector is set to hold the data Hello, and the data and width are output to the screen.

RWDBBinaryVector binaryVector(width, length);
binaryVector[i] = RWDBBlob("Hello", 5);
RWDBBinaryVectorElement element = binaryVector[i];
// print the contents of the element
cout << "length of element is: " << binaryVector.width(i) << endl;
cout << "the element's data is: ";
unsigned char* ptr = (unsigned char*)element;
for (size_t j = 0; j < binVector.width(i); ++j, ++ptr) {
cout.put(*ptr);
}
cout << endl;
Deprecated. Encapsulates arrays of unsigned characters stored in RWDBBinaryVector instances.
Definition dbvector.h:108
Stores Binary Large Objects (Blobs) and includes relevant accessors.
Definition blob.h:109

Program Output:

length of element is: 5
the element's data is: Hello

Constructor & Destructor Documentation

◆ RWDBBinaryVector()

RWDBBinaryVector::RWDBBinaryVector ( size_t width,
size_t length )
inline

Constructs an RWDBBinaryVector of length elements, each of whose elements is width wide.

Member Function Documentation

◆ length()

size_t RWDBBinaryVector::length ( ) const
inline

Returns the number of elements in self.

◆ operator[]()

RWDBBinaryVectorElement RWDBBinaryVector::operator[] ( size_t i)
inline

Returns an RWDBBinaryVectorElement holding a reference to the i th element of self.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.