From: <sv...@ww...> - 2005-01-19 12:41:41
|
Author: delta Date: 2005-01-19 04:41:32 -0800 (Wed, 19 Jan 2005) New Revision: 1450 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/InterfaceRegistry.h trunk/CSP/SimData/Include/SimData/Link.h trunk/CSP/SimData/Include/SimData/ObjectInterface.h trunk/CSP/SimData/Include/SimData/TypeAdapter.h trunk/CSP/SimData/Source/InterfaceRegistry.cpp Log: Got ride of a few throw(Type) for 2 main reasons. It will ease the maintenance and it avoids a few warnings on vs2005. In fact, vs2003 already treats throw(Type) like throw(...). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1450 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2005-01-17 23:39:12 UTC (rev 1449) +++ trunk/CSP/SimData/CHANGES.current 2005-01-19 12:41:32 UTC (rev 1450) @@ -1,6 +1,11 @@ Version 0.4.0 (in progress) =========================== +2005-01-19: delta + * Got ride of a few throw(Type) for 2 main reasons. It will ease the + maintenance and it avoids a few warnings on vs2005. In fact, vs2003 + already treats throw(Type) like throw(...). + 2005-01-03: onsight * Fix logging priority/category calls in Compile.py. Modified: trunk/CSP/SimData/Include/SimData/InterfaceRegistry.h =================================================================== --- trunk/CSP/SimData/Include/SimData/InterfaceRegistry.h 2005-01-17 23:39:12 UTC (rev 1449) +++ trunk/CSP/SimData/Include/SimData/InterfaceRegistry.h 2005-01-19 12:41:32 UTC (rev 1450) @@ -402,7 +402,7 @@ * Interfaces are registered automatically by the * SIMDATA_*_INTERFACE macros. */ - void addInterface(const char *name, hasht id, InterfaceProxy *proxy) throw(InterfaceError); + void addInterface(const char *name, hasht id, InterfaceProxy *proxy); //friend class Singleton<InterfaceRegistry>; InterfaceRegistry(); Modified: trunk/CSP/SimData/Include/SimData/Link.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Link.h 2005-01-17 23:39:12 UTC (rev 1449) +++ trunk/CSP/SimData/Include/SimData/Link.h 2005-01-19 12:41:32 UTC (rev 1450) @@ -405,7 +405,7 @@ * Changes the object pointer without reference counting, checking * that the new object type matches the template type. */ - virtual void _update(Object* ptr) throw(ObjectTypeMismatch) { + virtual void _update(Object* ptr) { LinkBase::_update(ptr); T* _special = dynamic_cast<T*>(ptr); if (ptr != 0 && _special == 0) Modified: trunk/CSP/SimData/Include/SimData/ObjectInterface.h =================================================================== --- trunk/CSP/SimData/Include/SimData/ObjectInterface.h 2005-01-17 23:39:12 UTC (rev 1449) +++ trunk/CSP/SimData/Include/SimData/ObjectInterface.h 2005-01-19 12:41:32 UTC (rev 1450) @@ -114,16 +114,16 @@ typedef typename HASH_MAPS<std::string, MemberAccessorBase *, hashstring, eqstring>::Type map; - virtual void set(OBJECT *, TypeAdapter const &) throw(TypeMismatch) { + virtual void set(OBJECT *, TypeAdapter const &) { throw TypeMismatch("Cannot set vector<> '" + name + "' directly, use push_back() instead."); } - virtual void push_back(OBJECT *, TypeAdapter const &) throw(TypeMismatch) { + virtual void push_back(OBJECT *, TypeAdapter const &) { throw TypeMismatch("Cannot call push_back() on non-vector<> variable '" + name + "'."); } - virtual void clear(OBJECT *) throw(TypeMismatch) { + virtual void clear(OBJECT *) { throw TypeMismatch("Cannot call clear() on non-vector<> variable '" + name + "'."); } - virtual TypeAdapter const get(OBJECT *) const throw(TypeMismatch) { + virtual TypeAdapter const get(OBJECT *) const { throw TypeMismatch("get() '" + name + "': not supported for variables of type vector<>."); } bool isRequired() const { return required; }; @@ -195,10 +195,10 @@ setType(prototype); } } - virtual TypeAdapter const get(OBJECT *object) const throw(TypeMismatch) { + virtual TypeAdapter const get(OBJECT *object) const { return TypeAdapter(object->*member); } - virtual void set(OBJECT *object, TypeAdapter const &v) throw(TypeMismatch) { + virtual void set(OBJECT *object, TypeAdapter const &v) { try { if (mask != 0) { T value; @@ -248,10 +248,10 @@ setType(prototype); } } - virtual TypeAdapter const get(OBJECT *object) const throw(TypeMismatch) { + virtual TypeAdapter const get(OBJECT *object) const { return TypeAdapter(object->*member); } - virtual void set(OBJECT *object, TypeAdapter const &v) throw(TypeMismatch) { + virtual void set(OBJECT *object, TypeAdapter const &v) { try { v.set(object->*member); } catch (Exception &e) { @@ -333,7 +333,7 @@ type = "vector::" + type; } } - virtual void push_back(OBJECT *object, TypeAdapter const &v) throw(TypeMismatch) { + virtual void push_back(OBJECT *object, TypeAdapter const &v) { T value; try { v.set(value); @@ -343,7 +343,7 @@ } (object->*member).push_back(value); } - virtual void clear(OBJECT *object) throw(TypeMismatch) { + virtual void clear(OBJECT *object) { (object->*member).clear(); } virtual void serialize(OBJECT const *object, Writer &writer) const { @@ -523,7 +523,7 @@ typedef ObjectInterface<C> Self; - void __not_found(std::string const &name) const throw (InterfaceError) { + void __not_found(std::string const &name) const { throw InterfaceError("Variable '"+name+"' not found in interface to class '" + C::_getClassName()+"'"); } @@ -544,7 +544,7 @@ * macro instead. */ template<typename T> - Self& def(std::string const &name, T C::*pm, bool required) throw(InterfaceError) { + Self& def(std::string const &name, T C::*pm, bool required) { if (variableExists(name)) throw InterfaceError("interface variable \"" + std::string(name) + "\" multiply defined in class '" + C::_getClassName() + "'."); #ifdef __SIMDATA_PTS_SIM table[name] = new typename PTS::SELECT_ACCESSOR<C, T>::ACCESSOR(pm, name, required); @@ -554,7 +554,7 @@ return *this; } template<typename T> - Self& def(std::string const &name, T C::*pm, int mask, bool required) throw(InterfaceError) { + Self& def(std::string const &name, T C::*pm, int mask, bool required) { if (variableExists(name)) throw InterfaceError("interface variable \"" + std::string(name) + "\" multiply defined in class '" + C::_getClassName() + "'."); #ifdef __SIMDATA_PTS_SIM table[name] = new typename PTS::SELECT_ACCESSOR<C, T>::ACCESSOR(pm, name, required); Modified: trunk/CSP/SimData/Include/SimData/TypeAdapter.h =================================================================== --- trunk/CSP/SimData/Include/SimData/TypeAdapter.h 2005-01-17 23:39:12 UTC (rev 1449) +++ trunk/CSP/SimData/Include/SimData/TypeAdapter.h 2005-01-19 12:41:32 UTC (rev 1450) @@ -244,7 +244,7 @@ BaseType const *o; } var; - void TypeCheck(bool test, std::string msg) const throw(TypeMismatch) { + void TypeCheck(bool test, std::string msg) const { if (!(test)) { msg = __repr__() + ": " + msg; throw TypeMismatch(msg); Modified: trunk/CSP/SimData/Source/InterfaceRegistry.cpp =================================================================== --- trunk/CSP/SimData/Source/InterfaceRegistry.cpp 2005-01-17 23:39:12 UTC (rev 1449) +++ trunk/CSP/SimData/Source/InterfaceRegistry.cpp 2005-01-19 12:41:32 UTC (rev 1450) @@ -166,7 +166,7 @@ return __list; } -void InterfaceRegistry::addInterface(const char *name, hasht id, InterfaceProxy *proxy) throw(InterfaceError) { +void InterfaceRegistry::addInterface(const char *name, hasht id, InterfaceProxy *proxy) { if (hasInterface(name)) { throw InterfaceError("interface \"" + std::string(name) + "\" multiply defined"); } |