00001
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "interface.h"
00024
00025
00026 namespace faudes {
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 Type::Type(void) {}
00042
00043
00044 Type::Type(const Type& rType) {(void) rType;}
00045
00046
00047 Type::~Type(void) {}
00048
00049
00050
00051 void Type::Clear(void) {
00052 FD_DC("Type::Clear(): not re-implemented in " << typeid(*this).name());
00053 }
00054
00055
00056 void Type::Write(const Type* pContext) const {
00057 TokenWriter tw(TokenWriter::Stdout);
00058 DoWrite(tw,"",pContext);
00059 }
00060
00061
00062 void Type::Write(const std::string& rFileName, const std::string& rLabel,
00063 const Type* pContext, std::ios::openmode openmode) const {
00064 try {
00065 TokenWriter tw(rFileName, openmode);
00066 DoWrite(tw, rLabel, pContext);
00067 }
00068 catch (std::ios::failure&) {
00069 std::stringstream errstr;
00070 errstr << "Exception opening/writing file \"" << rFileName << "\"";
00071 throw Exception("Type::Write", errstr.str(), 2);
00072 }
00073 }
00074
00075
00076 void Type::Write(const std::string& rFileName, std::ios::openmode openmode) const {
00077 Write(rFileName,"",0,openmode);
00078 }
00079
00080
00081 void Type::Write(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
00082 DoWrite(rTw,rLabel,pContext);
00083 }
00084
00085
00086 std::string Type::ToString(const std::string& rLabel, const Type* pContext) const {
00087 TokenWriter tw(TokenWriter::String);
00088 DoWrite(tw,rLabel,pContext);
00089 return tw.Str();
00090 }
00091
00092
00093 void Type::DWrite(const Type* pContext) const {
00094 TokenWriter tw(TokenWriter::Stdout);
00095 DoDWrite(tw,"",pContext);
00096 }
00097
00098
00099 void Type::DWrite(const std::string& rFileName, const std::string& rLabel,
00100 const Type* pContext, std::ios::openmode openmode) const {
00101 try {
00102 TokenWriter tw(rFileName, openmode);
00103 DoDWrite(tw, rLabel, pContext);
00104 }
00105 catch (std::ios::failure&) {
00106 std::stringstream errstr;
00107 errstr << "Exception opening/writing file \"" << rFileName << "\"";
00108 throw Exception("Type::DWrite", errstr.str(), 2);
00109 }
00110 }
00111
00112
00113 void Type::DWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
00114 DoDWrite(rTw,rLabel,pContext);
00115 }
00116
00117
00118 void Type::Read(const std::string& rFilename, const std::string& rLabel, const Type* pContext) {
00119 Clear();
00120 TokenReader tr(rFilename);
00121 DoRead(tr,rLabel,pContext);
00122 }
00123
00124
00125 void Type::Read(TokenReader& rTr, const std::string& rLabel, const Type* pContext) {
00126 Clear();
00127 DoRead(rTr,rLabel,pContext);
00128 }
00129
00130
00131 void Type::DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
00132 (void) rTw; (void) rLabel; (void) pContext;
00133 FD_DC("Type::DoWrite(): not re-implemented in " << typeid(*this).name());
00134 }
00135
00136
00137 void Type::DoDWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
00138 FD_DC("Type::DoDWrite(): not re-implemented in " << typeid(*this).name() << ", using DoDWrite instead");
00139 DoWrite(rTw,rLabel,pContext);
00140 }
00141
00142
00143 void Type::DoRead(TokenReader& rTr, const std::string& rLabel, const Type* pContext) {
00144 (void) rLabel; (void) pContext; (void) rTr;
00145 FD_DC("Type::DoRead(): not re-implemented in " << typeid(*this).name());
00146 }
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161 Operation::Operation(void) {}
00162 Operation::~Operation(void) {}
00163
00164
00165 }