Skip to content
Snippets Groups Projects
Commit e1419da5 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Move definition from bin.cc to bin.hh

parent f5120e52
No related branches found
No related tags found
No related merge requests found
...@@ -56,7 +56,10 @@ namespace hpp { ...@@ -56,7 +56,10 @@ namespace hpp {
} }
/// Print the bin. /// Print the bin.
virtual std::ostream& print (std::ostream& os) const; virtual std::ostream& print (std::ostream& os) const
{
return printValue (os << freq () << " - ");
}
/// Print the inner value of the bin. /// Print the inner value of the bin.
virtual std::ostream& printValue (std::ostream& os) const = 0; virtual std::ostream& printValue (std::ostream& os) const = 0;
...@@ -70,7 +73,10 @@ namespace hpp { ...@@ -70,7 +73,10 @@ namespace hpp {
size_t freq_; size_t freq_;
}; };
std::ostream& operator<< (std::ostream& os, const hpp::statistics::Bin& b); inline std::ostream& operator<< (std::ostream& os, const hpp::statistics::Bin& b)
{
return b.print (os);
}
/// Template class to do statistics. /// Template class to do statistics.
/// You should derivate class Bin and construct a class /// You should derivate class Bin and construct a class
......
// Copyright (c) 2014, LAAS-CNRS
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
//
// This file is part of hpp-statistics.
// hpp-statistics is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// hpp-statistics is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// hpp-statistics. If not, see <http://www.gnu.org/licenses/>.
#include "hpp/statistics/bin.hh"
namespace hpp {
namespace statistics {
std::ostream& Bin::print (std::ostream& os) const
{
return printValue (os << freq () << " - ");
}
std::ostream& operator<< (std::ostream& os, const hpp::statistics::Bin& b)
{
return b.print (os);
}
} // namespace statistics
} // namespace hpp
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