00001 /* 00002 * SystemPrinter.h 00003 * 00004 * Created on: Apr 29, 2010 00005 * Author: green 00006 */ 00007 00008 #ifndef SYSTEMPRINTER_H_ 00009 #define SYSTEMPRINTER_H_ 00010 00011 #include "SystemManager.h" 00012 00026 struct RelationAttributeInfo { 00027 char relName[MAX_RELATION_NAME]; 00028 AttributeInfo attrInfo; 00029 }; 00030 00038 class SystemPrinter { 00039 public: 00054 SystemPrinter(const RelationAttributeInfo* attributes, int count); 00055 00070 SystemPrinter(const char* relName, const AttributeInfo* attributes, int count); 00071 00075 ~SystemPrinter(); 00076 00084 void printHeader(); 00085 00096 void printRecord(const char* data); 00097 00105 void printFooter(); 00106 00107 private: 00108 char relName_[MAX_RELATION_NAME]; 00109 RelationAttributeInfo* attributes_; 00110 int nAttributes_; 00111 int nTuples_; 00112 }; 00113 00114 #endif /* SYSTEMPRINTER_H_ */