|
From: <de...@us...> - 2003-01-20 18:23:00
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv32349
Modified Files:
Tag: simdata
TypeAdapter.cpp
Log Message:
no message
Index: TypeAdapter.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/TypeAdapter.cpp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** TypeAdapter.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2
--- TypeAdapter.cpp 20 Jan 2003 18:22:56 -0000 1.1.2.3
***************
*** 39,45 ****
*/
std::ostream &operator <<(std::ostream &o, TypeAdapter const &t) {
! if (t.isType(TypeAdapter::INT)) return o << (int const) t;
! if (t.isType(TypeAdapter::DOUBLE)) return o << (double const) t;
! if (t.isType(TypeAdapter::STRING)) return o << (std::string const) t;
if (t.isType(TypeAdapter::BASE)) return o << "TypeAdapter<Base>";
return o << "TypeAdapter<UNKNOWN>";
--- 39,45 ----
*/
std::ostream &operator <<(std::ostream &o, TypeAdapter const &t) {
! if (t.isType(TypeAdapter::INT)) return o << t.getInteger();
! if (t.isType(TypeAdapter::DOUBLE)) return o << t.getFloatingPoint();
! if (t.isType(TypeAdapter::STRING)) return o << t.getString();
if (t.isType(TypeAdapter::BASE)) return o << "TypeAdapter<Base>";
return o << "TypeAdapter<UNKNOWN>";
***************
*** 47,51 ****
void TypeAdapter::set(int &x) const { IntCheck(); x = (int) var.i; }
! void TypeAdapter::set(bool &x) const { IntCheck(); x = (bool) var.i; }
void TypeAdapter::set(float &x) const { DoubleCheck(); x = (float) var.d; }
void TypeAdapter::set(double &x) const { DoubleCheck(); x = (double) var.d; }
--- 47,51 ----
void TypeAdapter::set(int &x) const { IntCheck(); x = (int) var.i; }
! void TypeAdapter::set(bool &x) const { IntCheck(); x = (var.i != 0); }
void TypeAdapter::set(float &x) const { DoubleCheck(); x = (float) var.d; }
void TypeAdapter::set(double &x) const { DoubleCheck(); x = (double) var.d; }
|