rdbxx
1.0.7_02
|
Parameterizes RDBColumn interface for many data types. More...
#include <RDBColumnTmplt.h>
Public Member Functions | |
Constructing, destructing, and initializing RDB columns. | |
RDBColumnTmplt (const string &name="", const string &def="") | |
Assigns name and definition. More... | |
RDBColumnTmplt (const RDBColumnTmplt< Tmplt0, Tmplt1, Tmplt2 > &rdbcolumntmplt) | |
Copies RDBColumnTmplt object. More... | |
~RDBColumnTmplt (void) | |
Deletes resources allocated by RDBColumnTmplt object. More... | |
RDBColumn & | operator= (const RDBColumnTmplt< Tmplt0, Tmplt1, Tmplt2 > &rdbcolumntmplt) |
Copies RDBColumnTmplt object. More... | |
virtual RDBColumn & | operator= (const Tmplt0 &data) |
Assigns data to RDBColumn object's _data member, converting as necessary. More... | |
virtual RDBColumn & | operator= (const Tmplt1 &data) |
Assigns data to RDBColumn object's _data member, converting as necessary. More... | |
virtual RDBColumn & | operator= (const Tmplt2 &data) |
Assigns data to RDBColumn object's _data member, converting as necessary. More... | |
Auto-indexing control methods. | |
virtual void | advanceIdx (void) |
Increments index to the RDBColumn's data elements. More... | |
virtual void | rewind (void) |
Rewinds index to the RDBColumn's data elements. More... | |
Group information ("break" column) methods. | |
virtual void | setGroup (bool group) |
virtual void | setGroupValue (void) |
Sets the group value to the current data value. More... | |
virtual int | newGroup (void) |
Returns the group status of this column object. More... | |
Data member initializers. | |
virtual bool | setData (const Tmplt0 &data) |
Sets the data value, converting as necessary. More... | |
virtual bool | setData (const Tmplt1 &data) |
Sets the data value, converting as necessary. More... | |
virtual bool | setData (const Tmplt2 &data) |
Sets the data value, converting as necessary. More... | |
Methods to map RDBColumn's data to user-supplied memory. | |
virtual void | mapData (Tmplt0 data[], const size_t nelems) |
Maps data to user-supplied memory. More... | |
Data member accessors. | |
void * | getData (void) |
Returns a pointer to the current data element. More... | |
virtual bool | getData (Tmplt0 &data) |
Returns the value of the current data element, converting if necessary. More... | |
virtual bool | getData (Tmplt1 &data) |
Returns the value of the current data element, converting if necessary. More... | |
virtual bool | getData (Tmplt2 &data) |
Returns the value of the current data element, converting if necessary. More... | |
virtual double | getDataDouble (void) |
Returns the value of the current data element, converting if necessary. More... | |
virtual long | getDataLong (void) |
Returns the value of the current data element, converting if necessary. More... | |
virtual string | getDataString (void) |
Returns the value of the current data element, converting if necessary. More... | |
![]() | |
RDBColumn (const string &name="", const string &def="") | |
Assigns name and definition to RDBColumn object. More... | |
RDBColumn (const RDBColumn &col) | |
Copies RDBColumn object. More... | |
virtual | ~RDBColumn (void) |
Deletes resources allocated by RDBColumn object. More... | |
RDBColumn & | operator= (const RDBColumn &col) |
Copies RDBColumn object. More... | |
virtual RDBColumn & | operator= (const double &data)=0 |
Assigns data to RDBColumn object's _data member, converting as necessary. More... | |
virtual RDBColumn & | operator= (const long &data)=0 |
Assigns data to RDBColumn object's _data member, converting as necessary. More... | |
virtual RDBColumn & | operator= (const string &data)=0 |
Assigns data to RDBColumn object's _data member, converting as necessary. More... | |
bool | getGroup (void) const |
Returns group status, RBOG if at beginning of a group, REOG if at ned of a group, or REOL if in the middle of a group. More... | |
void | setName (const string &name) |
Sets the name. More... | |
void | setDef (const string &def) |
Sets the definition. More... | |
void | setWidth (const long width) |
Sets the width. More... | |
void | setType (const RDBColumn::Type type) |
Sets the type. More... | |
void | setJust (const RDBColumn::Just just) |
Sets the justification. More... | |
void | setDesc (const string &desc) |
Sets the description. More... | |
void | setPrecision (const int precision) |
Sets the precision for numeric output and numeric to string conversion. More... | |
void | setThrow (const bool t=true) |
Sets the excpeption throwing behavior. More... | |
void | setErrNo (const int no=0) |
Sets the error status. More... | |
virtual bool | setData (const double &data)=0 |
Sets the data value, converting as necessary. More... | |
virtual bool | setData (const long &data)=0 |
Sets the data value, converting as necessary. More... | |
virtual bool | setData (const string &data)=0 |
Sets the data value, converting as necessary. More... | |
virtual void | mapData (double data[], const size_t nelems=1) |
Maps data to user-supplied memory, if possible. More... | |
virtual void | mapData (long data[], const size_t nelems=1) |
Maps data to user-supplied memory, if possible. More... | |
virtual void | mapData (string data[], const size_t nelems=1) |
Maps data to user-supplied memory, if possible. More... | |
string | getName (void) const |
Returns the name. More... | |
string | getDef (void) |
Returns the definition. More... | |
long | getWidth (void) const |
Returns the width. More... | |
RDBColumn::Type | getType (void) const |
Returns the type. More... | |
RDBColumn::Just | getJust (void) const |
Returns the justification. More... | |
string | getDesc (void) const |
Returns the description. More... | |
int | getPrecision (void) const |
Returns the precision. More... | |
bool | getThrow (void) const |
Returns the state of the exception throwing behavior. More... | |
char * | getErr (void) const |
Returns a brief description of the error condition. More... | |
int | getErrNo (void) const |
Returns the error status. More... | |
virtual bool | getData (double &data)=0 |
Returns the value of the current data element, converting if necessary. More... | |
virtual bool | getData (long &data)=0 |
Returns the value of the current data element, converting if necessary. More... | |
virtual bool | getData (string &data)=0 |
Returns the value of the current data element, converting if necessary. More... | |
Protected Member Functions | |
virtual istream & | read (istream &is) |
Called by the stream insertion operator. More... | |
virtual ostream & | write (ostream &os) const |
Called by the stream extraction operator. More... | |
void | cleanup (void) |
Deletes resources allocated by RDBColumnTmplt object. More... | |
![]() | |
void | convert (const double &idata, double &odata) |
Used to converted data based on user requests. More... | |
void | convert (const double &idata, long &odata) |
Used to converted data based on user requests. More... | |
void | convert (const double &idata, string &odata) |
Used to converted data based on user requests. More... | |
void | convert (const long &idata, double &odata) |
Used to converted data based on user requests. More... | |
void | convert (const long &idata, long &odata) |
Used to converted data based on user requests. More... | |
void | convert (const long &idata, string &odata) |
Used to converted data based on user requests. More... | |
void | convert (const string &idata, double &odata) |
Used to converted data based on user requests. More... | |
void | convert (const string &idata, long &odata) |
Used to converted data based on user requests. More... | |
void | convert (const string &idata, string &odata) |
Used to converted data based on user requests. More... | |
virtual istream & | extract (istream &is, double &data) |
Overridden in the subclass of this datatype. More... | |
virtual istream & | extract (istream &is, long &data) |
Overridden in the subclass of this datatype. More... | |
virtual istream & | extract (istream &is, string &data) |
Overridden in the subclass of this datatype. More... | |
virtual ostream & | insert (ostream &os, double &data) const |
Overridden in the subclass of this datatype. More... | |
virtual ostream & | insert (ostream &os, long &data) const |
Overridden in the subclass of this datatype. More... | |
virtual ostream & | insert (ostream &os, string &data) const |
Overridden in the subclass of this datatype. More... | |
Protected Attributes | |
Tmplt0 * | _data |
Pointer to the data managed by object. More... | |
size_t | _idx |
Index into the data. More... | |
size_t | _nelems |
Number of elements of data. More... | |
bool | _mine |
Indicates that RDBColumnTmplt is responsible for deallocating the data. More... | |
Tmplt0 | _groupvalue |
Current group value. More... | |
![]() | |
string | _name |
Name. More... | |
string | _def |
Definition. More... | |
long | _width |
Width. More... | |
RDBColumn::Type | _type |
Data type. More... | |
RDBColumn::Just | _just |
Justification. More... | |
string | _desc |
Description. More... | |
bool | _changed |
Indicates state for the definition field. More... | |
bool | _throw |
State of the exception throwing behavior. More... | |
int | _errno |
Error state. More... | |
int | _precision |
Precision used for stream output or numeric to string conversion. More... | |
stringstream | _strstrm |
Used for numeric to string conversion. More... | |
bool | _group |
This is a group column. More... | |
bool | _initgroup |
Group been initialized. More... | |
Additional Inherited Members | |
![]() | |
enum | Just |
Acceptable column justifications. More... | |
enum | Type |
Acceptable column types. More... | |
enum | Err |
Possible error conditions. More... | |
enum | Status |
Parameterizes RDBColumn interface for many data types.
Definition at line 38 of file RDBColumnTmplt.h.
RDBColumnTmplt< Tmplt0, Tmplt1, Tmplt2 >::RDBColumnTmplt | ( | const string & | name = "" , |
const string & | def = "" |
||
) |
Assigns name and definition.
name | the column name. |
def | the column definition. |
Allocates space for a single data element of type Tmplt1.
Definition at line 37 of file RDBColumnTmplt.cc.
RDBColumnTmplt< Tmplt0, Tmplt1, Tmplt2 >::RDBColumnTmplt | ( | const RDBColumnTmplt< Tmplt0, Tmplt1, Tmplt2 > & | rdbcolumntmplt | ) |
Copies RDBColumnTmplt object.
rdbcolumntmplt | col the RDBColumn object to copy. |
Makes a shallow copy of the argument. The two RDBColumn objects share data elements.
Definition at line 58 of file RDBColumnTmplt.cc.
RDBColumnTmplt< Tmplt0, Tmplt1, Tmplt2 >::~RDBColumnTmplt | ( | void | ) |
Deletes resources allocated by RDBColumnTmplt object.
Responsible for freeing data element memory allocated by the RDBColumn object.
Definition at line 76 of file RDBColumnTmplt.cc.
|
virtual |
Increments index to the RDBColumn's data elements.
Advances the automatic index for the data elements by one.
Implements RDBColumn.
Definition at line 212 of file RDBColumnTmplt.cc.
|
protected |
Deletes resources allocated by RDBColumnTmplt object.
Frees memory allocated by this object.
Definition at line 710 of file RDBColumnTmplt.cc.
|
virtual |
Returns a pointer to the current data element.
This method returns a pointer to the current data element. Modifications to the data returned are evident within this object.
Implements RDBColumn.
Definition at line 466 of file RDBColumnTmplt.cc.
|
virtual |
Returns the value of the current data element, converting if necessary.
data | assigned the value of the current data element in this object. |
Assigns the value of the current RDBColumn data element to the arguement.
Definition at line 484 of file RDBColumnTmplt.cc.
|
virtual |
Returns the value of the current data element, converting if necessary.
data | assigned the value of the current data element in this object. |
RDBErr | error if the user attempts to convert a string column with non-numeric data to a numeric arguemnt. |
RDBErr | error if the user attempts to convert a string column representing a floating point number to an integer argument. |
Assigns the value of the current RDBColumn data element to the arguement.
Definition at line 517 of file RDBColumnTmplt.cc.
|
virtual |
Returns the value of the current data element, converting if necessary.
data | assigned the value of the current data element in this object. |
RDBErr | error if the user attempts to convert a string column with non-numeric data to a numeric arguemnt. |
RDBErr | error if the user attempts to convert a string column representing a floating point number to an integer argument. |
Assigns the value of the current RDBColumn data element to the arguement.
Definition at line 550 of file RDBColumnTmplt.cc.
|
virtual |
Returns the value of the current data element, converting if necessary.
RDBErr | error if the user attempts to convert a string column with non-numeric data to a numeric arguemnt. |
Implements RDBColumn.
Definition at line 578 of file RDBColumnTmplt.cc.
|
virtual |
Returns the value of the current data element, converting if necessary.
RDBErr | error if the user attempts to convert a string column with non-numeric data to a numeric arguemnt. |
RDBErr | error if the user attempts to convert a string column representing a floating point number to an integer argument. |
Implements RDBColumn.
Definition at line 608 of file RDBColumnTmplt.cc.
|
virtual |
Returns the value of the current data element, converting if necessary.
Implements RDBColumn.
Definition at line 635 of file RDBColumnTmplt.cc.
|
virtual |
Maps data to user-supplied memory.
data | pointer to a data element of type Tmplt0. |
nelems | number of data elements in the array pointed by data. |
This method associates user allocated memory pointed to by data with this RDBColumn object. The used is responsible for freeing the memory pointed to by data after the RDBColumn is destroyed.
Definition at line 440 of file RDBColumnTmplt.cc.
|
virtual |
Returns the group status of this column object.
Implements RDBColumn.
Definition at line 285 of file RDBColumnTmplt.cc.
RDBColumn & RDBColumnTmplt< Tmplt0, Tmplt1, Tmplt2 >::operator= | ( | const RDBColumnTmplt< Tmplt0, Tmplt1, Tmplt2 > & | col | ) |
Copies RDBColumnTmplt object.
col | the RDBColumn object to copy. |
Makes a shallow copy of the argument. The two RDBColumn objects share data elements.
Definition at line 93 of file RDBColumnTmplt.cc.
|
virtual |
Assigns data to RDBColumn object's _data member, converting as necessary.
data | Assigns the value to the current RDBColumn data element. |
Definition at line 124 of file RDBColumnTmplt.cc.
|
virtual |
Assigns data to RDBColumn object's _data member, converting as necessary.
data |
RDBErr | error if the user attempts to convert non-numeric string data to a numeric column. |
RDBErr | error if the user attempts to convert string data representing a floating point number to an integer column. |
Assigns the value to the current RDBColumn data element.
Definition at line 155 of file RDBColumnTmplt.cc.
|
virtual |
Assigns data to RDBColumn object's _data member, converting as necessary.
data |
RDBErr | error if the user attempts to convert non-numeric string data to a numeric column. |
RDBErr | error if the user attempts to convert string data representing a floating point number to an integer column. |
Assigns the value to the current RDBColumn data element.
Definition at line 186 of file RDBColumnTmplt.cc.
|
protectedvirtual |
Called by the stream insertion operator.
is | input stream. |
Called by the RDBColumn stream extraction operator.
Implements RDBColumn.
Definition at line 666 of file RDBColumnTmplt.cc.
|
virtual |
Rewinds index to the RDBColumn's data elements.
Rewinds the automatic index for the data elements to the first element.
Implements RDBColumn.
Definition at line 228 of file RDBColumnTmplt.cc.
|
virtual |
Sets the data value, converting as necessary.
data |
Assigns the value to the current RDBColumn data element.
Definition at line 343 of file RDBColumnTmplt.cc.
|
virtual |
Sets the data value, converting as necessary.
data |
RDBErr | error if the user attempts to convert non-numeric string data to a numeric column. |
RDBErr | error if the user attempts to convert string data representing a floating point number to an integer column. |
Assigns the value to the current RDBColumn data element.
Definition at line 376 of file RDBColumnTmplt.cc.
|
virtual |
Sets the data value, converting as necessary.
data |
RDBErr | error if the user attempts to convert non-numeric string data to a numeric column. |
RDBErr | error if the user attempts to convert string data representing a floating point number to an integer column. |
Assigns the value to the current RDBColumn data element.
Definition at line 409 of file RDBColumnTmplt.cc.
|
virtual |
group | incidcates whether or not this is a group column. |
Reimplemented from RDBColumn.
Definition at line 242 of file RDBColumnTmplt.cc.
|
virtual |
Sets the group value to the current data value.
Sets the group for this object to the current data element.
Implements RDBColumn.
Definition at line 268 of file RDBColumnTmplt.cc.
|
protectedvirtual |
Called by the stream extraction operator.
os | output stream. |
Called by the RDBColumn stream insertion operator.
Implements RDBColumn.
Definition at line 696 of file RDBColumnTmplt.cc.
|
protected |
Pointer to the data managed by object.
Definition at line 120 of file RDBColumnTmplt.h.
|
protected |
Current group value.
Definition at line 129 of file RDBColumnTmplt.h.
|
protected |
Index into the data.
Definition at line 122 of file RDBColumnTmplt.h.
|
protected |
Indicates that RDBColumnTmplt is responsible for deallocating the data.
Definition at line 126 of file RDBColumnTmplt.h.
|
protected |
Number of elements of data.
Definition at line 124 of file RDBColumnTmplt.h.