From 418ffcadb0a5334ebe621369c14d6c3dd651acce Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Wed, 24 Jan 2024 11:00:22 +0100 Subject: Fixed compilation issues and use of deprecated C++ features * Fixed compiler errors due to dynamic exception specifications * Replace std::auto_ptr with std::unique_ptr * Replace std::mem_fun with std::mem_fn * Prefix for_each with std:: (apparently not needed before) * Just use lambda instead of std::bind2nd * Removed usages of std::unary_function --- src/event.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/event.cpp') diff --git a/src/event.cpp b/src/event.cpp index 45e65fff..73099cc3 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -37,7 +37,7 @@ Event::~Event() // Integers -void Event::setInt(const std::string &key, int value) throw (BadEvent) +void Event::setInt(const std::string &key, int value) { if (mData.find(key) != mData.end()) throw KEY_ALREADY_EXISTS; @@ -45,7 +45,7 @@ void Event::setInt(const std::string &key, int value) throw (BadEvent) mData[key] = new IntData(value); } -int Event::getInt(const std::string &key) const throw (BadEvent) +int Event::getInt(const std::string &key) const { VariableMap::const_iterator it = mData.find(key); if (it == mData.end()) @@ -66,7 +66,7 @@ bool Event::hasInt(const std::string &key) const // Strings -void Event::setString(const std::string &key, const std::string &value) throw (BadEvent) +void Event::setString(const std::string &key, const std::string &value) { if (mData.find(key) != mData.end()) throw KEY_ALREADY_EXISTS; @@ -74,7 +74,7 @@ void Event::setString(const std::string &key, const std::string &value) throw (B mData[key] = new StringData(value); } -const std::string &Event::getString(const std::string &key) const throw (BadEvent) +const std::string &Event::getString(const std::string &key) const { VariableMap::const_iterator it = mData.find(key); if (it == mData.end()) @@ -96,7 +96,7 @@ bool Event::hasString(const std::string &key) const // Floats -void Event::setFloat(const std::string &key, double value) throw (BadEvent) +void Event::setFloat(const std::string &key, double value) { if (mData.find(key) != mData.end()) throw KEY_ALREADY_EXISTS; @@ -104,7 +104,7 @@ void Event::setFloat(const std::string &key, double value) throw (BadEvent) mData[key] = new FloatData(value); } -double Event::getFloat(const std::string &key) const throw (BadEvent) +double Event::getFloat(const std::string &key) const { VariableMap::const_iterator it = mData.find(key); if (it == mData.end()) @@ -125,7 +125,7 @@ bool Event::hasFloat(const std::string &key) const // Booleans -void Event::setBool(const std::string &key, bool value) throw (BadEvent) +void Event::setBool(const std::string &key, bool value) { if (mData.find(key) != mData.end()) throw KEY_ALREADY_EXISTS; @@ -133,7 +133,7 @@ void Event::setBool(const std::string &key, bool value) throw (BadEvent) mData[key] = new BoolData(value); } -bool Event::getBool(const std::string &key) const throw (BadEvent) +bool Event::getBool(const std::string &key) const { VariableMap::const_iterator it = mData.find(key); if (it == mData.end()) @@ -154,7 +154,7 @@ bool Event::hasBool(const std::string &key) const // Items -void Event::setItem(const std::string &key, Item *value) throw (BadEvent) +void Event::setItem(const std::string &key, Item *value) { if (mData.find(key) != mData.end()) throw KEY_ALREADY_EXISTS; @@ -162,7 +162,7 @@ void Event::setItem(const std::string &key, Item *value) throw (BadEvent) mData[key] = new ItemData(value); } -Item *Event::getItem(const std::string &key) const throw (BadEvent) +Item *Event::getItem(const std::string &key) const { VariableMap::const_iterator it = mData.find(key); if (it == mData.end()) @@ -183,7 +183,7 @@ bool Event::hasItem(const std::string &key) const // Actors -void Event::setActor(const std::string &key, ActorSprite *value) throw (BadEvent) +void Event::setActor(const std::string &key, ActorSprite *value) { if (mData.find(key) != mData.end()) throw KEY_ALREADY_EXISTS; @@ -191,7 +191,7 @@ void Event::setActor(const std::string &key, ActorSprite *value) throw (BadEvent mData[key] = new ActorData(value); } -ActorSprite *Event::getActor(const std::string &key) const throw (BadEvent) +ActorSprite *Event::getActor(const std::string &key) const { VariableMap::const_iterator it = mData.find(key); if (it == mData.end()) -- cgit v1.2.3-70-g09d2