Represents a parameterized memory table. More...
#include <rw/db/tpmemtab.h>
Additional Inherited Members | |
Public Types inherited from RWDBTable | |
enum | CacheType { Local, All } |
enum | Metadata { None, ColumnList, DefaultValues, IdentityConstraint, PrimaryKey } |
Related Functions inherited from RWDBTable | |
RWDBTable::Metadata | operator& (RWDBTable::Metadata lhs, RWDBTable::Metadata rhs) |
RWDBTable::Metadata & | operator&= (RWDBTable::Metadata &lhs, RWDBTable::Metadata rhs) |
RWDBTable::Metadata | operator^ (RWDBTable::Metadata lhs, RWDBTable::Metadata rhs) |
RWDBTable::Metadata & | operator^= (RWDBTable::Metadata &lhs, RWDBTable::Metadata rhs) |
RWDBTable::Metadata | operator| (RWDBTable::Metadata lhs, RWDBTable::Metadata rhs) |
RWDBTable::Metadata & | operator|= (RWDBTable::Metadata &lhs, RWDBTable::Metadata rhs) |
RWDBTable::Metadata | operator~ (RWDBTable::Metadata md) |
This class represents a parameterized memory table. Not only can the type of the object inserted into the memory table be parameterized, but also the implementation.
Parameter T
represents the type of the object to be stored in the memory table. It can be a class or a built-in type. The class must have:
T::T(const T&)
or the equivalent)T::operator=(const T&)
or the equivalent)C
. For Rogue Wave collections, this includes a default constructor.T:
Parameter C
represents the pointer- based template collection used as the implementation of the memory table. It must have:
void insert(T*)
methodT* operator[](size_t)
methodsize_t entries()
methodPossible choices for C
are classes RWTPtrSlist and RWTPtrOrderedVector of the Essential Tools Module.
The constructors for the class dynamically allocate space for the elements of type T
that are placed in the collection. It is the application's responsibility to free this memory when the RWDBTPtrMemTable goes out of scope. An effective way to do this is to have the collection class C
call operator delete
on each of the entries in its destructor.
RWDBTPtrMemTable< T, C >::RWDBTPtrMemTable | ( | size_t | maxElements = 0 | ) |
Constructor that builds an empty instance with an upper limit of maxElements. If maxElements is zero, no upper limit is imposed on the number of elements in the memory table.
RWDBTPtrMemTable< T, C >::RWDBTPtrMemTable | ( | const RWDBTable & | table, |
size_t | maxElements = 0 |
||
) |
Constructor that builds an instance with an upper limit of maxElements. If maxElements is zero, no upper limit is imposed on the number of elements in the memory table. After building the memory table, an RWDBReader instance is created on the table. From this reader, up to maxElements instances of class T
are allocated and inserted into the memory table. It is the application's responsibility to free the memory associated with the table.
RWDBTPtrMemTable< T, C >::RWDBTPtrMemTable | ( | const RWDBTable & | table, |
const RWDBConnection & | connection, | ||
size_t | maxElements = 0 |
||
) |
Constructor that builds an instance with an upper limit of maxElements. If maxElements is zero, no upper limit is imposed on the number of elements in the memory table. After building the memory table, an RWDBReader instance, using the connection specified by connection, is created on the table. From this reader, up to maxElements instances of class T
are allocated and inserted into the memory table. It is the application's responsibility to free the memory associated with the table.
RWDBTPtrMemTable< T, C >::RWDBTPtrMemTable | ( | const RWDBSelectorBase & | selector, |
size_t | maxElements = 0 |
||
) |
Constructor that builds an instance with an upper limit of maxElements. If maxElements is zero, no upper limit is imposed on the number of elements in the memory table. After building the memory table, an RWDBReader instance is created on the selector. From this reader, up to maxElements instances of class T
are allocated and inserted into the memory table. It is the application's responsibility to free the memory associated with the table.
RWDBTPtrMemTable< T, C >::RWDBTPtrMemTable | ( | const RWDBSelectorBase & | selector, |
const RWDBConnection & | connection, | ||
size_t | maxElements = 0 |
||
) |
Constructor that builds an instance with an upper limit of maxElements. If maxElements is zero, no upper limit is imposed on the number of elements in the memory table. After building the memory table, an RWDBReader instance, using the connection specified by connection, is created on the selector. From this reader, up to maxElements instances of class T
are allocated and inserted into the memory table. It is the application's responsibility to free the memory associated with the table.
RWDBTPtrMemTable< T, C >::RWDBTPtrMemTable | ( | RWDBReader & | reader, |
size_t | maxElements = 0 |
||
) |
Constructor that builds an instance with an upper limit of maxElements. If maxElements is zero, no upper limit is imposed on the number of elements in the memory table. After building the memory table, the RWDBReader instance reader is used to allocate and insert into the memory table up to maxElements instances of class T
. It is the application's responsibility to free the memory associated with the table.
size_t RWDBTPtrMemTable< T, C >::entries | ( | ) |
Returns number of rows in self. Uses user-defined method C::entries()
.
T* RWDBTPtrMemTable< T, C >::operator[] | ( | size_t | index | ) |
Returns a pointer to the T*
in self at position index. Uses user-defined operator T* C::operator[](size_t index)
.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |