From: <mk...@us...> - 2003-10-24 18:23:16
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv4783/Include/SimData Modified Files: TypeAdapter.h Log Message: Index: TypeAdapter.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/TypeAdapter.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** TypeAdapter.h 19 Oct 2003 23:53:56 -0000 1.23 --- TypeAdapter.h 24 Oct 2003 15:45:43 -0000 1.24 *************** *** 38,42 **** #include <SimData/Path.h> ! #include <SimData/Types.h> #include <SimData/PTS.h> --- 38,43 ---- #include <SimData/Path.h> ! //#include <SimData/Types.h> ! #include <SimData/Link.h> #include <SimData/PTS.h> *************** *** 76,91 **** ! /** ! * @brief Dynamically typed wrapper for basic types and objects. * ! * For internal use only. This class is used to pass typed data as ! * parameters to virtual member functions (which are not compatible ! * with templates). It works for a number of basic types, and for ! * objects derived from the Object base class. * ! * @author Mark Rose <mr...@st...> ! * @internal */ - class SIMDATA_EXPORT TypeAdapter { --- 77,90 ---- ! /** Dynamically typed wrapper for basic types and objects. * ! * For internal use only. This class is used to pass typed data as ! * parameters to virtual member functions (which are not compatible ! * with templates). It works for a number of basic types, and for ! * objects derived from the Object base class. * ! * @author Mark Rose <mr...@st...> ! * @internal */ class SIMDATA_EXPORT TypeAdapter { *************** *** 170,199 **** */ ! inline void set(SimDate & x) const { setBase(x); } ! inline void set(GeoPos & x) const { setBase(x); } ! inline void set(LLA & x) const { setCoordinate(x); } ! inline void set(UTM & x) const { setCoordinate(x); } ! inline void set(ECEF & x) const { setCoordinate(x); } ! inline void set(Vector3 & x) const { setBase(x); } ! inline void set(Matrix3 & x) const { setBase(x); } ! inline void set(Real & x) const { setBase(x); } ! inline void set(Curve & x) const { setBase(x); } ! inline void set(Table & x) const { setBase(x); } #ifndef __PTS_SIM__ ! inline void set(Table1 & x) const { setBase(x); } ! inline void set(Table2 & x) const { setBase(x); } ! inline void set(Table3 & x) const { setBase(x); } #endif // __PTS_SIM__ ! inline void set(External & x) const { setBase(x); } ! inline void set(Key & x) const { setBase(x); } ! inline void set(Path & x) const { setBase(x); } ! // list void set(short &x) const { IntCheck(); x = static_cast<short>(var.i); } void set(char &x) const { IntCheck(); x = static_cast<char>(var.i); } - void set(int &x) const { IntCheck(); x = static_cast<int>(var.i); } void set(bool &x) const { IntCheck(); x = (var.i != 0); } --- 169,199 ---- */ ! void set(SimDate & x) const; ! void set(GeoPos & x) const; ! void set(LLA & x) const; ! void set(UTM & x) const; ! void set(ECEF & x) const; ! void set(Vector3 & x) const; ! void set(Matrix3 & x) const; ! void set(Real & x) const; ! void set(Curve & x) const; ! void set(Table & x) const; #ifndef __PTS_SIM__ ! void set(Table1 & x) const; ! void set(Table2 & x) const; ! void set(Table3 & x) const; #endif // __PTS_SIM__ ! void set(External & x) const; ! void set(Key & x) const; ! void set(Path & x) const; ! ! void set(EnumLink &x) const; ! void set(LinkBase &x) const; void set(short &x) const { IntCheck(); x = static_cast<short>(var.i); } void set(char &x) const { IntCheck(); x = static_cast<char>(var.i); } void set(int &x) const { IntCheck(); x = static_cast<int>(var.i); } void set(bool &x) const { IntCheck(); x = (var.i != 0); } *************** *** 202,220 **** void set(unsigned int &x) const { IntCheck(); x = static_cast<unsigned int>(var.i); } void set(std::string &x) const { StringCheck(); x = s; } ! void set(EnumLink &x) const { if (isType(STRING)) x = s; else setBase(x); } ! // slightly fancier handling required for path pointers ! void set(LinkBase &x) const { ! BaseCheck(); ! // are we assigning to a pointerbase? ! LinkBase const *p = dynamic_cast<LinkBase const *>(var.o); ! if (p != 0) { ! x = *(const_cast<LinkBase *>(p)); ! } else { ! // last chance, is it a path? ! Path const *path = dynamic_cast<Path const *>(var.o); ! TypeCheck(path!=NULL, "dynamic cast of BaseType* to LinkBase failed"); ! x = LinkBase(*(const_cast<Path *>(path)), 0); ! } ! } template <typename Q> void set(Link<Q> &x) const { --- 202,206 ---- void set(unsigned int &x) const { IntCheck(); x = static_cast<unsigned int>(var.i); } void set(std::string &x) const { StringCheck(); x = s; } ! template <typename Q> void set(Link<Q> &x) const { |