From 5259df591d31c06f89c6af6032aca67918ae1b63 Mon Sep 17 00:00:00 2001 From: AOYAMA Kazuharu Date: Sat, 19 Mar 2016 17:21:55 +0900 Subject: [PATCH] update doxygen comments. --- Doxyfile | 4 +- defaults/application.ini | 2 +- src/tredis.cpp | 102 +++++++++++++++++++++++++++++++++------ src/tredis.h | 2 +- src/tsqljoin.h | 2 + src/tsqlormapper.h | 4 +- 6 files changed, 98 insertions(+), 18 deletions(-) diff --git a/Doxyfile b/Doxyfile index 49ceb1764..6cd059a6f 100644 --- a/Doxyfile +++ b/Doxyfile @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = TreeFrog Framework -PROJECT_NUMBER = 1.9 +PROJECT_NUMBER = 1.11 PROJECT_BRIEF = PROJECT_LOGO = OUTPUT_DIRECTORY = doc @@ -102,6 +102,7 @@ FILE_PATTERNS = RECURSIVE = NO EXCLUDE = src/test \ src/trash \ + src/tpreforkapplicationserver.h \ src/directcontroller.h \ src/tabstractlogstream.h \ src/taccesslog.h \ @@ -143,6 +144,7 @@ EXCLUDE = src/test \ src/tmongocursor.h \ src/tmongomapper.h \ src/tmongoobject.h \ + src/tredisdriver.h \ src/tcriteriamongoconverter.h \ src/thttpbuffer.h \ src/thttpsendbuffer.h \ diff --git a/defaults/application.ini b/defaults/application.ini index ebe14d161..9375b822f 100644 --- a/defaults/application.ini +++ b/defaults/application.ini @@ -75,7 +75,7 @@ EnableHttpMethodOverride=false # Sets the timeout in seconds during which a keep-alive HTTP connection # will stay open on the server side. The zero value disables keep-alive -# client connections. +# client connections. HttpKeepAliveTimeout=10 # Forces some libraries to be loaded before all others. It means to set diff --git a/src/tredis.cpp b/src/tredis.cpp index 8debe9ebd..dbdbb476d 100644 --- a/src/tredis.cpp +++ b/src/tredis.cpp @@ -69,13 +69,18 @@ const TRedisDriver *TRedis::driver() const #endif } - +/*! + Returns true if the Redis connection is open; otherwise + returns false. + */ bool TRedis::isOpen() const { return (driver()) ? driver()->isOpen() : false; } - +/*! + Returns true if the \a key exists; otherwise returns false. + */ bool TRedis::exists(const QByteArray &key) { if (!driver()) { @@ -88,7 +93,10 @@ bool TRedis::exists(const QByteArray &key) return (res && resp.value(0).toInt() == 1); } - +/*! + Returns the value associated with the \a key; otherwise + returns an empty bit array. + */ QByteArray TRedis::get(const QByteArray &key) { if (!driver()) { @@ -101,7 +109,10 @@ QByteArray TRedis::get(const QByteArray &key) return (res) ? resp.value(0).toByteArray() : QByteArray(); } - +/*! + Sets the \a key to hold the \a value. If the key already holds a + value, it is overwritten, regardless of its type. + */ bool TRedis::set(const QByteArray &key, const QByteArray &value) { if (!driver()) { @@ -113,7 +124,10 @@ bool TRedis::set(const QByteArray &key, const QByteArray &value) return driver()->request(command, resp); } - +/*! + Sets the \a key to hold the \a value and set the key to timeout + after a given number of \a seconds. + */ bool TRedis::setEx(const QByteArray &key, const QByteArray &value, int seconds) { if (!driver()) { @@ -125,7 +139,10 @@ bool TRedis::setEx(const QByteArray &key, const QByteArray &value, int seconds) return driver()->request(command, resp); } - +/*! + Atomically sets the \a key to the \a value and returns the old value + stored at the \a key. + */ QByteArray TRedis::getSet(const QByteArray &key, const QByteArray &value) { if (!driver()) { @@ -138,7 +155,10 @@ QByteArray TRedis::getSet(const QByteArray &key, const QByteArray &value) return (res) ? resp.value(0).toByteArray() : QByteArray(); } - +/*! + Removes the specified \a key. A key is ignored if it does + not exist. + */ bool TRedis::del(const QByteArray &key) { QList keys = { key }; @@ -146,7 +166,10 @@ bool TRedis::del(const QByteArray &key) return (count == 1); } - +/*! + Removes the specified \a keys. A key is ignored if it does + not exist. + */ int TRedis::del(const QList &keys) { if (!driver()) { @@ -161,7 +184,7 @@ int TRedis::del(const QList &keys) } /*! - Inserts all the \a values at the tail of the list stored at key. + Inserts all the \a values at the tail of the list stored at the \a key. Returns the length of the list after the push operation. */ int TRedis::rpush(const QByteArray &key, const QList &values) @@ -178,7 +201,7 @@ int TRedis::rpush(const QByteArray &key, const QList &values) } /*! - Inserts all the \a values at the tail of the list stored at key. + Inserts all the \a values at the tail of the list stored at the \a key. Returns the length of the list after the push operation. */ int TRedis::lpush(const QByteArray &key, const QList &values) @@ -194,8 +217,10 @@ int TRedis::lpush(const QByteArray &key, const QList &values) return (res) ? resp.value(0).toInt() : 0; } - -QList TRedis::lrange(const QByteArray &key, int start, int end) +/*! + Returns the specified elements of the list stored at the \a key. + */ +QList TRedis::lrange(const QByteArray &key, int start, int end = -1) { if (!driver()) { return QList(); @@ -213,7 +238,9 @@ QList TRedis::lrange(const QByteArray &key, int start, int end) return ret; } - +/*! + Returns the element at the \a index in the list stored at the \a key. + */ QByteArray TRedis::lindex(const QByteArray &key, int index) { if (!driver()) { @@ -227,7 +254,7 @@ QByteArray TRedis::lindex(const QByteArray &key, int index) } /*! - Returns the length of the list stored at key. + Returns the length of the list stored at the \a key. */ int TRedis::llen(const QByteArray &key) { @@ -260,3 +287,50 @@ QStringList TRedis::toStringList(const QList &values) } return ret; } + + +/*! + \fn QString TRedis::gets(const QByteArray &key) + Returns the string associated with the \a key; otherwise returns a + null string. + */ + +/*! + \fn bool TRedis::sets(const QByteArray &key, const QString &value) + Sets the \a key to hold the string \a value. If the key already holds + a value, it is overwritten, regardless of its type. + */ + +/*! + \fn bool TRedis::setsEx(const QByteArray &key, const QString &value, int seconds) + Sets the \a key to hold the string \a value and set the key to timeout + after a given number of \a seconds. + */ + +/*! + \fn QString TRedis::getsSets(const QByteArray &key, const QString &value) + Atomically sets the \a key to the string \a value and returns the old string + value stored at the \a key. + */ + +/*! + \fn int TRedis::rpushs(const QByteArray &key, const QStringList &values); + Inserts all the string \a values at the tail of the list stored at the + \a key. Returns the length of the list after the push operation. +*/ + +/*! + \fn int TRedis::lpushs(const QByteArray &key, const QStringList &values); + Inserts all the string \a values at the tail of the list stored at the + \a key. Returns the length of the list after the push operation. +*/ + +/*! + \fn QStringList TRedis::lranges(const QByteArray &key, int start, int end); + Returns the specified elements of the list stored at the \a key. +*/ + +/*! + \fn QString TRedis::lindexs(const QByteArray &key, int index); + Returns the string at the \a index in the list stored at the \a key. +*/ diff --git a/src/tredis.h b/src/tredis.h index 543e7bdac..ad5070566 100644 --- a/src/tredis.h +++ b/src/tredis.h @@ -90,7 +90,7 @@ inline int TRedis::lpushs(const QByteArray &key, const QStringList &values) return lpush(key, toByteArrayList(values)); } -inline QStringList TRedis::lranges(const QByteArray &key, int start, int end) +inline QStringList TRedis::lranges(const QByteArray &key, int start, int end = -1) { return toStringList(lrange(key, start, end)); } diff --git a/src/tsqljoin.h b/src/tsqljoin.h index 3f0ee3485..1ada92294 100644 --- a/src/tsqljoin.h +++ b/src/tsqljoin.h @@ -6,6 +6,8 @@ /*! \class TSqlJoin + \brief The TSqlJoin class represents JOIN clause for combination + to a record of other table. */ diff --git a/src/tsqlormapper.h b/src/tsqlormapper.h index 19b4a7464..262ec0b13 100644 --- a/src/tsqlormapper.h +++ b/src/tsqlormapper.h @@ -613,7 +613,9 @@ inline int TSqlORMapper::removeAll(const TCriteria &cri) return res ? sqlQuery.numRowsAffected() : -1; } - +/*! + Sets a JOIN clause for \a column to \a join. + */ template template inline void TSqlORMapper::setJoin(int column, const TSqlJoin &join) {