From 0e2a9c41c5b14f3037c8df8e6deddba63fa7120e Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 11 Mar 2011 14:56:50 +0100 Subject: Removed a bunch of silly documentation A C++ developer should be able to recognize a constructor and a destructor by just looking at it, so let's stop writing down the obvious. :) --- src/account-server/account.h | 9 ++------- src/account-server/accountclient.h | 7 ------- src/account-server/accounthandler.cpp | 3 --- src/chat-server/chatclient.h | 3 --- src/chat-server/guild.h | 7 ------- src/chat-server/party.h | 1 - src/chat-server/post.h | 6 ------ src/dal/dalexcept.h | 3 --- src/dal/dataprovider.cpp | 6 ------ src/dal/dataproviderfactory.cpp | 10 ---------- src/dal/dataproviderfactory.h | 3 --- src/dal/mysqldataprovider.cpp | 16 ++-------------- src/dal/mysqldataprovider.h | 6 ------ src/dal/pqdataprovider.cpp | 13 ------------- src/dal/pqdataprovider.h | 6 ------ src/dal/recordset.cpp | 22 ---------------------- src/dal/recordset.h | 6 ------ src/dal/sqlitedataprovider.cpp | 21 +++------------------ src/dal/sqlitedataprovider.h | 10 ---------- src/game-server/accountconnection.h | 7 ------- src/game-server/actor.h | 3 --- src/game-server/gamehandler.h | 3 --- src/game-server/mapcomposite.h | 7 ------- src/game-server/monster.h | 7 ------- src/game-server/thing.h | 3 --- src/net/messagein.h | 3 +++ src/net/messageout.h | 5 +---- src/net/netcomputer.h | 6 ------ src/scripting/luascript.h | 3 --- src/scripting/script.h | 6 ------ src/utils/singleton.h | 3 --- src/utils/timer.h | 3 +++ 32 files changed, 14 insertions(+), 203 deletions(-) diff --git a/src/account-server/account.h b/src/account-server/account.h index 5d9c5866..e98cfeab 100644 --- a/src/account-server/account.h +++ b/src/account-server/account.h @@ -34,15 +34,10 @@ class Account { public: - /** - * Constructor. - */ - Account(int id = -1): mID(id) + Account(int id = -1) + : mID(id) {} - /** - * Destructor. - */ ~Account(); /** diff --git a/src/account-server/accountclient.h b/src/account-server/accountclient.h index bdcc4b8c..dd2e1366 100644 --- a/src/account-server/accountclient.h +++ b/src/account-server/accountclient.h @@ -41,14 +41,7 @@ enum AccountClientStatus class AccountClient : public NetComputer { public: - /** - * Constructor. - */ AccountClient(ENetPeer *peer); - - /** - * Destructor. - */ ~AccountClient(); /** diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index 79415bd7..46f202a3 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -88,9 +88,6 @@ static std::map< unsigned int, std::pair< double, double> > defAttr; class AccountHandler : public ConnectionHandler { public: - /** - * Constructor. - */ AccountHandler(const std::string &attrFile); /** diff --git a/src/chat-server/chatclient.h b/src/chat-server/chatclient.h index daac0fcd..e1aa4b04 100644 --- a/src/chat-server/chatclient.h +++ b/src/chat-server/chatclient.h @@ -38,9 +38,6 @@ class Party; class ChatClient : public NetComputer { public: - /** - * Constructor. - */ ChatClient(ENetPeer *peer): NetComputer(peer), party(0), diff --git a/src/chat-server/guild.h b/src/chat-server/guild.h index e9207a31..21b1b2e7 100644 --- a/src/chat-server/guild.h +++ b/src/chat-server/guild.h @@ -42,14 +42,7 @@ public: class Guild { public: - /** - * Constructor. - */ Guild(const std::string &name); - - /** - * Destructor. - */ ~Guild(); /** diff --git a/src/chat-server/party.h b/src/chat-server/party.h index 29bb7f21..8d053a18 100644 --- a/src/chat-server/party.h +++ b/src/chat-server/party.h @@ -32,7 +32,6 @@ class Party public: typedef std::vector PartyUsers; - /** Constructor */ Party(); /** diff --git a/src/chat-server/post.h b/src/chat-server/post.h index 1cb4072c..c8006faa 100644 --- a/src/chat-server/post.h +++ b/src/chat-server/post.h @@ -44,9 +44,6 @@ public: */ Letter(unsigned int type, Character *sender, Character *receiver); - /** - * Destructor - */ ~Letter(); /** @@ -128,9 +125,6 @@ private: class Post { public: - /** - * Destructor - */ ~Post(); /** diff --git a/src/dal/dalexcept.h b/src/dal/dalexcept.h index 1ad36df2..bf202820 100644 --- a/src/dal/dalexcept.h +++ b/src/dal/dalexcept.h @@ -43,9 +43,6 @@ class DbException: public std::exception : mMsg(msg) {} - /** - * Destructor. - */ ~DbException() throw() {} diff --git a/src/dal/dataprovider.cpp b/src/dal/dataprovider.cpp index 684c2556..a88e205d 100644 --- a/src/dal/dataprovider.cpp +++ b/src/dal/dataprovider.cpp @@ -54,9 +54,6 @@ void PerformTransaction::commit() } -/** - * Constructor. - */ DataProvider::DataProvider() throw() : mIsConnected(false), @@ -64,9 +61,6 @@ DataProvider::DataProvider() { } -/** - * Destructor. - */ DataProvider::~DataProvider() throw() { diff --git a/src/dal/dataproviderfactory.cpp b/src/dal/dataproviderfactory.cpp index 96f4e8ee..d8c44f04 100644 --- a/src/dal/dataproviderfactory.cpp +++ b/src/dal/dataproviderfactory.cpp @@ -37,25 +37,16 @@ namespace dal { - -/** - * Default constructor. - */ DataProviderFactory::DataProviderFactory() throw() { } - -/** - * Destructor. - */ DataProviderFactory::~DataProviderFactory() throw() { } - /** * Create a data provider. */ @@ -73,5 +64,4 @@ DataProvider *DataProviderFactory::createDataProvider() #endif } - } // namespace dal diff --git a/src/dal/dataproviderfactory.h b/src/dal/dataproviderfactory.h index 5ae7799c..5cceeacd 100644 --- a/src/dal/dataproviderfactory.h +++ b/src/dal/dataproviderfactory.h @@ -49,9 +49,6 @@ class DataProviderFactory DataProviderFactory() throw(); - /** - * Destructor. - */ ~DataProviderFactory() throw(); diff --git a/src/dal/mysqldataprovider.cpp b/src/dal/mysqldataprovider.cpp index c1f45731..13036461 100644 --- a/src/dal/mysqldataprovider.cpp +++ b/src/dal/mysqldataprovider.cpp @@ -37,9 +37,6 @@ const std::string MySqlDataProvider::CFGPARAM_MYSQL_DB_DEF = "mana"; const std::string MySqlDataProvider::CFGPARAM_MYSQL_USER_DEF = "mana"; const std::string MySqlDataProvider::CFGPARAM_MYSQL_PWD_DEF = "mana"; -/** - * Constructor. - */ MySqlDataProvider::MySqlDataProvider() throw() : mDb(0), @@ -49,10 +46,6 @@ MySqlDataProvider::MySqlDataProvider() { } - -/** - * Destructor. - */ MySqlDataProvider::~MySqlDataProvider() throw() { @@ -65,7 +58,6 @@ MySqlDataProvider::~MySqlDataProvider() disconnect(); } - /** * Get the database backend name. */ @@ -75,7 +67,6 @@ DbBackends MySqlDataProvider::getDbBackend() const return DB_BKEND_MYSQL; } - /** * Create a connection to the database. */ @@ -136,13 +127,11 @@ void MySqlDataProvider::connect() LOG_INFO("Connection to mySQL was sucessfull."); } - /** * Execute a SQL query. */ -const RecordSet& -MySqlDataProvider::execSql(const std::string& sql, - const bool refresh) +const RecordSet &MySqlDataProvider::execSql(const std::string& sql, + const bool refresh) { if (!mIsConnected) throw std::runtime_error("not connected to database"); @@ -197,7 +186,6 @@ MySqlDataProvider::execSql(const std::string& sql, return mRecordSet; } - /** * Close the connection to the database. */ diff --git a/src/dal/mysqldataprovider.h b/src/dal/mysqldataprovider.h index a35d35e8..945b284f 100644 --- a/src/dal/mysqldataprovider.h +++ b/src/dal/mysqldataprovider.h @@ -53,15 +53,9 @@ class MySqlDataProvider: public DataProvider AUTOCOMMIT_ON = 1 }; - /** - * Constructor. - */ MySqlDataProvider() throw(); - /** - * Destructor. - */ ~MySqlDataProvider() throw(); diff --git a/src/dal/pqdataprovider.cpp b/src/dal/pqdataprovider.cpp index 5351b0ce..1ba62f22 100644 --- a/src/dal/pqdataprovider.cpp +++ b/src/dal/pqdataprovider.cpp @@ -24,20 +24,12 @@ namespace dal { - -/** - * Constructor - */ PqDataProvider::PqDataProvider() throw() : mDb(0) { } - -/** - * Destructor - */ PqDataProvider::~PqDataProvider() throw() { @@ -45,7 +37,6 @@ PqDataProvider::~PqDataProvider() disconnect(); } - /** * Get the database backend name. */ @@ -55,7 +46,6 @@ DbBackends PqDataProvider::getDbBackend() const return DB_BKEND_POSTGRESQL; } - /** * Create a connection to the database. */ @@ -86,7 +76,6 @@ void PqDataProvider::connect(const std::string& dbName, mIsConnected = true; } - /** * Execute a SQL query. */ @@ -138,7 +127,6 @@ const RecordSet &PqDataProvider::execSql(const std::string& sql, return mRecordSet; } - /** * Close connection to database. */ @@ -154,5 +142,4 @@ void PqDataProvider::disconnect() mIsConnected = false; } - } // namespace dal diff --git a/src/dal/pqdataprovider.h b/src/dal/pqdataprovider.h index 872428ac..6a2a1b17 100644 --- a/src/dal/pqdataprovider.h +++ b/src/dal/pqdataprovider.h @@ -35,15 +35,9 @@ namespace dal class PqDataProvider: public DataProvider { public: - /** - * Constructor - */ PqDataProvider() throw(); - /** - * Destructor - */ ~PqDataProvider() throw(); diff --git a/src/dal/recordset.cpp b/src/dal/recordset.cpp index 77b2a94a..065bbd77 100644 --- a/src/dal/recordset.cpp +++ b/src/dal/recordset.cpp @@ -29,17 +29,11 @@ namespace dal { -/** - * Default constructor. - */ RecordSet::RecordSet() throw() { } -/** - * Destructor. - */ RecordSet::~RecordSet() throw() { @@ -62,7 +56,6 @@ bool RecordSet::isEmpty() const return mRows.size() == 0; } - /** * Get the number of rows. * @@ -83,7 +76,6 @@ unsigned int RecordSet::cols() const return mHeaders.size(); } - /** * Set the column headers. */ @@ -96,7 +88,6 @@ void RecordSet::setColumnHeaders(const Row &headers) mHeaders = headers; } - /** * Add a new row. */ @@ -119,10 +110,6 @@ void RecordSet::add(const Row &row) mRows.push_back(row); } - -/** - * Operator() - */ const std::string &RecordSet::operator()(const unsigned int row, const unsigned int col) const { @@ -138,10 +125,6 @@ const std::string &RecordSet::operator()(const unsigned int row, return mRows[row][col]; } - -/** - * Operator() - */ const std::string &RecordSet::operator()(const unsigned int row, const std::string& name) const { @@ -175,10 +158,6 @@ const std::string &RecordSet::operator()(const unsigned int row, return mRows[row][i]; } - -/** - * Operator<< - */ std::ostream &operator<<(std::ostream &out, const RecordSet &rhs) { // print the field names first. @@ -211,5 +190,4 @@ std::ostream &operator<<(std::ostream &out, const RecordSet &rhs) return out; } - } // namespace dal diff --git a/src/dal/recordset.h b/src/dal/recordset.h index 3abef8ee..80c2e68f 100644 --- a/src/dal/recordset.h +++ b/src/dal/recordset.h @@ -44,15 +44,9 @@ typedef std::vector Row; class RecordSet { public: - /** - * Default constructor. - */ RecordSet() throw(); - /** - * Destructor. - */ ~RecordSet() throw(); diff --git a/src/dal/sqlitedataprovider.cpp b/src/dal/sqlitedataprovider.cpp index ea394e0c..74fa0721 100644 --- a/src/dal/sqlitedataprovider.cpp +++ b/src/dal/sqlitedataprovider.cpp @@ -29,24 +29,15 @@ namespace dal { - const std::string SqLiteDataProvider::CFGPARAM_SQLITE_DB = "sqlite_database"; const std::string SqLiteDataProvider::CFGPARAM_SQLITE_DB_DEF = "mana.db"; - -/** - * Constructor. - */ SqLiteDataProvider::SqLiteDataProvider() throw() : mDb(0) { } - -/** - * Destructor. - */ SqLiteDataProvider::~SqLiteDataProvider() throw() { @@ -64,7 +55,6 @@ SqLiteDataProvider::~SqLiteDataProvider() } } - /** * Get the name of the database backend. */ @@ -74,12 +64,10 @@ DbBackends SqLiteDataProvider::getDbBackend() const return DB_BKEND_SQLITE; } - /** * Create a connection to the database. */ -void -SqLiteDataProvider::connect() +void SqLiteDataProvider::connect() { // get configuration parameter for sqlite const std::string dbName @@ -114,13 +102,11 @@ SqLiteDataProvider::connect() LOG_INFO("Connection to database successful."); } - /** * Execute a SQL query. */ -const RecordSet& -SqLiteDataProvider::execSql(const std::string& sql, - const bool refresh) +const RecordSet &SqLiteDataProvider::execSql(const std::string& sql, + const bool refresh) { if (!mIsConnected) throw std::runtime_error("not connected to database"); @@ -187,7 +173,6 @@ SqLiteDataProvider::execSql(const std::string& sql, return mRecordSet; } - /** * Close the connection to the database. */ diff --git a/src/dal/sqlitedataprovider.h b/src/dal/sqlitedataprovider.h index 39413643..e948f009 100644 --- a/src/dal/sqlitedataprovider.h +++ b/src/dal/sqlitedataprovider.h @@ -45,15 +45,9 @@ namespace dal class SqLiteDataProvider: public DataProvider { public: - /** - * Constructor. - */ SqLiteDataProvider() throw(); - /** - * Destructor. - */ ~SqLiteDataProvider() throw(); @@ -65,7 +59,6 @@ class SqLiteDataProvider: public DataProvider DbBackends getDbBackend() const throw(); - /** * Create a connection to the database. * @@ -73,7 +66,6 @@ class SqLiteDataProvider: public DataProvider */ void connect(); - /** * Execute a SQL query. * @@ -88,7 +80,6 @@ class SqLiteDataProvider: public DataProvider const RecordSet &execSql(const std::string& sql, const bool refresh = false); - /** * Close the connection to the database. * @@ -171,7 +162,6 @@ class SqLiteDataProvider: public DataProvider void bindValue(int place, int value); private: - /** defines the name of the database config parameter */ static const std::string CFGPARAM_SQLITE_DB; /** defines the default value of the CFGPARAM_SQLITE_DB parameter */ diff --git a/src/game-server/accountconnection.h b/src/game-server/accountconnection.h index 37033389..02903dc7 100644 --- a/src/game-server/accountconnection.h +++ b/src/game-server/accountconnection.h @@ -49,14 +49,7 @@ class MapComposite; class AccountConnection : public Connection { public: - /** - * Constructor. - */ AccountConnection(); - - /** - * Destructor. - */ ~AccountConnection(); /** diff --git a/src/game-server/actor.h b/src/game-server/actor.h index dc3e7ad1..529d48c4 100644 --- a/src/game-server/actor.h +++ b/src/game-server/actor.h @@ -47,9 +47,6 @@ enum class Actor : public Thing { public: - /** - * Constructor. - */ Actor(ThingType type) : Thing(type), mMoveTime(0), diff --git a/src/game-server/gamehandler.h b/src/game-server/gamehandler.h index 5a2630dc..a6b701dd 100644 --- a/src/game-server/gamehandler.h +++ b/src/game-server/gamehandler.h @@ -48,9 +48,6 @@ struct GameClient: NetComputer class GameHandler: public ConnectionHandler { public: - /** - * Constructor - */ GameHandler(); /** diff --git a/src/game-server/mapcomposite.h b/src/game-server/mapcomposite.h index a695de0d..f34ad24a 100644 --- a/src/game-server/mapcomposite.h +++ b/src/game-server/mapcomposite.h @@ -229,14 +229,7 @@ struct MapContent class MapComposite { public: - /** - * Constructor. - */ MapComposite(int id, const std::string &name); - - /** - * Destructor. - */ ~MapComposite(); /** diff --git a/src/game-server/monster.h b/src/game-server/monster.h index 14ebad35..3981604f 100644 --- a/src/game-server/monster.h +++ b/src/game-server/monster.h @@ -230,14 +230,7 @@ class Monster : public Being /** Time in game ticks until ownership of a monster can change. */ static const int KILLSTEAL_PROTECTION_TIME = 100; - /** - * Constructor. - */ Monster(MonsterClass *); - - /** - * Destructor. - */ ~Monster(); /** diff --git a/src/game-server/thing.h b/src/game-server/thing.h index 437980bd..a8a58a04 100644 --- a/src/game-server/thing.h +++ b/src/game-server/thing.h @@ -36,9 +36,6 @@ class MapComposite; class Thing { public: - /** - * Constructor. - */ Thing(ThingType type, MapComposite *map = NULL) : mMap(map), mType(type) diff --git a/src/net/messagein.h b/src/net/messagein.h index f01c1850..dd82ce51 100644 --- a/src/net/messagein.h +++ b/src/net/messagein.h @@ -31,6 +31,9 @@ class MessageIn public: /** * Constructor. + * + * @param data the message data + * @param length the length of the data */ MessageIn(const char *data, int length); diff --git a/src/net/messageout.h b/src/net/messageout.h index cf3e0c73..1f071f72 100644 --- a/src/net/messageout.h +++ b/src/net/messageout.h @@ -30,7 +30,7 @@ class MessageOut { public: /** - * Constructor. + * Default constructor. */ MessageOut(); @@ -39,9 +39,6 @@ class MessageOut */ MessageOut(int id); - /** - * Destructor. - */ ~MessageOut(); /** diff --git a/src/net/netcomputer.h b/src/net/netcomputer.h index d3485f64..ee5d2cdc 100644 --- a/src/net/netcomputer.h +++ b/src/net/netcomputer.h @@ -33,14 +33,8 @@ class MessageOut; class NetComputer { public: - /** - * Constructor. - */ NetComputer(ENetPeer *peer); - /** - * Destructor. - */ virtual ~NetComputer() {} /** diff --git a/src/scripting/luascript.h b/src/scripting/luascript.h index cc1675d8..af13aa22 100644 --- a/src/scripting/luascript.h +++ b/src/scripting/luascript.h @@ -40,9 +40,6 @@ class LuaScript: public Script */ LuaScript(); - /** - * Destructor. - */ ~LuaScript(); void load(const char *prog, const char *name); diff --git a/src/scripting/script.h b/src/scripting/script.h index 5d5d1f48..43eebe10 100644 --- a/src/scripting/script.h +++ b/src/scripting/script.h @@ -48,14 +48,8 @@ class Script */ static Script *create(const std::string &engine); - /** - * Constructor. - */ Script(); - /** - * Destructor. - */ virtual ~Script() {} /** diff --git a/src/utils/singleton.h b/src/utils/singleton.h index 4535439d..c3a8e2fc 100644 --- a/src/utils/singleton.h +++ b/src/utils/singleton.h @@ -50,9 +50,6 @@ class Singleton throw() {} - /** - * Destructor. - */ virtual ~Singleton() throw() {} diff --git a/src/utils/timer.h b/src/utils/timer.h index d64ed54f..87c94a28 100644 --- a/src/utils/timer.h +++ b/src/utils/timer.h @@ -39,6 +39,9 @@ class Timer public: /** * Constructor. + * + * @param ms the interval in milliseconds + * @param createActive whether the timer should be implicitly started */ Timer(unsigned int ms, bool createActive = true); -- cgit v1.2.3-60-g2f50