00001 #ifndef DBCRST_H 00002 #define DBCRST_H 00003 00004 #include <stdio.h> 00005 #include "iotools.h" 00006 #include "aliast.h" 00007 00008 class csect 00009 /** 00010 Cross-section class 00011 00012 Created by Tomas Koudelka, koudelka@cml.fsv.cvut.cz 00013 */ 00014 { 00015 public : 00016 crsectypet type; 00017 long ninst; ///< number of indeces 00018 char **inst; ///< array of strings with cross-section properties (cross-section indeces) 00019 long *instu; ///< array indicators of indeces which are used 00020 long *ridx; ///< array with renumbered used indeces 00021 long ninstu; ///< counter used indeces this cross-section type 00022 00023 csect(void); 00024 ~csect(void); 00025 00026 /// alllocates memory for storage of cross section parameters as strings 00027 void alloc(long ni); 00028 00029 /// alllocates memory for storage of cross section parameters in transcrsec 00030 void alloctc(long ni); 00031 00032 /// reading cross-section 00033 long read(XFILE *in); 00034 }; 00035 00036 class transcrsec; 00037 struct descript; 00038 00039 class dbcrst 00040 /** 00041 Cross-section database class 00042 00043 Created by Tomas Koudelka, koudelka@cml.fsv.cvut.cz 00044 */ 00045 { 00046 public : 00047 long numt; ///< number of cross-section entries 00048 csect *crs; ///< array with cross-sections 00049 long *crsu; ///< array with indicators of cross-section usage in the given problem 00050 long ncrsu; ///< number of cross-sections used in the given problem 00051 00052 dbcrst(void); 00053 ~dbcrst(void); 00054 00055 /// reads cross section parameters from the opened text file as strings 00056 long read(XFILE *in); 00057 00058 /// reads cross section parameters from the opened text file with help of transcrsec procedures 00059 long readtc(XFILE *in, transcrsec *mechc, descript *d); 00060 00061 /// searching cross-section with given type and index 00062 long search_crs(crsectypet ce, long ci); 00063 00064 /// marks ic-th corss-section type and its csti-th parameter set as used 00065 void mark_used(long ic, long csti); 00066 00067 /// renumbers database indeces according with used cross-sections 00068 void renumber_id(void); 00069 }; 00070 00071 #endif