/******************************************************************************/ /* File : TAschema.h */ /* Schema : bdeschema.sch */ /* GENCPP Version : Chgen V 12 - Sathya */ /******************************************************************************/ #ifndef __TASCHEMA_H__ #define __TASCHEMA_H__ #include "bdeschema.h" #ifdef USE_STL #include #endif /* USE_STL */ class TT ; #ifndef USE_STL class TA : public RC /* ta_type - scalar or ref attribute of parent table */ { private : hcg_key TTid; /* TTid is foreign key */ char fname[31]; /* field name (column header) */ char dfltVal[31]; /* default value (was altName) */ char ftype[11]; /* field type (I4/F4/c##,t###/k8/k12) */ char iskey[5]; /* 0:nonkey; 1/-1:pfkey; s:superClassRef */ char comment[133]; /* descriptive comment (units/range?) */ public : TT *TTid_pp; void *TTid_fpp; void *TTid_bpp; TA *prev_ptr; TA *next_ptr; void set_TTid (hcg_key id); void set_fname (char *value); void set_dfltVal (char *value); void set_ftype (char *value); void set_iskey (char *value); void set_comment (char *value); hcg_key get_TTid (); char* get_fname (); char* get_dfltVal (); char* get_ftype (); char* get_iskey (); char* get_comment (); TA* 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 TA : public RC { private : hcg_key TTid; /* TTid is foreign key */ char fname[31]; /* field name (column header) */ char dfltVal[31]; /* default value (was altName) */ char ftype[11]; /* field type (I4/F4/c##,t###/k8/k12) */ char iskey[5]; /* 0:nonkey; 1/-1:pfkey; s:superClassRef */ char comment[133]; /* descriptive comment (units/range?) */ TT *TTid_pp; /* Parent */ public : void set_TTid (hcg_key id); void set_fname (char *value); void set_dfltVal (char *value); void set_ftype (char *value); void set_iskey (char *value); void set_comment (char *value); hcg_key get_TTid (); char* get_fname (); char* get_dfltVal (); char* get_ftype (); char* get_iskey (); char* get_comment (); void setParent_TTid(TT *currentRow); /* Initializes parent */ TT *getParent_TTid(); /* 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); TA(); /* Constructor */ ~TA(); /* 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 TAtable /* ta_type - scalar or ref attribute of parent table */ { 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 */ TA *getPrevRow(TA *curr); /* Returns prev iterator */ TA *getNextRow(TA *curr); /* Returns next iterator */ TA *getLastRow(); /* Returns last iterator */ list::iterator Terminator(); /* Returns list terminator */ bool isFirstRow(TA * curr); /* True if curr is iterator to first row */ bool isLastRow(TA * curr); /* True if curr is iterator to last row */ void insertRow(TA *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); */ TAtable(char *abbrev, char *name); /* Constructor */ ~TAtable(); /* Destructor */ }; #endif /* USE_STL */ #endif /* __TASCHEMA_H__ */