/******************************************************************************/ /* File : HNschema.h */ /* Schema : bdeschema.sch */ /* GENCPP Version : Chgen V 12 - Sathya */ /******************************************************************************/ #ifndef __HNSCHEMA_H__ #define __HNSCHEMA_H__ #include "bdeschema.h" #ifdef USE_STL #include #endif /* USE_STL */ class HG ; class HA ; class HL ; class HL ; #ifndef USE_STL class HN : public RC /* HN - node label and geometry (H is for Horizontal Flow in a DFD */ { private : hcg_key HGid; /* unique fkey of container of this node */ char HGid2[9]; /* reserved for HGid2 fkey to node expansion */ char shape[2]; /* C=circle, R=rectangle, O=rnded rect, etc. */ float centerx; /* x of node center (WC = world coords)*/ float centery; /* y of node center (WC) */ float width; /* width(radius) of rectangle or circle */ float height; /* height(radius) of rectangle or circle */ char txtfont[26]; /* Menu-style text font name and size */ float txtoffsetx; /* text origin in WC relative to HN center */ float txtoffsety; /* text origin in WC relative to HN center */ int txtwidth; /* text x-extent in WC */ int txtheight; /* text y-extent in WC */ char nodename[61]; /* one-line node label string */ public : HG *HGid_pp; void *HGid_fpp; void *HGid_bpp; HA *HAid_fcp; HA *HAid_bcp; HL *HLid1_fcp; HL *HLid1_bcp; HL *HLid2_fcp; HL *HLid2_bcp; HN *prev_ptr; HN *next_ptr; void set_HGid (hcg_key id); void set_HGid2 (char *value); void set_shape (char *value); void set_centerx (float value); void set_centery (float value); void set_width (float value); void set_height (float value); void set_txtfont (char *value); void set_txtoffsetx (float value); void set_txtoffsety (float value); void set_txtwidth (int value); void set_txtheight (int value); void set_nodename (char *value); hcg_key get_HGid (); char* get_HGid2 (); char* get_shape (); float get_centerx (); float get_centery (); float get_width (); float get_height (); char* get_txtfont (); float get_txtoffsetx (); float get_txtoffsety (); int get_txtwidth (); int get_txtheight (); char* get_nodename (); HN* 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 HN : public RC { private : hcg_key HGid; /* unique fkey of container of this node */ char HGid2[9]; /* reserved for HGid2 fkey to node expansion */ char shape[2]; /* C=circle, R=rectangle, O=rnded rect, etc. */ float centerx; /* x of node center (WC = world coords)*/ float centery; /* y of node center (WC) */ float width; /* width(radius) of rectangle or circle */ float height; /* height(radius) of rectangle or circle */ char txtfont[26]; /* Menu-style text font name and size */ float txtoffsetx; /* text origin in WC relative to HN center */ float txtoffsety; /* text origin in WC relative to HN center */ int txtwidth; /* text x-extent in WC */ int txtheight; /* text y-extent in WC */ char nodename[61]; /* one-line node label string */ HG *HGid_pp; /* Parent */ list HAid_children; /* Child list */ list HLid1_children; /* Child list */ list HLid2_children; /* Child list */ public : void set_HGid (hcg_key id); void set_HGid2 (char *value); void set_shape (char *value); void set_centerx (float value); void set_centery (float value); void set_width (float value); void set_height (float value); void set_txtfont (char *value); void set_txtoffsetx (float value); void set_txtoffsety (float value); void set_txtwidth (int value); void set_txtheight (int value); void set_nodename (char *value); hcg_key get_HGid (); char* get_HGid2 (); char* get_shape (); float get_centerx (); float get_centery (); float get_width (); float get_height (); char* get_txtfont (); float get_txtoffsetx (); float get_txtoffsety (); int get_txtwidth (); int get_txtheight (); char* get_nodename (); void insertChild_HAid(HA *childRow); /* Adds a child to list */ void removeChild_HAid(list::iterator rowIter); /* Remove child */ list::iterator getFirstChild_HAid(); /* Returns 1st child */ list::iterator getLastChild_HAid(); /* Returns last child */ list::iterator HAid_Terminator(); /* Returns terminator */ void insertChild_HLid1(HL *childRow); /* Adds a child to list */ void removeChild_HLid1(list::iterator rowIter); /* Remove child */ list::iterator getFirstChild_HLid1(); /* Returns 1st child */ list::iterator getLastChild_HLid1(); /* Returns last child */ list::iterator HLid1_Terminator(); /* Returns terminator */ void insertChild_HLid2(HL *childRow); /* Adds a child to list */ void removeChild_HLid2(list::iterator rowIter); /* Remove child */ list::iterator getFirstChild_HLid2(); /* Returns 1st child */ list::iterator getLastChild_HLid2(); /* Returns last child */ list::iterator HLid2_Terminator(); /* Returns terminator */ void setParent_HGid(HG *currentRow); /* Initializes parent */ HG *getParent_HGid(); /* 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); HN(); /* Constructor */ ~HN(); /* 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 HNtable /* HN - node label and geometry (H is for Horizontal Flow in a DFD */ { 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 */ HN *getPrevRow(HN *curr); /* Returns prev iterator */ HN *getNextRow(HN *curr); /* Returns next iterator */ HN *getLastRow(); /* Returns last iterator */ list::iterator Terminator(); /* Returns list terminator */ bool isFirstRow(HN * curr); /* True if curr is iterator to first row */ bool isLastRow(HN * curr); /* True if curr is iterator to last row */ void insertRow(HN *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); */ HNtable(char *abbrev, char *name); /* Constructor */ ~HNtable(); /* Destructor */ }; #endif /* USE_STL */ #endif /* __HNSCHEMA_H__ */