doxygen fixes

This commit is contained in:
Evgenii Alekseev 2017-03-11 06:30:09 +03:00
parent 57281bbb88
commit b1821507dc
17 changed files with 101 additions and 151 deletions

View File

@ -2,7 +2,7 @@
find_package (Doxygen)
configure_file ("doxygen.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf")
add_custom_target ("oxygen-docs" ALL COMMAND "${DOXYGEN_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf")
add_custom_target ("docs" ALL COMMAND "${DOXYGEN_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf")
# html docs
install (DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/docs/html" DESTINATION "${DATA_INSTALL_DIR}/doc/${SUBPROJECT}")

View File

@ -98,7 +98,7 @@ public:
void set(const QString &_key, const QVariant &_value);
/**
* @brief upload configuration from database in to internal format
* @param _value
* @param _values
* configuration values from database
*/
void set(const QList<QVariantHash> &_values);

View File

@ -32,18 +32,17 @@
/**
* @defgroup QueuedCfg
* @addtogroup QueuedCfg
* @brief Queued configuration related types
*/
namespace QueuedCfg
{
/**
* @ingroup QueuedCfg
* @struct QueuedAdminSetup
* @brief structure to define administrator user
* @var name
* @var QueuedAdminSetup::name
* administrator user name
* @var password
* @var QueuedAdminSetup::password
* administrator user password
*/
typedef struct {
@ -51,20 +50,19 @@ typedef struct {
QString password;
} QueuedAdminSetup;
/**
* @ingroup QueuedCfg
* @struct QueuedDBSetup
* @brief structure to define database setup
* @var driver
* @var QueuedDBSetup::driver
* driver name
* @var hostname
* @var QueuedDBSetup::hostname
* hostname to connect
* @var password
* @var QueuedDBSetup::password
* password to connect if any
* @var path
* @var QueuedDBSetup::path
* path to database
* @var port
* @var QueuedDBSetup::port
* port to connect
* @var username
* @var QueuedDBSetup::username
* username to connect if any
*/
typedef struct {
@ -76,7 +74,6 @@ typedef struct {
QString username;
} QueuedDBSetup;
/**
* @ingroup QueuedCfg
* @enum QueuedSettings
* @brief settings keys enum
* @var QueuedSettings::Invalid
@ -113,14 +110,11 @@ enum class QueuedSettings {
Plugins = 1 << 9,
};
/**
* @ingroup QueuedCfg
* @struct QueuedSettingsField
* @brief structure to define advanced settings field
* @var id
* @var QueuedSettingsField::id
* interval field ID
* @var key
* settings key
* @var defaultValue
* @var QueuedSettingsField::defaultValue
* settings default value
*/
typedef struct {
@ -128,13 +122,11 @@ typedef struct {
QVariant defaultValue;
} QueuedSettingsField;
/**
* @ingroup QueuedCfg
* @typedef QueuedProcessConnectionMap
* @typedef QueuedSettingsDefaultMap
* map of settings indices to related values
*/
typedef QHash<QString, QueuedSettingsField> QueuedSettingsDefaultMap;
/**
* @ingroup QueuedCfg
* @brief default settings map
*/
const QueuedSettingsDefaultMap QueuedSettingsDefaults

View File

@ -29,13 +29,12 @@
/**
* @defgroup QueuedCoreAdaptor
* @addtogroup QueuedCoreAdaptor
* @brief adaptor to DBus methods
*/
namespace QueuedCoreAdaptor
{
/**
* @ingroup QueuedCoreAdaptor
* @brief common DBus request
* @param _service
* DBus service name
@ -53,7 +52,6 @@ QVariantList sendRequest(const QString &_service, const QString &_path,
const QString &_interface, const QString &_cmd,
const QVariantList &_args);
/**
* @ingroup QueuedCoreAdaptor
* @brief additional method to avoid conversion from DBus type to native ones
* @param _data
* source data

View File

@ -87,8 +87,6 @@ public slots:
* @brief remove plugin
* @param plugin
* plugin name
* @param whoAmI
* auth user name
* @param token
* auth user token
* @return true on successful plugin removal
@ -116,8 +114,6 @@ public slots:
* limit by GPU memory
* @param storage
* limit by storage
* @param whoAmI
* auth user name
* @param token
* auth user token
* @return true on successful task addition
@ -141,6 +137,8 @@ public slots:
* nice level or 0
* @param uid
* new uid or 0
* @param gid
* new gid or 0
* @param state
* new state or 0
* @param cpu
@ -153,12 +151,6 @@ public slots:
* new limit by GPU memory or -1
* @param storage
* new limit by storage or -1
* @param start
* new start time in ISO format or empty
* @param end
* new end time in ISO format or empty
* @param whoAmI
* auth user name
* @param token
* auth user token
* @return true on successful task edition
@ -173,8 +165,6 @@ public slots:
* @brief force start task
* @param id
* task ID
* @param whoAmI
* auth user name
* @param token
* auth user token
* @return true on successful task start
@ -184,8 +174,6 @@ public slots:
* @brief force stop task
* @param id
* task ID
* @param whoAmI
* auth user name
* @param token
* auth user token
* @return true on successful task stop
@ -211,8 +199,6 @@ public slots:
* limit by GPU memory
* @param storage
* limit by storage
* @param whoAmI
* auth user name
* @param token
* auth user token
* @return true on successful task addition
@ -242,8 +228,6 @@ public slots:
* new limit by GPU memory or -1
* @param storage
* new limit by storage or -1
* @param whoAmI
* auth user name
* @param token
* auth user token
* @return true on successful user edition
@ -259,8 +243,6 @@ public slots:
* user ID
* @param permission
* permission to add
* @param whoAmI
* auth user name
* @param token
* auth user token
* @return true on successful permission addition
@ -273,8 +255,6 @@ public slots:
* user ID
* @param permission
* permission to remove
* @param whoAmI
* auth user name
* @param token
* auth user token
* @return true on successful permission removal

View File

@ -64,7 +64,7 @@ public:
void startWorker();
// properties
/**
* @breef database actions interval
* @brief database actions interval
* @return interval in milliseconds
*/
long long interval() const;

View File

@ -29,42 +29,37 @@
/**
* @defgroup QueuedDB
* @addtogroup QueuedDB
* @brief Queued database related constants
*/
namespace QueuedDB
{
/**
* @ingroup QueuedDB
* @brief settings table name
*/
const char SETTINGS_TABLE[] = "settings";
/**
* @ingroup QueuedDB
* @brief tasks table name
*/
const char TASKS_TABLE[] = "tasks";
/**
* @ingroup QueuedDB
* @brief tokens table name
*/
const char TOKENS_TABLE[] = "tokens";
/**
* @ingroup QueuedDB
* @brief users table name
*/
const char USERS_TABLE[] = "users";
/**
*@ingroup QueuedDB
* @struct QueuedDBField
* @brief describes database column
* @var name
* @var QueuedDBField::name
* column name
* @var sqlDescription
* @var QueuedDBField::sqlDescription
* description to create column
* @var type
* @var QueuedDBField::type
* Qt type of column for cast
* @var adminField
* @var QueuedDBField::adminField
* is admin permissions required to edit or not
*/
typedef struct {
@ -74,13 +69,11 @@ typedef struct {
bool adminField;
} QueuedDBField;
/**
* @ingroup QueuedDB
* @typedef QueuedDBSchema
* custom map for database schemas descriptions
*/
typedef QHash<QString, QHash<QString, QueuedDBField>> QueuedDBSchema;
/**
* @ingroup QueuedDB
* @brief database schema
*/
const QueuedDBSchema DBSchema = {

View File

@ -53,13 +53,12 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_PL)
Q_DECLARE_LOGGING_CATEGORY(LOG_SERV)
/**
* @defgroup QueuedDebug
* @addtogroup QueuedDebug
* @brief Queued debug functions
*/
namespace QueuedDebug
{
/**
* @ingroup QueuedDebug
* @brief default log format
*/
const char LOG_FORMAT[] = "[%{time "
@ -68,12 +67,10 @@ const char LOG_FORMAT[] = "[%{time "
"fatal}FF%{endif}][%{category}][%{function}] "
"%{message}";
/**
* @ingroup QueuedDebug
* @brief method to enable debug messages
*/
void enableDebug();
/**
* @ingroup QueuedDebug
* @brief additional method to get build details declared in version.h
*/
QStringList getBuildData();

View File

@ -26,24 +26,23 @@
/**
* @defgroup QueuedEnums
* @addtogroup QueuedEnums
* @brief Queued enumerations
*/
namespace QueuedEnums
{
/**
* @ingroup QueuedEnums
* @enum Permissions
* @enum Permission
* @brief available user permissions
* @var Permissions::Admin
* @var Permission::SuperAdmin
* "allow all" permissions
* @var Permission::Admin
* administrative permissions
* @var Permissions::JobOwner
* @var Permission::JobOwner
* owner job related permissions
* @var Permissions::User
* user related permissions
* @var Permissions::Web
* @var Permission::Web
* web server access
* @var Permissions::Reports
* @var Permission::Reports
* access to reports
*/
enum class Permission {
@ -55,6 +54,15 @@ enum class Permission {
};
Q_DECLARE_FLAGS(Permissions, Permission)
Q_DECLARE_OPERATORS_FOR_FLAGS(Permissions)
/**
* @enum ExitAction
* @brief action with child process on destruction
* @var ExitAction::Terminate
* send SIGTERM on exit
* @var ExitAction::Kill
* send SIGKILL on exit
*/
enum class ExitAction { Terminate = 1 << 1, Kill = 1 << 2 };
};

View File

@ -28,25 +28,24 @@
/**
* @defgroup QueuedLimits
* @addtogroup QueuedLimits
* @brief Queued limits
*/
namespace QueuedLimits
{
/**
* @ingroup QueuedLimits
* @struct Limits
* @var cpu
* @var Limits::cpu
* limit by CPU
* @var gpu
* @var Limits::gpu
* limit by GPU
* @var memory
* @var Limits::memory
* limit by memory
* @var gpumemory
* @var Limits::gpumemory
* limit by GPU memory
* @var storage
* @var Limits::storage
* limit by storage
* @var valid
* @var Limits::valid
* is this permissions default generated or not
*/
struct Limits {
@ -100,9 +99,9 @@ struct Limits {
};
/**
* @brief structure constructor from fields
* @param _cpuLimit
* @param _cpu
* limit by CPU cores
* @param _gpuLimit
* @param _gpu
* limit by GPU cores
* @param _memory
* limit by memory
@ -111,18 +110,16 @@ struct Limits {
* @param _storage
* limit by storage
*/
Limits(const long long _cpuLimit, const long long _gpuLimit,
const long long _memoryLimit, const long long _gpumemoryLimit,
const long long _storage)
: cpu(_cpuLimit)
, gpu(_gpuLimit)
, memory(_memoryLimit)
, gpumemory(_gpumemoryLimit)
Limits(const long long _cpu, const long long _gpu, const long long _memory,
const long long _gpumemory, const long long _storage)
: cpu(_cpu)
, gpu(_gpu)
, memory(_memory)
, gpumemory(_gpumemory)
, storage(_storage)
, valid(true){};
};
/**
* @ingroup QueuedLimits
* @brief convert QString memory value to integer
* @param _value
* value to convert
@ -132,7 +129,6 @@ struct Limits {
*/
long long convertMemory(QString _value, bool *_status = nullptr);
/**
* @ingroup QueuedLimits
* @brief compare two limits
* @param _first
* first limit
@ -142,7 +138,6 @@ long long convertMemory(QString _value, bool *_status = nullptr);
*/
bool limitCompare(const long long _first, const long long _second);
/**
* @ingroup QueuedLimits
* @brief get minimal limits from given
* @param _task
* task defined limits

View File

@ -57,25 +57,25 @@ public:
/**
* @struct QueuedProcessDefinition
* @brief structure to define process
* @var command
* @var QueuedProcessDefinitions::command
* command line
* @var arguments
* @var QueuedProcessDefinitions::arguments
* command line arguments
* @var workingDirectory
* @var QueuedProcessDefinitions::workingDirectory
* path to working directory
* @var uid
* @var QueuedProcessDefinitions::uid
* UID of process
* @var gid
* @var QueuedProcessDefinitions::gid
* GID of process
* @var nice
* @var QueuedProcessDefinitions::nice
* nice level of process
* @var startTime
* @var QueuedProcessDefinitions::startTime
* process start time
* @var endTime
* @var QueuedProcessDefinitions::endTime
* process end time
* @var user
* @var QueuedProcessDefinitions::user
* task owner ID
* @var limits
* @var QueuedProcessDefinitions::limits
* task limits
*/
typedef struct {

View File

@ -28,6 +28,7 @@
#include <QHash>
#include <QObject>
#include "QueuedEnums.h"
#include "QueuedProcess.h"
@ -37,7 +38,7 @@
class QueuedProcessManager : public QObject
{
Q_OBJECT
Q_PROPERTY(OnExitAction onExit READ onExit WRITE setOnExitAction)
Q_PROPERTY(QueuedEnums::ExitAction onExit READ onExit WRITE setExitAction)
Q_PROPERTY(QString processLine READ processLine WRITE setProcessLine)
public:
@ -52,15 +53,6 @@ public:
*/
typedef QHash<long long, QMetaObject::Connection>
QueuedProcessConnectionMap;
/**
* @enum OnExitAction
* @brief action with child process on destruction
* @var OnExitAction::Terminate
* send SIGTERM on exit
* @var OnExitAction::Kill
* send SIGKILL on exit
*/
enum class OnExitAction { Terminate = 1 << 1, Kill = 1 << 2 };
/**
* @brief QueuedProcessManager class constructor
@ -72,7 +64,7 @@ public:
* default action on exit
*/
explicit QueuedProcessManager(QObject *parent, const QString &processLine,
const OnExitAction onExit);
const QueuedEnums::ExitAction onExit);
/**
* @brief QueuedProcessManager class destructor
*/
@ -142,7 +134,7 @@ public:
* @brief default action on exit
* @return default action from possible ones
*/
OnExitAction onExit() const;
QueuedEnums::ExitAction onExit() const;
/**
* @brief process command line
* @return current command line
@ -153,10 +145,10 @@ public:
* @param _action
* new on exit action
*/
void setOnExitAction(const OnExitAction _action);
void setExitAction(const QueuedEnums::ExitAction _action);
/**
* @brief set command line
* @param _commandLine
* @param _processLine
* new command line
*/
void setProcessLine(const QString _processLine);
@ -206,7 +198,7 @@ private:
/**
* @brief action on exit
*/
OnExitAction m_onExit = OnExitAction::Terminate;
QueuedEnums::ExitAction m_onExit = QueuedEnums::ExitAction::Terminate;
/**
* @brief processes list
*/

View File

@ -26,19 +26,17 @@
/**
* @defgroup QueuedSystemInfo
* @addtogroup QueuedSystemInfo
* @brief system information methods
*/
namespace QueuedSystemInfo
{
/**
* @ingroup QueuedSystemInfo
* @brief system CPU count
* @return system CPU count
*/
long long cpuCount();
/**
* @ingroup QueuedSystemInfo
* @brief weight of specified CPU count
* @param _cpu
* CPU count to get weight
@ -46,13 +44,11 @@ long long cpuCount();
*/
double cpuWeight(const long long _cpu);
/**
* @ingroup QueuedSystemInfo
* @brief system memory count
* @return system memory count in bytes
*/
long long memoryCount();
/**
* @ingroup QueuedSystemInfo
* @brief weight of specified memory count
* @param _memory
* memory in bytes to get weight

View File

@ -39,11 +39,11 @@ public:
/**
* @struct QueuedTokenDefinitions
* @brief structure to define token
* @var token
* @var QueuedTokenDefinitions::token
* token ID
* @var user
* @var QueuedTokenDefinitions::user
* token owner user
* @var validUntil
* @var QueuedTokenDefinitions::validUntil
* valid until
*/
typedef struct {
@ -78,7 +78,7 @@ public:
loadToken(const QueuedTokenManager::QueuedTokenDefinitions &_definitions);
/**
* @brief upload tokens from database
* @param _value
* @param _values
* tokens from database
*/
void loadTokens(const QList<QVariantHash> &_values);

View File

@ -194,7 +194,7 @@ public:
// permissions
/**
* @brief set limits
* @param _limit
* @param _limits
* new user limits
*/
void setLimits(const QString &_limits);

View File

@ -543,8 +543,8 @@ void QueuedCore::updateSettings(const QueuedCfg::QueuedSettings _id,
m_databaseManager->setKeepUsers(_value.toLongLong());
break;
case QueuedCfg::QueuedSettings::OnExitAction:
m_processes->setOnExitAction(
static_cast<QueuedProcessManager::OnExitAction>(_value.toInt()));
m_processes->setExitAction(
static_cast<QueuedEnums::ExitAction>(_value.toInt()));
break;
case QueuedCfg::QueuedSettings::Plugins:
// do nothing here
@ -672,7 +672,7 @@ void QueuedCore::initPlugins()
void QueuedCore::initProcesses()
{
// init processes
auto onExitAction = static_cast<QueuedProcessManager::OnExitAction>(
auto onExitAction = static_cast<QueuedEnums::ExitAction>(
m_advancedSettings->get(QueuedCfg::QueuedSettings::OnExitAction)
.toInt());
auto processLine
@ -787,15 +787,14 @@ bool QueuedCore::addTaskPrivate(const QString &_command,
QueuedLimits::Limits(
m_advancedSettings->get(QueuedCfg::QueuedSettings::DefaultLimits)
.toString()));
QVariantHash properties
= {{"user", _userId},
{"command", _command},
{"commandArguments", _arguments},
{"workDirectory", _workingDirectory},
{"nice", _nice},
{"uid", ids.first},
{"gid", ids.second},
{"limits", taskLimits.toString()}};
QVariantHash properties = {{"user", _userId},
{"command", _command},
{"commandArguments", _arguments},
{"workDirectory", _workingDirectory},
{"nice", _nice},
{"uid", ids.first},
{"gid", ids.second},
{"limits", taskLimits.toString()}};
auto id = m_database->add(QueuedDB::TASKS_TABLE, properties);
if (id == -1) {
qCWarning(LOG_LIB) << "Could not add task" << _command;

View File

@ -30,15 +30,15 @@
*/
QueuedProcessManager::QueuedProcessManager(QObject *parent,
const QString &processLine,
const OnExitAction onExit)
const QueuedEnums::ExitAction onExit)
: QObject(parent)
{
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
qRegisterMetaType<QueuedProcessManager::OnExitAction>(
"QueuedProcessManager::OnExitAction");
qRegisterMetaType<QueuedEnums::ExitAction>(
"QueuedEnums::ExitAction");
setOnExitAction(onExit);
setExitAction(onExit);
setProcessLine(processLine);
}
@ -164,10 +164,10 @@ void QueuedProcessManager::remove(const long long _index)
disconnect(connection);
switch (onExit()) {
case OnExitAction::Kill:
case QueuedEnums::ExitAction::Kill:
pr->kill();
break;
case OnExitAction::Terminate:
case QueuedEnums::ExitAction::Terminate:
pr->terminate();
break;
}
@ -252,10 +252,10 @@ void QueuedProcessManager::stop(const long long _index)
}
switch (onExit()) {
case OnExitAction::Kill:
case QueuedEnums::ExitAction::Kill:
pr->kill();
break;
case OnExitAction::Terminate:
case QueuedEnums::ExitAction::Terminate:
pr->terminate();
break;
}
@ -265,7 +265,7 @@ void QueuedProcessManager::stop(const long long _index)
/**
* @fn onExit
*/
QueuedProcessManager::OnExitAction QueuedProcessManager::onExit() const
QueuedEnums::ExitAction QueuedProcessManager::onExit() const
{
return m_onExit;
}
@ -281,9 +281,9 @@ QString QueuedProcessManager::processLine() const
/**
* @fn setOnExitAction
* @fn setExitAction
*/
void QueuedProcessManager::setOnExitAction(const OnExitAction _action)
void QueuedProcessManager::setExitAction(const QueuedEnums::ExitAction _action)
{
qCDebug(LOG_LIB) << "New action on exit" << static_cast<int>(_action);