MDBL Library
|
#include <Table.hpp>
Public Types | |
enum | RowTypes { INSERTED = 0x01, UPDATED = 0x02, DELETED = 0x04, ALL = (INSERTED | UPDATED | DELETED) } |
enum | { PERSISTENT = 0x00, TRANSIENT = 0x01, READ_WRITE = 0x00, READ_ONLY = 0x02, DEFAULTS = (PERSISTENT | READ_WRITE) } |
Public Member Functions | |
CTable (CMDB &oDB, const tchar *pszName, uint nFlags=DEFAULTS) | |
virtual | ~CTable () |
const CString & | Name () const |
bool | Transient () const |
bool | ReadOnly () const |
CMDB & | DB () const |
virtual size_t | ColumnCount () const |
virtual const CColumn & | Column (size_t n) const |
virtual size_t | AddColumn (const tchar *pszName, COLTYPE eType, size_t nLength, uint nFlags=CColumn::DEFAULTS) |
virtual size_t | AddColumn (const tchar *pszName, CTable &oTable, size_t nColumn, uint nFlags=CColumn::FOREIGNKEY) |
virtual void | DropColumn (size_t nColumn) |
virtual void | DropAllColumns () |
virtual size_t | FindColumn (const tchar *pszName) |
virtual void | AddIndex (size_t nColumn) |
virtual void | DropIndex (size_t nColumn) |
virtual size_t | RowCount () const |
virtual CRow & | Row (size_t n) const |
virtual CRow & | operator[] (size_t n) const |
virtual CRow & | CreateRow () |
virtual size_t | InsertRow (CRow &oRow, bool bNew=true) |
virtual void | DeleteRow (size_t nRow) |
virtual void | DeleteRow (CRow &oRow) |
virtual void | DeleteRows (const CResultSet &oRS) |
virtual void | Truncate () |
virtual void | CopyTable (const CTable &oTable) |
virtual CRow & | NullRow () |
virtual bool | IsNullRow (CRow &oRow) const |
virtual CResultSet | SelectAll () const |
virtual CRow * | SelectRow (size_t nColumn, const CValue &oValue) const |
virtual CResultSet | Select (const CWhere &oQuery) const |
virtual bool | Exists (const CWhere &oQuery) const |
virtual bool | Modified () const |
virtual void | Modified (bool bModified) |
virtual void | Read (WCL::IInputStream &rStream) |
virtual void | Write (WCL::IOutputStream &rStream) |
virtual void | Read (CSQLSource &rSource) |
virtual void | Write (CSQLSource &rSource, RowTypes eRows=ALL) |
virtual void | ResetRowFlags () |
virtual void | Dump (WCL::IOutputStream &rStream) const |
Protected Member Functions | |
virtual void | OnBeforeInsert (CRow &oRow) |
virtual void | OnAfterInsert (CRow &oRow) |
virtual void | OnBeforeDelete (CRow &oRow) |
virtual void | OnAfterDelete (CRow &oRow) |
virtual CString | SQLColumnList () const |
virtual CString | SQLQuery () const |
virtual void | TruncateIndexes () |
virtual void | WriteInsertions (CSQLSource &rSource) |
virtual void | WriteUpdates (CSQLSource &rSource) |
virtual void | WriteDeletions (CSQLSource &rSource) |
virtual void | CheckIndexes () const |
virtual void | CheckRow (CRow &oRow, bool bUpdate) const |
virtual void | CheckColumn (CRow &oRow, size_t nColumn, const CValue &oValue, bool bUpdate) const |
Protected Attributes | |
CMDB & | m_oDB |
CString | m_strName |
uint | m_nFlags |
CColumnSet | m_vColumns |
CRowSet | m_vRows |
size_t | m_nInsertions |
size_t | m_nUpdates |
size_t | m_nDeletions |
size_t | m_nIdentCol |
int | m_nIdentVal |
CRow * | m_pNullRow |
CString | m_strSQLTable |
CString | m_strSQLWhere |
CString | m_strSQLGroup |
CString | m_strSQLOrder |
Private Member Functions | |
CTable (const CTable &) | |
CTable & | operator= (const CTable &) |
Friends | |
class | CRow |
class | CField |
enum CTable::RowTypes |
CTable::CTable | ( | CMDB & | oDB, |
const tchar * | pszName, | ||
uint | nFlags = DEFAULTS |
||
) |
CTable::~CTable | ( | ) | [virtual] |
CTable::CTable | ( | const CTable & | ) | [private] |
const CString & CTable::Name | ( | ) | const [inline] |
bool CTable::Transient | ( | ) | const [inline] |
bool CTable::ReadOnly | ( | ) | const [inline] |
CMDB & CTable::DB | ( | ) | const [inline] |
size_t CTable::ColumnCount | ( | ) | const [inline, virtual] |
const CColumn & CTable::Column | ( | size_t | n | ) | const [inline, virtual] |
size_t CTable::AddColumn | ( | const tchar * | pszName, |
COLTYPE | eType, | ||
size_t | nLength, | ||
uint | nFlags = CColumn::DEFAULTS |
||
) | [virtual] |
size_t CTable::AddColumn | ( | const tchar * | pszName, |
CTable & | oTable, | ||
size_t | nColumn, | ||
uint | nFlags = CColumn::FOREIGNKEY |
||
) | [virtual] |
void CTable::DropColumn | ( | size_t | nColumn | ) | [virtual] |
void CTable::DropAllColumns | ( | ) | [virtual] |
size_t CTable::FindColumn | ( | const tchar * | pszName | ) | [inline, virtual] |
void CTable::AddIndex | ( | size_t | nColumn | ) | [virtual] |
void CTable::DropIndex | ( | size_t | nColumn | ) | [virtual] |
size_t CTable::RowCount | ( | ) | const [inline, virtual] |
CRow & CTable::Row | ( | size_t | n | ) | const [inline, virtual] |
CRow & CTable::operator[] | ( | size_t | n | ) | const [inline, virtual] |
CRow & CTable::CreateRow | ( | ) | [virtual] |
size_t CTable::InsertRow | ( | CRow & | oRow, |
bool | bNew = true |
||
) | [virtual] |
void CTable::DeleteRow | ( | size_t | nRow | ) | [virtual] |
void CTable::DeleteRow | ( | CRow & | oRow | ) | [virtual] |
void CTable::DeleteRows | ( | const CResultSet & | oRS | ) | [virtual] |
void CTable::Truncate | ( | ) | [virtual] |
void CTable::CopyTable | ( | const CTable & | oTable | ) | [virtual] |
CRow & CTable::NullRow | ( | ) | [virtual] |
bool CTable::IsNullRow | ( | CRow & | oRow | ) | const [inline, virtual] |
CResultSet CTable::SelectAll | ( | ) | const [virtual] |
CRow * CTable::SelectRow | ( | size_t | nColumn, |
const CValue & | oValue | ||
) | const [virtual] |
CResultSet CTable::Select | ( | const CWhere & | oQuery | ) | const [virtual] |
bool CTable::Exists | ( | const CWhere & | oQuery | ) | const [virtual] |
bool CTable::Modified | ( | ) | const [virtual] |
void CTable::Modified | ( | bool | bModified | ) | [virtual] |
void CTable::Read | ( | WCL::IInputStream & | rStream | ) | [virtual] |
void CTable::Write | ( | WCL::IOutputStream & | rStream | ) | [virtual] |
void CTable::Read | ( | CSQLSource & | rSource | ) | [virtual] |
void CTable::Write | ( | CSQLSource & | rSource, |
RowTypes | eRows = ALL |
||
) | [virtual] |
void CTable::ResetRowFlags | ( | ) | [virtual] |
void CTable::Dump | ( | WCL::IOutputStream & | rStream | ) | const [virtual] |
void CTable::OnBeforeInsert | ( | CRow & | oRow | ) | [protected, virtual] |
void CTable::OnAfterInsert | ( | CRow & | oRow | ) | [protected, virtual] |
void CTable::OnBeforeDelete | ( | CRow & | oRow | ) | [protected, virtual] |
void CTable::OnAfterDelete | ( | CRow & | oRow | ) | [protected, virtual] |
CString CTable::SQLColumnList | ( | ) | const [protected, virtual] |
CString CTable::SQLQuery | ( | ) | const [protected, virtual] |
void CTable::TruncateIndexes | ( | ) | [protected, virtual] |
void CTable::WriteInsertions | ( | CSQLSource & | rSource | ) | [protected, virtual] |
void CTable::WriteUpdates | ( | CSQLSource & | rSource | ) | [protected, virtual] |
void CTable::WriteDeletions | ( | CSQLSource & | rSource | ) | [protected, virtual] |
void CTable::CheckIndexes | ( | ) | const [protected, virtual] |
void CTable::CheckRow | ( | CRow & | oRow, |
bool | bUpdate | ||
) | const [protected, virtual] |
void CTable::CheckColumn | ( | CRow & | oRow, |
size_t | nColumn, | ||
const CValue & | oValue, | ||
bool | bUpdate | ||
) | const [protected, virtual] |
friend class CRow [friend] |
friend class CField [friend] |
CMDB& CTable::m_oDB [protected] |
CString CTable::m_strName [protected] |
uint CTable::m_nFlags [protected] |
CColumnSet CTable::m_vColumns [protected] |
CRowSet CTable::m_vRows [protected] |
size_t CTable::m_nInsertions [protected] |
size_t CTable::m_nUpdates [protected] |
size_t CTable::m_nDeletions [protected] |
size_t CTable::m_nIdentCol [protected] |
int CTable::m_nIdentVal [protected] |
CRow* CTable::m_pNullRow [protected] |
CString CTable::m_strSQLTable [protected] |
CString CTable::m_strSQLWhere [protected] |
CString CTable::m_strSQLGroup [protected] |
CString CTable::m_strSQLOrder [protected] |