SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (char value)
 
 RWDBExpr (const char *value)
 
 RWDBExpr (const RWBasicUString &value)
 
 RWDBExpr (const RWCollection &collection)
 
 RWDBExpr (const RWCString &value)
 
 RWDBExpr (const RWDate &value)
 
 RWDBExpr (const RWDateTime &value)
 
 RWDBExpr (const RWDBBlob &value)
 
 RWDBExpr (const RWDBColumn &column)
 
 RWDBExpr (const RWDBColumn &left, const RWDBExpr &right)
 
 RWDBExpr (const RWDBColumn &left, const RWDBValue &right)
 
 RWDBExpr (const RWDBDateTime &value)
 
 RWDBExpr (const RWDBDuration &value)
 
 RWDBExpr (const RWDBExpr &expr)
 
 RWDBExpr (const RWDBMBString &value)
 
 RWDBExpr (const RWDBSelectorBase &subSelect)
 
 RWDBExpr (const RWDBTable &)
 
 RWDBExpr (const RWDBValue &value, bool usePhraseBook=true)
 
 RWDBExpr (const RWDecimalPortable &value)
 
 RWDBExpr (const RWTime &value)
 
 RWDBExpr (const RWWString &value)
 
 RWDBExpr (const wchar_t *value)
 
 RWDBExpr (double value)
 
 RWDBExpr (float value)
 
 RWDBExpr (int value)
 
 RWDBExpr (long double value)
 
 RWDBExpr (long int value)
 
 RWDBExpr (long long value)
 
 RWDBExpr (RWDBValueManip manip)
 
 RWDBExpr (short value)
 
 RWDBExpr (unsigned char value)
 
 RWDBExpr (unsigned int value)
 
 RWDBExpr (unsigned long int value)
 
 RWDBExpr (unsigned long long value)
 
 RWDBExpr (unsigned short value)
 
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

RWFileoperator<< (RWFile &f, const RWDBCollectableExpr &Cl)
 
RWvostreamoperator<< (RWvostream &v, const RWDBCollectableExpr &Cl)
 
RWFileoperator>> (RWFile &f, RWDBCollectableExpr &Cl)
 
RWFileoperator>> (RWFile &f, RWDBCollectableExpr *&pCl)
 
RWvistreamoperator>> (RWvistream &s, RWDBCollectableExpr *&pCl)
 
RWvistreamoperator>> (RWvistream &v, 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() [1/2]

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() [2/2]

RWDBCollectableExpr::RWDBCollectableExpr ( const RWDBExpr & expr)

Creates an RWDBCollectableExpr from the given expr.

Member Function Documentation

◆ binaryStoreSize()

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.

◆ compareTo()

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.

◆ copy()

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.

◆ hash()

unsigned RWDBCollectableExpr::hash ( ) const
virtual

Returns asString().hash().

Reimplemented from RWCollectable.

◆ isA()

virtual RWClassID RWDBCollectableExpr::isA ( ) const
virtual

Returns __RWDBCOLLECTABLEEXPR.

Reimplemented from RWCollectable.

◆ isEqual()

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.

◆ newSpecies()

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.

◆ restoreGuts() [1/2]

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.

◆ restoreGuts() [2/2]

virtual void RWDBCollectableExpr::restoreGuts ( RWvistream & )
virtual

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

Reimplemented from RWCollectable.

◆ saveGuts() [1/2]

virtual void RWDBCollectableExpr::saveGuts ( RWFile & ) const
virtual

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

Reimplemented from RWCollectable.

◆ saveGuts() [2/2]

virtual void RWDBCollectableExpr::saveGuts ( RWvostream & ) const
virtual

Writes an object's state to an output stream.

Reimplemented from RWCollectable.

Friends And Related Symbol Documentation

◆ operator<< [1/2]

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.

◆ operator<< [2/2]

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.

◆ operator>> [1/4]

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).

◆ operator>> [2/4]

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().

◆ operator>> [3/4]

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().

◆ operator>> [4/4]

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).

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