Skip to content
Snippets Groups Projects
Commit eb1c40d9 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixing documentation.

parent dc2a6741
No related branches found
No related tags found
1 merge request!15Nina
...@@ -18,6 +18,11 @@ add_subdirectory( flow-vl ) ...@@ -18,6 +18,11 @@ add_subdirectory( flow-vl )
#add_subdirectory( fast-sweeping-map ) #add_subdirectory( fast-sweeping-map )
#add_subdirectory( narrow-band ) #add_subdirectory( narrow-band )
ADD_EXECUTABLE( FileExample FileExample.cpp )
target_link_libraries( FileExample tnl )
ADD_EXECUTABLE( StringExample StringExample.cpp ) ADD_EXECUTABLE( StringExample StringExample.cpp )
target_link_libraries( StringExample tnl ) target_link_libraries( StringExample tnl )
\ No newline at end of file
ADD_EXECUTABLE( TimerExample TimerExample.cpp )
target_link_libraries( TimerExample tnl )
\ No newline at end of file
...@@ -37,7 +37,7 @@ enum class IOMode ...@@ -37,7 +37,7 @@ enum class IOMode
const size_t FileGPUvsCPUTransferBufferSize = 5 * 2<<20; 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 /// \par Example
/// \include FileExample.cpp /// \include FileExample.cpp
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
namespace TNL { namespace TNL {
/// Vytvari tabulku s logem vypoctu
class Logger class Logger
{ {
public: public:
...@@ -22,41 +23,43 @@ class Logger ...@@ -22,41 +23,43 @@ class Logger
///// /////
/// \brief Basic constructor. /// \brief Basic constructor.
/// ///
/// \param _width Integer that defines the width of logger. /// \param _width Integer that defines the width of the log.
/// \param _stream Where to create the logger, e.g. cout or a certain files. /// \param _stream Defines output stream where the log will be printed out.
Logger( int _width, Logger( int _width,
std::ostream& _stream ); 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 ); void writeHeader( const String& title );
/// \brief Creates predefined separator - structure in the logger. /// \brief Creates separator for structuring the log.
void writeSeparator(); 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 ); 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 ); void writeCurrentTime( const char* label );
// TODO: add units // TODO: add units
template< typename T > template< typename ParameterType >
void writeParameter( const String& label, void writeParameter( const String& label,
const String& parameterName, const String& parameterName,
const Config::ParameterContainer& parameters, const Config::ParameterContainer& parameters,
int parameterLevel = 0 ); int parameterLevel = 0 );
template< typename T > template< typename ParameterType >
void writeParameter( const String& label, void writeParameter( const String& label,
const T& value, const ParameterType& value,
int parameterLevel = 0 ); int parameterLevel = 0 );
protected: protected:
......
...@@ -15,27 +15,27 @@ ...@@ -15,27 +15,27 @@
namespace TNL { namespace TNL {
template< typename T > template< typename ParameterType >
void Logger::writeParameter( const String& label, void Logger::writeParameter( const String& label,
const String& parameterName, const String& parameterName,
const Config::ParameterContainer& parameters, const Config::ParameterContainer& parameters,
int parameterLevel ) int parameterLevel )
{ {
stream << "| "; stream << "| ";
int i; int i;
for( i = 0; i < parameterLevel; i ++ ) for( i = 0; i < parameterLevel; i ++ )
stream << " "; stream << " ";
std::stringstream str; std::stringstream str;
str << parameters.getParameter< T >( parameterName ); str << parameters.getParameter< ParameterType >( parameterName );
stream << label stream << label
<< std::setw( width - label.getLength() - parameterLevel - 3 ) << std::setw( width - label.getLength() - parameterLevel - 3 )
<< str.str() << " |" << std::endl; << str.str() << " |" << std::endl;
} }
template< typename T > template< typename ParameterType >
void Logger :: writeParameter( const String& label, void Logger :: writeParameter( const String& label,
const T& value, const ParameterType& value,
int parameterLevel ) int parameterLevel )
{ {
stream << "| "; stream << "| ";
int i; int i;
......
...@@ -54,7 +54,7 @@ class Timer ...@@ -54,7 +54,7 @@ class Timer
void start(); 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. /// It returns the elapsed time between calling the start() and stop() functions.
/// Starts counting the real time after the function start() is called and /// Starts counting the real time after the function start() is called and
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment