SourcePro® C++ API Reference Guide

Product Documentation:
   SourcePro C++
Documentation Home
List of all members | Public Member Functions

An ordered collection of RWDBValue instances. More...

#include <rw/db/row.h>

Inheritance diagram for RWDBRow:
RWCollectable

Public Member Functions

 RWDBRow ()
 
 RWDBRow (const RWDBRow &rvalue)
 
virtual ~RWDBRow ()
 
virtual void append (const RWDBValue &value)
 
RWspace binaryStoreSize () const
 
virtual void clearAndDestroy ()
 
virtual int compareTo (const RWCollectable *c) const
 
virtual RWCollectablecopy () const
 
virtual size_t entries () const
 
virtual unsigned hash () const
 
virtual RWClassID isA () const
 
virtual bool isEqual (const RWCollectable *c) const
 
virtual RWCollectablenewSpecies () const
 
RWDBRowoperator= (const RWDBRow &rvalue)
 
RWDBValueoperator[] (size_t index) const
 
virtual void restoreGuts (RWFile &file)
 
virtual void restoreGuts (RWvistream &stream)
 
virtual void saveGuts (RWFile &file) const
 
virtual void saveGuts (RWvostream &stream) const
 
- Public Member Functions inherited from RWCollectable
virtual ~RWCollectable ()
 
RWspace recursiveStoreSize () const
 
RWStringID stringID () const
 

Additional Inherited Members

- Static Public Member Functions inherited from RWCollectable
static RWClassID classID (const RWStringID &name)
 
static RWClassID classIsA ()
 
static bool isAtom (RWClassID id)
 
static RWspace nilStoreSize ()
 

Detailed Description

RWDBRow is an ordered collection of RWDBValue objects. RWDBRow is a relatively low level construct used by the DB Interface Module to store a row of data on its way to or from the database. It is visible to applications for two reasons:

The only semantics that RWDBRow adds to RWCollectable are:

RWDBRow is designed around the Interface/Implementation paradigm. An RWDBRow instance is an interface to a reference-counted implementation; copy constructors and assignment operators produce additional references to a shared implementation.

Synopsis
#include <rw/db/row.h>
RWDBRow& r = myMemTable[i];

Constructor & Destructor Documentation

RWDBRow::RWDBRow ( )

The default constructor produces an empty RWDBRow.

RWDBRow::RWDBRow ( const RWDBRow rvalue)

Copy constructor. The created RWDBRow shares an implementation with rvalue.

virtual RWDBRow::~RWDBRow ( )
virtual

The default destructor.

Member Function Documentation

virtual void RWDBRow::append ( const RWDBValue value)
virtual

Appends value to self.

RWspace RWDBRow::binaryStoreSize ( ) const
virtual

Returns the number of bytes required to store self.

Reimplemented from RWCollectable.

virtual void RWDBRow::clearAndDestroy ( )
virtual

Removes all values from the collection and deletes them.

virtual int RWDBRow::compareTo ( const RWCollectable c) const
virtual

If c points to an RWDBRow, this method returns:

  • 0, if self and c share the same implementation
  • >0, if self has length greater than c
  • <0, if c has length greater than self

If self and c do not share the same implementation and both have the same length, compares each RWDBValue in self with each value in c. Returns 0 if all values compare equal, otherwise returns the result of the first comparison that does not return 0.

If c does not point to an RWDBRow, throws an std::bad_cast exception.

As a precondition, c is tested to determine if it is a null pointer. If null, the method asserts in debug mode, and throws RWInternalErr in optimized builds.

Reimplemented from RWCollectable.

virtual RWCollectable* RWDBRow::copy ( ) const
virtual

Returns a new, copy-constructed object of the same type as self. The caller is responsible for deleting the object.

Reimplemented from RWCollectable.

virtual size_t RWDBRow::entries ( ) const
virtual

Returns the total number of values in the collection.

virtual unsigned RWDBRow::hash ( ) const
virtual

Returns a hash value for use in collection classes.

Reimplemented from RWCollectable.

virtual RWClassID RWDBRow::isA ( ) const
virtual

Redefined from class RWCollectable. Returns __RWDBROW.

Reimplemented from RWCollectable.

virtual bool RWDBRow::isEqual ( const RWCollectable c) const
virtual

Returns true if compareTo(c) == 0, otherwise returns false.

Reimplemented from RWCollectable.

virtual RWCollectable* RWDBRow::newSpecies ( ) const
virtual

Returns a new, default-constructed object of the same type as self. The caller is responsible for deleting the object.

Reimplemented from RWCollectable.

RWDBRow& RWDBRow::operator= ( const RWDBRow rvalue)

Assignment operator. Returns reference to self which shares an implementation with rvalue.

RWDBValue& RWDBRow::operator[] ( size_t  index) const

Returns a reference to the RWDBValue at position index in the collection. Throws an exception of type RWBoundsErr if index is out of range.

virtual void RWDBRow::restoreGuts ( RWFile file)
virtual

Reads file, replacing the contents of self.

Reimplemented from RWCollectable.

virtual void RWDBRow::restoreGuts ( RWvistream stream)
virtual

Reads stream, replacing the contents of self.

Reimplemented from RWCollectable.

virtual void RWDBRow::saveGuts ( RWFile file) const
virtual

Writes the contents of self to file.

Reimplemented from RWCollectable.

virtual void RWDBRow::saveGuts ( RWvostream stream) const
virtual

Writes the contents of self to stream.

Reimplemented from RWCollectable.

Copyright © 2016 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.