In file /home/eternity/Source/Common/GMessage/H/table.h:

class Table : public Debugable

Table class

Inheritance:

Table < Debugable


Public Methods

Int Table::CanDelete ()
Checks if the Delete operation can be done
Int Table::CanUpdate ()
Checks if the Update operation can be done
Err Table::Close ()
Closes the file in which the table is stored
Char* Table::CreateTmpFileName ()
Returns the name of a temporary file for this table
Err Table::DeleteRecord ()
Deletes the last read record (see conditions described in CanDelete)
Record* Table::FindFirst ( const Char *aFieldName, const Void *aFieldValue)
Kratky_komentar_s_teckou_na_konci
Record* Table::FindNext ()
Kratky_komentar_s_teckou_na_konci
Record* Table::First ()
Returns the first record of the table
Char* Table::GetFileName ()
Returns the name of the file in which this table is kept
Err Table::InsertRecord (Record *aRecord)
Appends the specified record to the table
Int Table::IsFixed ()
1 if the stored records are of the same size
Int Table::IsOpen ()
1 if the table is open
Record* Table::NewRecord ()
Creates an empty record according to the "definition" TableFieldQueue
Record* Table::Next ()
Returns the succeeding record of the table
Err Table::Open ()
Opens the file in which the table is stored
Record* Table::ReadRecord ()
Kratky_komentar_s_teckou_na_konci
Size Table::ReadRecordLength ()
Reads the header part of the record from the file to find out its length
Err Table::Remove ()
Removes the file in which the table is stored
Table::Table (const Char *fileName, TableFieldQueue *aDefinition, LogFile *aLogFile)
Table constructor
Err Table::UpdateRecord (Record *aRecord)
Updates the last accessed record (see conditions described in CanUpdate
Err Table::WriteRecord (Record *aRecord)
Writes the specified record at the current file position
Table::~Table ()
Kratky_komentar_s_teckou_na_konci

Public

methods
Table (const Char *fileName, TableFieldQueue *aDefinition, LogFile *aLogFile = NULL)
constructor
~Table ()
destructor

information providers

table manipulation

table iteration

record manipulation

record searching

Protected

attributes
methods

Inherited from Debugable:

Public Methods

string* Debugable::CreateString(char *firstStr, int firstInt, int secondInt)
Debugable::Debugable(LogFile * debugLogFile)
int Debugable::SetDebugOptions(int newLogOptions)
void Debugable::SetLogFile(LogFile *aLogFile)
void Debugable::WriteString(LogLevel debugLevel, char * format, ...)
Debugable::~Debugable()

Documentation

Table class. enables to define a table, to insert, update or delete records, to iterate trough the table, to search appropriate records by the value in the specified field.

Description: This file contains the Table class which enables persistent "table-like" storage of information with sequential access only. ATTENTION:

  • Methods First, Next, FindFirst, FindNext return NEW INSTANCE of class Record. Therefore every object returned by these should be disposed off.
  • Table takes no responsibility for freeing searchValue (used in FindFirst and FindNext methods) because searching e.g. for an integer is simply done this way:
    Int searchFor = 100;
    Record *r = table->FindFirst("Integer field", searchFor);
    
    In such a case there would be no sense to free searchFor, even more it would be a mistake.

    Remember that changing contents of memory pointed to by searchValue means searching for new value (FindFirst doesn't create its own copy of *searchValue - it cannot, because it would have to know how many bytes it should copy. That seemed ugly to me.).

  • attributes

    methods

    methods

    Table(const Char *fileName, TableFieldQueue *aDefinition, LogFile *aLogFile = NULL)
    constructor

    ~Table()
    destructor

    information providers

    table manipulation

    table iteration

    record manipulation

    record searching

    Int Table::CanDelete()
    Checks if the Delete operation can be done. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Int Table::CanUpdate()
    Checks if the Update operation can be done. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Err Table::Close()
    Closes the file in which the table is stored. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Char* Table::CreateTmpFileName()
    Returns the name of a temporary file for this table. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Err Table::DeleteRecord()
    Deletes the last read record (see conditions described in CanDelete). Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Record* Table::FindFirst( const Char *aFieldName, const Void *aFieldValue)
    Kratky_komentar_s_teckou_na_konci. Returns the first record from the beginning of the table where the field of name "aFieldName" has a value matching "aFieldValue".
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Record* Table::FindNext()
    Kratky_komentar_s_teckou_na_konci. Returns the next record matching criteria specified in FindFirst(). A call to FindFirst() must preceed the call to FindNext().
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Record* Table::First()
    Returns the first record of the table. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Char* Table::GetFileName()
    Returns the name of the file in which this table is kept. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Err Table::InsertRecord(Record *aRecord)
    Appends the specified record to the table. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Int Table::IsFixed()
    1 if the stored records are of the same size. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Int Table::IsOpen()
    1 if the table is open. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Record* Table::NewRecord()
    Creates an empty record according to the "definition" TableFieldQueue. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Record* Table::Next()
    Returns the succeeding record of the table. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Err Table::Open()
    Opens the file in which the table is stored. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Record* Table::ReadRecord()
    Kratky_komentar_s_teckou_na_konci. Creates new instance of Record, reads the data from the current file pointer position, fills the newly created record wiht it.
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Size Table::ReadRecordLength()
    Reads the header part of the record from the file to find out its length. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Err Table::Remove()
    Removes the file in which the table is stored. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Table::Table(const Char *fileName, TableFieldQueue *aDefinition, LogFile *aLogFile)
    Table constructor. Description: This file contains the Table class which enables persistent "table-like" storage of information with sequential access only.
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Err Table::UpdateRecord(Record *aRecord)
    Updates the last accessed record (see conditions described in CanUpdate. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Err Table::WriteRecord(Record *aRecord)
    Writes the specified record at the current file position. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka

    Table::~Table()
    Kratky_komentar_s_teckou_na_konci. Dlouhy_komentar
    Returns:
    co
    Parameters:
    parametr -
    Author:
    Pavel
    See Also:
    co_se_toho_tyka


    Direct child classes:
    TimeSortedTable
    TCBTable
    Author:
    Pavel
    See Also:
    TableField

    alphabetic index hierarchy of classes


    generated by doc++