SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Friends
RWDBCollectableExpr Class Reference

Adds RWCollectable semantics to RWDBExpr. More...

#include <rw/db/expr.h>

Inheritance diagram for RWDBCollectableExpr:
RWCollectable RWDBExpr

Public Member Functions

 RWDBCollectableExpr ()
 
 RWDBCollectableExpr (const RWDBExpr &expr)
 
RWspace binaryStoreSize () const
 
virtual int compareTo (const RWCollectable *c) const
 
virtual RWCollectablecopy () const
 
unsigned hash () const
 
virtual RWClassID isA () const
 
bool isEqual (const RWCollectable *expr) const
 
virtual RWCollectablenewSpecies () 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
 
- Public Member Functions inherited from RWDBExpr
 RWDBExpr ()
 
 RWDBExpr (const RWDBExpr &expr)
 
 RWDBExpr (char value)
 
 RWDBExpr (unsigned char value)
 
 RWDBExpr (short value)
 
 RWDBExpr (unsigned short value)
 
 RWDBExpr (int value)
 
 RWDBExpr (unsigned int value)
 
 RWDBExpr (long int value)
 
 RWDBExpr (unsigned long int value)
 
 RWDBExpr (long long value)
 
 RWDBExpr (unsigned long long value)
 
 RWDBExpr (float value)
 
 RWDBExpr (double value)
 
 RWDBExpr (long double value)
 
 RWDBExpr (const char *value)
 
 RWDBExpr (const wchar_t *value)
 
 RWDBExpr (const RWCString &value)
 
 RWDBExpr (const RWDecimalPortable &value)
 
 RWDBExpr (const RWDateTime &value)
 
 RWDBExpr (const RWDBDateTime &value)
 
 RWDBExpr (const RWDBDuration &value)
 
 RWDBExpr (const RWDate &value)
 
 RWDBExpr (const RWTime &value)
 
 RWDBExpr (const RWDBBlob &value)
 
 RWDBExpr (const RWBasicUString &value)
 
 RWDBExpr (const RWDBMBString &value)
 
 RWDBExpr (const RWWString &value)
 
 RWDBExpr (const RWDBValue &value, bool usePhraseBook=true)
 
 RWDBExpr (const RWDBColumn &column)
 
 RWDBExpr (const RWDBSelectorBase &subSelect)
 
 RWDBExpr (RWDBValueManip manip)
 
 RWDBExpr (const RWCollection &collection)
 
 RWDBExpr (const RWDBTable &)
 
 RWDBExpr (const RWDBColumn &left, const RWDBExpr &right)
 
 RWDBExpr (const RWDBColumn &left, const RWDBValue &right)
 
RWCString asString (const RWDBPhraseBook &phraseBook, AsStringControlFlag control=normal) const
 
RWDBCriterion between (const RWDBExpr &expression1, const RWDBExpr &expression2) const
 
RWDBCriterion in (const RWDBExpr &expression1) const
 
RWDBCriterion isNull (void) const
 
bool isValid (void) const
 
RWDBCriterion leftOuterJoin (const RWDBExpr &expression) const
 
RWDBCriterion like (const RWDBExpr &expression1) const
 
RWDBCriterion matchUnique (const RWDBExpr &expression1) const
 
RWDBExproperator= (const RWDBExpr &expr)
 
RWDBCriterion rightOuterJoin (const RWDBExpr &expression) const
 

Friends

RWvostreamoperator<< (RWvostream &v, const RWDBCollectableExpr &Cl)
 
RWFileoperator<< (RWFile &f, const RWDBCollectableExpr &Cl)
 
RWvistreamoperator>> (RWvistream &s, RWDBCollectableExpr *&pCl)
 
RWFileoperator>> (RWFile &f, RWDBCollectableExpr *&pCl)
 
RWvistreamoperator>> (RWvistream &v, RWDBCollectableExpr &Cl)
 
RWFileoperator>> (RWFile &f, RWDBCollectableExpr &Cl)
 

Additional Inherited Members

- Public Types inherited from RWDBExpr
enum  AsStringControlFlag { normal, suppressTagsOnColumns, noPlaceHolder, placeHolderNotRecommended }
 
- 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

RWDBCollectableExpr adds RWCollectable semantics to RWDBExpr. The DB Interface Module uses RWDBCollectableExpr internally to store lists of RWDBExpr objects. Applications requiring similar functionality can do the same.

Synopsis
#include <rw/db/expr.h>
See also
RWDBCollectableExpr is a special case of RWDBExpr. See RWDBExpr for details. See your Essential Tools Module documentation for details about RWCollectable.

Constructor & Destructor Documentation

RWDBCollectableExpr::RWDBCollectableExpr ( )

The default constructor builds an empty RWDBCollectableExpr, that is, one whose asString() method returns an SQL NULL keyword, as specified in its parameter phraseBook. Since an empty expression cannot hold a value, RWDBCollectableExpr() cannot be used as NULL value.

RWDBCollectableExpr::RWDBCollectableExpr ( const RWDBExpr expr)

Creates an RWDBCollectableExpr from the given expr.

Member Function Documentation

RWspace RWDBCollectableExpr::binaryStoreSize ( ) const
virtual

Returns the number of bytes used by the virtual function saveGuts(RWFile&) to store an object. Typically, this involves adding up the space required to store all primitives, plus the results of calling recursiveStoreSize() for all objects inheriting from RWCollectable. See the Essential Tools Module User's Guide for details.

Reimplemented from RWCollectable.

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

If c points to an RWDBCollectableExpr, returns the result of asString().compareTo(c->asString()) using the default phrasebook, otherwise returns a nonzero value.

Reimplemented from RWCollectable.

virtual RWCollectable* RWDBCollectableExpr::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.

unsigned RWDBCollectableExpr::hash ( ) const
virtual

Returns asString().hash().

Reimplemented from RWCollectable.

virtual RWClassID RWDBCollectableExpr::isA ( ) const
virtual

Returns __RWDBCOLLECTABLEEXPR.

Reimplemented from RWCollectable.

bool RWDBCollectableExpr::isEqual ( const RWCollectable t) const
virtual

Behaves as if compareTo(t) was invoked, returning true if the result equals 0, false otherwise.

Reimplemented from RWCollectable.

virtual RWCollectable* RWDBCollectableExpr::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.

virtual void RWDBCollectableExpr::restoreGuts ( RWFile )
virtual

Reads an object's state from a binary file, using class RWFile, replacing the previous state.

Reimplemented from RWCollectable.

virtual void RWDBCollectableExpr::restoreGuts ( RWvistream )
virtual

Reads an object's state from an input stream, replacing the previous state.

Reimplemented from RWCollectable.

virtual void RWDBCollectableExpr::saveGuts ( RWFile ) const
virtual

Writes an object's state to a binary file, using class RWFile.

Reimplemented from RWCollectable.

virtual void RWDBCollectableExpr::saveGuts ( RWvostream ) const
virtual

Writes an object's state to an output stream.

Reimplemented from RWCollectable.

Friends And Related Function Documentation

RWvostream& operator<< ( RWvostream v,
const RWDBCollectableExpr Cl 
)
friend

Saves the object obj to a virtual stream. Recursively calls the virtual function saveGuts(), taking duplicate objects into account. See the discussion on Persistence in the Essential Tools Module User's Guide for more information.

Note
Bound variables in the expression are evaluated at the time the expression is persisted.
Column names are persisted without an associated table name or table tag.
RWFile& operator<< ( RWFile f,
const RWDBCollectableExpr Cl 
)
friend

Saves the object obj to an RWFile. Recursively calls the virtual function saveGuts(), taking duplicate objects into account. See the discussion on Persistence in the Essential Tools Module User's Guide for more information.

Note
Bound variables in the expression are evaluated at the time the expression is persisted.
Column names are persisted without an associated table name or table tag.
RWvistream& operator>> ( RWvistream s,
RWDBCollectableExpr *&  pCl 
)
friend

Looks at the next object on the input stream or RWFile, respectively, and either creates a new object of the proper type off the heap and returns a pointer to it, or else returns a pointer to a previously read instance. Recursively calls the virtual function restoreGuts(), taking duplicate objects into account. If an object is created off the heap, then you are responsible for deleting it. For more information, see the discussion on Persistence in the Essential Tools Module User's Guide.

Various exceptions that could be thrown are RWInternalErr (if the RWFactory does not know how to make the object), and RWExternalErr (corrupted stream or file). If an exception is thrown during this call, the pointer to the partly restored object may be lost, creating a memory leak. For this reason, you may prefer to use the static method RWCollectable::tryRecursiveRestore().

RWFile& operator>> ( RWFile f,
RWDBCollectableExpr *&  pCl 
)
friend

Looks at the next object on the input stream or RWFile, respectively, and either creates a new object of the proper type off the heap and returns a pointer to it, or else returns a pointer to a previously read instance. Recursively calls the virtual function restoreGuts(), taking duplicate objects into account. If an object is created off the heap, then you are responsible for deleting it. For more information, see the discussion on Persistence in the Essential Tools Module User's Guide.

Various exceptions that could be thrown are RWInternalErr (if the RWFactory does not know how to make the object), and RWExternalErr (corrupted stream or file). If an exception is thrown during this call, the pointer to the partly restored object may be lost, creating a memory leak. For this reason, you may prefer to use the static method RWCollectable::tryRecursiveRestore().

RWvistream& operator>> ( RWvistream v,
RWDBCollectableExpr Cl 
)
friend

Restores an RWDBCollectableExpr into obj from a virtual stream, replacing the previous contents of obj. Recursively calls the virtual function restoreGuts(), taking duplicate objects into account. For more information, see the discussion on Persistence in the Essential Tools Module User's Guide.

Various exceptions that could be thrown are RWInternalErr (if the RWFactory does not know how to make the object), and RWExternalErr (corrupted stream or file).

RWFile& operator>> ( RWFile f,
RWDBCollectableExpr Cl 
)
friend

Restores an RWDBCollectableExpr into obj from an RWFile, replacing the previous contents of obj. Recursively calls the virtual function restoreGuts(), taking duplicate objects into account. For more information, see the discussion on Persistence in the Essential Tools Module User's Guide.

Various exceptions that could be thrown are RWInternalErr (if the RWFactory does not know how to make the object), and RWExternalErr (corrupted stream or file).

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