From 2916ec7b366eebb906ba26be00bfce1515d5e632 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 9 Apr 2015 19:02:22 -0400 Subject: [PATCH] Update documentation for functionality change. --- src/mlpack/core/util/prefixedoutstream.hpp | 18 ++++++++++-------- .../core/util/prefixedoutstream_impl.hpp | 8 ++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/mlpack/core/util/prefixedoutstream.hpp b/src/mlpack/core/util/prefixedoutstream.hpp index 49a6f53be8..9f50bf9a8d 100644 --- a/src/mlpack/core/util/prefixedoutstream.hpp +++ b/src/mlpack/core/util/prefixedoutstream.hpp @@ -56,8 +56,9 @@ class PrefixedOutStream * * @param destination ostream which receives output from this object. * @param prefix The prefix to prepend to each line. - * @param ignoreInput if true the stream will not be printed - * @param fatal is true program will exit after printing a line + * @param ignoreInput If true, the stream will not be printed. + * @param fatal If true, a std::runtime_error exception is thrown after + * printing a newline. */ PrefixedOutStream(std::ostream& destination, const char* prefix, @@ -120,14 +121,14 @@ class PrefixedOutStream private: HAS_MEM_FUNC(ToString, HasToString) - //! This handles forwarding all primitive types transparently + //! This handles forwarding all primitive types transparently. template void CallBaseLogic(const T& s, typename boost::disable_if< boost::is_class >::type* = 0); - //! Forward all objects that do not implement a ToString() method + //! Forward all objects that do not implement a ToString() method. template void CallBaseLogic(const T& s, typename boost::enable_if< @@ -137,7 +138,8 @@ class PrefixedOutStream HasToString >::type* = 0); - //! Call ToString() on all objects that implement ToString() before forwarding + //! Call ToString() on all objects that implement ToString() before + //! forwarding. template void CallBaseLogic(const T& s, typename boost::enable_if< @@ -148,8 +150,8 @@ class PrefixedOutStream >::type* = 0); /** - * @brief Conducts the base logic required in all the operator << overloads. - * Mostly just a good idea to reduce copy-pasta. + * Conducts the base logic required in all the operator << overloads. Mostly + * just a good idea to reduce copy-pasta. * * @tparam T The type of the data to output. * @param val The The data to be output. @@ -169,7 +171,7 @@ class PrefixedOutStream //! will be necessary. bool carriageReturned; - //! If true, the application will terminate with an error code when a CR is + //! If true, a std::runtime_error exception will be thrown when a CR is //! encountered. bool fatal; }; diff --git a/src/mlpack/core/util/prefixedoutstream_impl.hpp b/src/mlpack/core/util/prefixedoutstream_impl.hpp index e90d766a25..855caa2077 100644 --- a/src/mlpack/core/util/prefixedoutstream_impl.hpp +++ b/src/mlpack/core/util/prefixedoutstream_impl.hpp @@ -22,7 +22,7 @@ PrefixedOutStream& PrefixedOutStream::operator<<(const T& s) return *this; } -//! This handles forwarding all primitive types transparently +//! This handles forwarding all primitive types transparently. template void PrefixedOutStream::CallBaseLogic(const T& s, typename boost::disable_if< @@ -32,7 +32,7 @@ void PrefixedOutStream::CallBaseLogic(const T& s, BaseLogic(s); } -// Forward all objects that do not implement a ToString() method transparently +// Forward all objects that do not implement a ToString() method transparently. template void PrefixedOutStream::CallBaseLogic(const T& s, typename boost::enable_if< @@ -45,7 +45,7 @@ void PrefixedOutStream::CallBaseLogic(const T& s, BaseLogic(s); } -// Call ToString() on all objects that implement ToString() before forwarding +// Call ToString() on all objects that implement ToString() before forwarding. template void PrefixedOutStream::CallBaseLogic(const T& s, typename boost::enable_if< @@ -128,7 +128,7 @@ void PrefixedOutStream::BaseLogic(const T& val) } } - // If we displayed a newline and we need to terminate afterwards, do that. + // If we displayed a newline and we need to throw afterwards, do that. if (fatal && newlined) throw std::runtime_error("fatal error; see Log::Fatal output"); }