From: <mk...@us...> - 2003-08-16 07:56:43
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv22313/Source Modified Files: BaseType.cpp GeoPos.cpp InterfaceRegistry.cpp Version.cpp Log Message: Index: BaseType.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/BaseType.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BaseType.cpp 14 Aug 2003 12:19:12 -0000 1.5 --- BaseType.cpp 16 Aug 2003 07:56:40 -0000 1.6 *************** *** 22,28 **** --- 22,60 ---- #include <SimData/BaseType.h> + #include <SimData/Version.h> NAMESPACE_SIMDATA + + + #ifndef SIMDATA_NOLOADCHECK + + /** Print a startup message to verify proper loading of SimData. + * + * Only one copy of SimData should be active so that all object + * interface proxies will be stored in a single object registry. + * Unless you explicitly want distinct object registries, multiple + * "SimData XX loaded @ XX" messages are an indication of improper + * linking. + * + * This message may be disabled by defining SIMDATA_NOLOADCHECK + * when building SimData. + * + * This instance is created in BaseType, as opposed to some other + * object file, since BaseType must be loaded for all but the most + * basic SimData functionality. + */ + class load_check { + public: + load_check() { + std::cout << "SimData " << getVersion(); + std::cout.setf(std::ios_base::hex | std::ios_base::basefield | std::ios_base::showbase); + std::cout << " loaded @ " << this; + std::cout.unsetf(std::ios_base::hex | std::ios_base::basefield | std::ios_base::showbase); + std::cout << std::endl; + } + } check_basetype; + + #endif // SIMDATA_NOLOADCHECK Index: GeoPos.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/GeoPos.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GeoPos.cpp 6 Aug 2003 06:36:25 -0000 1.4 --- GeoPos.cpp 16 Aug 2003 07:56:40 -0000 1.5 *************** *** 33,36 **** --- 33,38 ---- #include <cmath> + #include <sstream> + #include <iomanip> *************** *** 899,905 **** std::string UTM::asString() const { ! char buff[128]; ! sprintf(buff, "[%.0lfE %.0lfN %d%c, %.3lf]", _E, _N, int(_zone), _designator, _alt); ! return buff; } --- 901,912 ---- std::string UTM::asString() const { ! std::stringstream ss; ! ss << std::fixed; ! ss << "["; ! ss << ss.precision(0) << _E << " " << _N; ! ss << " " << int(_zone) << _designator << ", "; ! ss << std::setprecision(3) << _alt; ! ss << "]"; ! return ss.str(); } Index: InterfaceRegistry.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/InterfaceRegistry.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** InterfaceRegistry.cpp 14 Aug 2003 12:19:12 -0000 1.9 --- InterfaceRegistry.cpp 16 Aug 2003 07:56:40 -0000 1.10 *************** *** 35,38 **** --- 35,39 ---- #include <SimData/Enum.h> #include <SimData/Path.h> + #include <SimData/Version.h> #include <string> *************** *** 45,76 **** /////////////////////////////////////////////////////////////////////////// // InterfaceProxy - - /** - * The master interface registry. - */ - - /* - #ifdef _WIN32 - #pragma comment(linker, "/SECTION:.shared,RWS") - #pragma data_seg(".shared") - #endif - - InterfaceRegistry g_InterfaceRegistry; - */ - - //InterfaceRegistry::proxy_map *InterfaceRegistry::__map = 0; - //InterfaceRegistry::proxy_id_map *InterfaceRegistry::__id_map = 0; - //InterfaceRegistry::interface_list *InterfaceRegistry::__list = 0; - - /* - #ifdef _WIN32 - #pragma data_seg() - #endif - */ - InterfaceProxy::InterfaceProxy(const char *cname, hasht (*chash)()) { --- 46,54 ---- + /////////////////////////////////////////////////////////////////////////// // InterfaceProxy InterfaceProxy::InterfaceProxy(const char *cname, hasht (*chash)()) { *************** *** 90,94 **** } - //MemberAccessorBase * InterfaceProxy::getAccessor(const char *name, const char *cname = 0) const throw(InterfaceError) { MemberAccessorBase * InterfaceProxy::getAccessor(const char *name, const char *cname) const { if (!cname) cname = "?"; --- 68,71 ---- *************** *** 171,174 **** --- 148,152 ---- /////////////////////////////////////////////////////////////////////////// // InterfaceRegistry + InterfaceRegistry::InterfaceRegistry() { Index: Version.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Version.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Version.cpp 15 Aug 2003 06:59:16 -0000 1.6 --- Version.cpp 16 Aug 2003 07:56:40 -0000 1.7 *************** *** 22,25 **** --- 22,27 ---- #include <SimData/Version.h> #include <cstdio> + #include <iostream> + #include <iomanip> #ifndef SIMDATA_VERSION *************** *** 29,46 **** NAMESPACE_SIMDATA const char *getVersion() { return SIMDATA_VERSION; } - - - /** - * @brief Print a startup message to verify proper loading of SimData - */ - class load_check { - public: - load_check() { - printf("SimData %s loaded @ %p\n", getVersion(), this); - } - } check_interpolate; --- 31,39 ---- NAMESPACE_SIMDATA + /** Get the SimData version number. + */ const char *getVersion() { return SIMDATA_VERSION; } |