/******************************************************************************/ /* File : TSschema.h */ /* Schema : bdeschema.sch */ /* GENCPP Version : Chgen V 12 - Sathya */ /******************************************************************************/ #ifndef __TSSCHEMA_H__ #define __TSSCHEMA_H__ #include "bdeschema.h" #ifdef USE_STL #include #endif /* USE_STL */ class TT ; class VV ; #ifndef USE_STL class TS : public RC /* ts_type - statistics about this Table in View */ { private : hcg_key VVid; /* fkey to ViewVersion for this TSrow */ hcg_key TTid; /* fkey to TTrow for this TSrow */ int verno; /* version number of TT in VV */ int maxrow; /* max row# in this table and VV */ int vvrowcnt; /* row-count of this TT in parent VV only*/ public : TT *TTid_pp; void *TTid_fpp; void *TTid_bpp; VV *VVid_pp; void *VVid_fpp; void *VVid_bpp; TS *prev_ptr; TS *next_ptr; void set_VVid (hcg_key id); void set_TTid (hcg_key id); void set_verno (int value); void set_maxrow (int value); void set_vvrowcnt (int value); hcg_key get_VVid (); hcg_key get_TTid (); int get_verno (); int get_maxrow (); int get_vvrowcnt (); TS* create_row(); void link_row () ; void parse_row (char *buffer, int idx, hcg_key hcg_k) ; void add_row (char *viewname) ; void delete_row () ; void dump_table (char *viewname, char *file_name, int new_version, char *modestr) ; void dump_row (char *viewname, char *file_name, int new_version, char *modestr) ; void add_row_log(char *); void log_do_add_row (char *, char *, int); void log_do_set_int_row (const char *, const int ); void log_do_set_flt_row (const char *, const int ); void log_do_set_key_row (const char *, hcg_key ); void log_do_set_str_row (const char *, const char * ); } ; #else class TS : public RC { private : hcg_key VVid; /* fkey to ViewVersion for this TSrow */ hcg_key TTid; /* fkey to TTrow for this TSrow */ int verno; /* version number of TT in VV */ int maxrow; /* max row# in this table and VV */ int vvrowcnt; /* row-count of this TT in parent VV only*/ TT *TTid_pp; /* Parent */ VV *VVid_pp; /* Parent */ public : void set_VVid (hcg_key id); void set_TTid (hcg_key id); void set_verno (int value); void set_maxrow (int value); void set_vvrowcnt (int value); hcg_key get_VVid (); hcg_key get_TTid (); int get_verno (); int get_maxrow (); int get_vvrowcnt (); void setParent_TTid(TT *currentRow); /* Initializes parent */ TT *getParent_TTid(); /* Returns parent */ void setParent_VVid(VV *currentRow); /* Initializes parent */ VV *getParent_VVid(); /* Returns parent */ void link_row () ; void parse_row (char *buffer, int idx, hcg_key hcg_k); void add_row (char *viewname); list::iterator delete_row (list::iterator rowIter); /* Deletes the row */ /* Prints a row to a file */ void dump_row (char *viewname, char *file_name, int new_version, char *modestr); /* Prints a row to terminal */ void dump_row (char *viewname, int new_version, char *modestr); TS(); /* Constructor */ ~TS(); /* Destructor */ void add_row_log(char *); void log_do_add_row (char *, char *, int); void log_do_set_int_row (const char *, const int ); void log_do_set_flt_row (const char *, const int ); void log_do_set_key_row (const char *, hcg_key ); void log_do_set_str_row (const char *, const char * ); } ; class TStable /* ts_type - statistics about this Table in View */ { private : char abbrev[5]; /* 2-char abbreviation */ char *name; /* Table name */ list row; /* List of rows */ public : char *getAbbrev(); /* Returns table abbreviation */ char *getName(); /* Returns table name */ unsigned int getRowCount(); /* Returns number of rows in table */ list::iterator getFirstRow(); /* Returns iterator to first row */ TS *getPrevRow(TS *curr); /* Returns prev iterator */ TS *getNextRow(TS *curr); /* Returns next iterator */ TS *getLastRow(); /* Returns last iterator */ list::iterator Terminator(); /* Returns list terminator */ bool isFirstRow(TS * curr); /* True if curr is iterator to first row */ bool isLastRow(TS * curr); /* True if curr is iterator to last row */ void insertRow(TS *newRow); /* Inserts a row at end of table */ list::iterator removeRow(list::iterator i); /* Removes row from table */ /* Prints out entire table to file */ void dump_table(char *viewname, char *file_name, int new_version, char *modestr); /* Prints out entire table to terminal */ /* void dump_table(char *viewname, int new_version, char *modestr); */ TStable(char *abbrev, char *name); /* Constructor */ ~TStable(); /* Destructor */ }; #endif /* USE_STL */ #endif /* __TSSCHEMA_H__ */