From eb1c40d95428174a8ea8fcd075c933aecc76c67b Mon Sep 17 00:00:00 2001 From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz> Date: Tue, 20 Nov 2018 13:18:55 +0100 Subject: [PATCH] Fixing documentation. --- src/Examples/CMakeLists.txt | 7 ++++++- src/TNL/File.h | 2 +- src/TNL/Logger.h | 27 +++++++++++++++------------ src/TNL/Logger_impl.h | 16 ++++++++-------- src/TNL/Timer.h | 2 +- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/Examples/CMakeLists.txt b/src/Examples/CMakeLists.txt index 3050205871..b8e7c574a5 100644 --- a/src/Examples/CMakeLists.txt +++ b/src/Examples/CMakeLists.txt @@ -18,6 +18,11 @@ add_subdirectory( flow-vl ) #add_subdirectory( fast-sweeping-map ) #add_subdirectory( narrow-band ) +ADD_EXECUTABLE( FileExample FileExample.cpp ) +target_link_libraries( FileExample tnl ) ADD_EXECUTABLE( StringExample StringExample.cpp ) -target_link_libraries( StringExample tnl ) \ No newline at end of file +target_link_libraries( StringExample tnl ) + +ADD_EXECUTABLE( TimerExample TimerExample.cpp ) +target_link_libraries( TimerExample tnl ) \ No newline at end of file diff --git a/src/TNL/File.h b/src/TNL/File.h index c6f55ff762..bb31cdcd27 100644 --- a/src/TNL/File.h +++ b/src/TNL/File.h @@ -37,7 +37,7 @@ enum class IOMode const size_t FileGPUvsCPUTransferBufferSize = 5 * 2<<20; -/// Class file is aimed mainly for the binary data. +///\brief Class file is aimed mainly for the binary data. /// /// \par Example /// \include FileExample.cpp diff --git a/src/TNL/Logger.h b/src/TNL/Logger.h index 10ecf800c2..bddcfeeebe 100644 --- a/src/TNL/Logger.h +++ b/src/TNL/Logger.h @@ -15,6 +15,7 @@ namespace TNL { +/// Vytvari tabulku s logem vypoctu class Logger { public: @@ -22,41 +23,43 @@ class Logger ///// /// \brief Basic constructor. /// - /// \param _width Integer that defines the width of logger. - /// \param _stream Where to create the logger, e.g. cout or a certain files. + /// \param _width Integer that defines the width of the log. + /// \param _stream Defines output stream where the log will be printed out. Logger( int _width, std::ostream& _stream ); ///// - /// \brief Creates header in given logger. + /// \brief Creates header in given log. + /// + /// The header usually contains title of the program. /// - /// \param title String desribing the title/header. + /// \param title String containing the header title. void writeHeader( const String& title ); - /// \brief Creates predefined separator - structure in the logger. + /// \brief Creates separator for structuring the log. void writeSeparator(); - /// \brief Inserts information about various system parameters into logger. + /// \brief Inserts information about various system parameters into the log. /// - /// \param parameters + /// \param parameters is a container with configuration parameters bool writeSystemInformation( const Config::ParameterContainer& parameters ); ///// - /// \brief Inserts a line with current time into logger. + /// \brief Inserts a line with current time into the log. /// - /// \param label Description of the current time line. + /// \param label Label to be printed to the log together with the current time. void writeCurrentTime( const char* label ); // TODO: add units - template< typename T > + template< typename ParameterType > void writeParameter( const String& label, const String& parameterName, const Config::ParameterContainer& parameters, int parameterLevel = 0 ); - template< typename T > + template< typename ParameterType > void writeParameter( const String& label, - const T& value, + const ParameterType& value, int parameterLevel = 0 ); protected: diff --git a/src/TNL/Logger_impl.h b/src/TNL/Logger_impl.h index c633b1743f..08181070f4 100644 --- a/src/TNL/Logger_impl.h +++ b/src/TNL/Logger_impl.h @@ -15,27 +15,27 @@ namespace TNL { -template< typename T > +template< typename ParameterType > void Logger::writeParameter( const String& label, - const String& parameterName, - const Config::ParameterContainer& parameters, - int parameterLevel ) + const String& parameterName, + const Config::ParameterContainer& parameters, + int parameterLevel ) { stream << "| "; int i; for( i = 0; i < parameterLevel; i ++ ) stream << " "; std::stringstream str; - str << parameters.getParameter< T >( parameterName ); + str << parameters.getParameter< ParameterType >( parameterName ); stream << label << std::setw( width - label.getLength() - parameterLevel - 3 ) << str.str() << " |" << std::endl; } -template< typename T > +template< typename ParameterType > void Logger :: writeParameter( const String& label, - const T& value, - int parameterLevel ) + const ParameterType& value, + int parameterLevel ) { stream << "| "; int i; diff --git a/src/TNL/Timer.h b/src/TNL/Timer.h index 1ccc275378..f347c45102 100644 --- a/src/TNL/Timer.h +++ b/src/TNL/Timer.h @@ -54,7 +54,7 @@ class Timer void start(); ///// - /// \brief Returs the elapsed time on given timer. + /// \brief Returns the elapsed time on given timer. /// /// It returns the elapsed time between calling the start() and stop() functions. /// Starts counting the real time after the function start() is called and -- GitLab