From 18011d79d783f13e5fbd5925c8c5a80fee3f8877 Mon Sep 17 00:00:00 2001 From: Nina Dzugasova <dzugasova.nina@gmail.com> Date: Tue, 4 Dec 2018 13:01:17 +0100 Subject: [PATCH] Added ConfigDescription documenattion. --- src/Examples/TimerExample.cpp | 2 ++ src/TNL/Assert.h | 1 + src/TNL/Config/ConfigDescription.h | 40 +++++++++++++++++++++++++++--- src/TNL/Timer.h | 2 +- 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/Examples/TimerExample.cpp b/src/Examples/TimerExample.cpp index 49bafb25c5..aa40367341 100644 --- a/src/Examples/TimerExample.cpp +++ b/src/Examples/TimerExample.cpp @@ -16,5 +16,7 @@ int main() time.reset(); cout << "after reset:" << time.getRealTime() << endl; // writeLog example + Logger log1(50,stream); + writeLog( log1, 0 ); } diff --git a/src/TNL/Assert.h b/src/TNL/Assert.h index dabd69a973..d601f9c1b9 100644 --- a/src/TNL/Assert.h +++ b/src/TNL/Assert.h @@ -103,6 +103,7 @@ * The assertion succeeds if, and only if, ___tnl__assert_condition is valid. * On success the test continues without any side effects. * On failure the test is terminated with the error message \e ___tnl__assert_command. + */ #define TNL_ASSERT( ___tnl__assert_condition, ___tnl__assert_command ) #else /* #ifdef NDEBUG */ diff --git a/src/TNL/Config/ConfigDescription.h b/src/TNL/Config/ConfigDescription.h index d193869580..833e99a47a 100644 --- a/src/TNL/Config/ConfigDescription.h +++ b/src/TNL/Config/ConfigDescription.h @@ -48,7 +48,7 @@ class ConfigDescription } /** - * \brief Adds new entry to the configuration description. + * \brief Adds new entry to the configuration description, that requires set value. * * \tparam EntryType Type of the entry. * \param name Name of the entry. @@ -98,7 +98,7 @@ class ConfigDescription } /** - * \brief Adds new list to the configuration description. + * \brief Adds new list to the configuration description, that requires specific value. * * \tparam EntryType Type of the list. * \param name Name of the list. @@ -132,6 +132,13 @@ class ConfigDescription entries. Append( currentEntry ); } + /** + * \brief Adds new entry enumeration of type \e EntryType. + * + * Adds new option of setting an entry value. + * \tparam EntryType Type of the entry enumeration. + * \param entryEnum Value of the entry enumeration. + */ template< typename EntryType > void addEntryEnum( const EntryType& entryEnum ) { @@ -139,18 +146,34 @@ class ConfigDescription ( ( ConfigEntry< EntryType >* ) currentEntry )->getEnumValues().Append( entryEnum ); } + /** + * \brief Adds new entry enumeration of type \e char. + * + * Adds new option of setting an entry value. + * \param entryEnum Value of the entry enumeration. + */ void addEntryEnum( const char* entryEnum ) { TNL_ASSERT( this->currentEntry,); ( ( ConfigEntry< String >* ) currentEntry )->getEnumValues().Append( String( entryEnum ) ); } + /** + * \brief Adds delimeter/section to the configuration description. + * + * \param delimeter String that defines how the delimeter looks like. + */ void addDelimiter( const String& delimiter ) { entries.Append( new ConfigDelimiter( delimiter ) ); currentEntry = 0; } + /** + * \brief Gets entry out of the configuration description. + * + * \param name Name of the entry. + */ const ConfigEntryBase* getEntry( const String& name ) const { for( int i = 0; i < entries.getSize(); i++ ) @@ -195,7 +218,13 @@ class ConfigDescription return NULL; } - //! If there is missing entry with defined default value in the Config::ParameterContainer it is going to be added + /** + * \brief Fills in the parameters from the \e parameter_container. + * + * Parameters which were not defined in the command line by user but have their default value are added to the congiguration description. + * If there is missing entry with defined default value in the Config::ParameterContainer it is going to be added. + * \param parameter_container Name of the ParameterContainer object. + */ void addMissingEntries( Config::ParameterContainer& parameter_container ) const; //! Check for all entries with the flag 'required'. @@ -205,6 +234,11 @@ class ConfigDescription bool printUsage, const char* programName ) const; + /** + * \brief Prints configuration description with the \e program_name at the top. + * + * \param program_name Name of the program + */ void printUsage( const char* program_name ) const; //bool parseConfigDescription( const char* file_name ); diff --git a/src/TNL/Timer.h b/src/TNL/Timer.h index bcbeaca28d..a2e01ea8ee 100644 --- a/src/TNL/Timer.h +++ b/src/TNL/Timer.h @@ -85,7 +85,7 @@ class Timer /// \brief Writes a record into the \e logger. /// - /// \param logger + /// \param logger Name of Logger object. /// \param logLevel A non-negative integer recording the log record indent. bool writeLog( Logger& logger, int logLevel = 0 ) const; -- GitLab