
https://svn.lrde.epita.fr/svn/ranch/trunk Index: ChangeLog from Nicolas Desprès <nicolas.despres@lrde.epita.fr> Move ranch-cxx into src. * lib/cxx/src: New. * lib/cxx/ranch-cxx/inputs.hh:, * lib/cxx/ranch-cxx/outputs.hh:, * lib/cxx/ranch-cxx/inputs.hxx:, * lib/cxx/ranch-cxx/ranch.hh:, * lib/cxx/ranch-cxx/outputs.hxx:, * lib/cxx/ranch-cxx/bencher.cc:, * lib/cxx/ranch-cxx/misc:, * lib/cxx/ranch-cxx/misc/yamlize.hxx:, * lib/cxx/ranch-cxx/misc/yamlize.hh:, * lib/cxx/ranch-cxx/misc/Makefile.am:, * lib/cxx/ranch-cxx/misc/yamlize.cc:, * lib/cxx/ranch-cxx/dumper:, * lib/cxx/ranch-cxx/dumper/dumper.cc:, * lib/cxx/ranch-cxx/dumper/yaml.hh:, * lib/cxx/ranch-cxx/dumper/libdumper.hh:, * lib/cxx/ranch-cxx/dumper/yaml.cc:, * lib/cxx/ranch-cxx/dumper/all.hh:, * lib/cxx/ranch-cxx/dumper/libdumper.cc:, * lib/cxx/ranch-cxx/dumper/Makefile.am:, * lib/cxx/ranch-cxx/dumper/dumper.hh:, * lib/cxx/ranch-cxx/dumper/fwd.hh:, * lib/cxx/ranch-cxx/input:, * lib/cxx/ranch-cxx/input/input.cc:, * lib/cxx/ranch-cxx/input/input.hxx:, * lib/cxx/ranch-cxx/input/Makefile.am:, * lib/cxx/ranch-cxx/input/input.hh:, * lib/cxx/ranch-cxx/output:, * lib/cxx/ranch-cxx/output/output.cc:, * lib/cxx/ranch-cxx/output/u-time.cc:, * lib/cxx/ranch-cxx/output/output.hxx:, * lib/cxx/ranch-cxx/output/all.hh:, * lib/cxx/ranch-cxx/output/u-time.hxx:, * lib/cxx/ranch-cxx/output/Makefile.am:, * lib/cxx/ranch-cxx/output/output.hh:, * lib/cxx/ranch-cxx/output/u-time.hh:, * lib/cxx/ranch-cxx/ranch.mk:, * lib/cxx/ranch-cxx/bencher.hh:, * lib/cxx/ranch-cxx/io.hh:, * lib/cxx/ranch-cxx/Makefile.am:, * lib/cxx/ranch-cxx/bencher.hxx:, * lib/cxx/ranch-cxx/io.hxx:, * lib/cxx/ranch-cxx: Move to ... * lib/cxx/src/ranch-cxx: ... here. Makefile.am | 32 ---------------- bencher.cc | 103 ---------------------------------------------------- bencher.hh | 66 --------------------------------- bencher.hxx | 45 ---------------------- dumper/Makefile.am | 19 --------- dumper/all.hh | 8 ---- dumper/dumper.cc | 14 ------- dumper/dumper.hh | 31 --------------- dumper/fwd.hh | 16 -------- dumper/libdumper.cc | 16 -------- dumper/libdumper.hh | 16 -------- dumper/yaml.cc | 94 ----------------------------------------------- dumper/yaml.hh | 34 ----------------- input/Makefile.am | 11 ----- input/input.cc | 13 ------ input/input.hh | 29 -------------- input/input.hxx | 21 ---------- inputs.hh | 38 ------------------- inputs.hxx | 39 ------------------- io.hh | 37 ------------------ io.hxx | 50 ------------------------- misc/Makefile.am | 12 ------ misc/yamlize.cc | 26 ------------- misc/yamlize.hh | 32 ---------------- misc/yamlize.hxx | 21 ---------- output/Makefile.am | 20 ---------- output/all.hh | 8 ---- output/output.cc | 23 ----------- output/output.hh | 35 ----------------- output/output.hxx | 27 ------------- output/u-time.cc | 34 ----------------- output/u-time.hh | 34 ----------------- output/u-time.hxx | 20 ---------- outputs.hh | 37 ------------------ outputs.hxx | 38 ------------------- ranch.hh | 10 ----- ranch.mk | 2 - 37 files changed, 1111 deletions(-) Index: lib/cxx/ranch-cxx/inputs.hh --- lib/cxx/ranch-cxx/inputs.hh (revision 28) +++ lib/cxx/ranch-cxx/inputs.hh (working copy) @@ -1,38 +0,0 @@ - - -#ifndef RANCH_INPUTS_HH -# define RANCH_INPUTS_HH - -# include <list> -# include <input/input.hh> - -namespace Ranch -{ - class Inputs - { - public: - Inputs& add(Input::Input& input); - - typedef std::list<Input::Input*> list_type; - - typedef list_type::const_iterator const_iterator; - - const_iterator begin() const; - const_iterator end() const; - - typedef list_type::iterator iterator; - - iterator begin(); - iterator end(); - - protected: - - list_type list_; - }; // class Inputs - -} // namespace Ranch - -# include <inputs.hxx> - -#endif // !RANCH_INPUTS_HH - Index: lib/cxx/ranch-cxx/outputs.hh --- lib/cxx/ranch-cxx/outputs.hh (revision 28) +++ lib/cxx/ranch-cxx/outputs.hh (working copy) @@ -1,37 +0,0 @@ - - -#ifndef RANCH_OUTPUTS_HH -# define RANCH_OUTPUTS_HH - -# include <list> -# include <output/output.hh> - -namespace Ranch -{ - class Outputs - { - public: - Outputs& add(Output::Output& output); - - typedef std::list<Output::Output*> list_type; - - typedef list_type::const_iterator const_iterator; - - const_iterator begin() const; - const_iterator end() const; - - typedef list_type::iterator iterator; - - iterator begin(); - iterator end(); - - protected: - list_type list_; - }; // class Outputs - -} // namespace Ranch - -# include <outputs.hxx> - -#endif // !RANCH_OUTPUTS_HH - Index: lib/cxx/ranch-cxx/inputs.hxx --- lib/cxx/ranch-cxx/inputs.hxx (revision 28) +++ lib/cxx/ranch-cxx/inputs.hxx (working copy) @@ -1,39 +0,0 @@ - -#ifndef RANCH_INPUTS_HXX -# define RANCH_INPUTS_HXX - -# include <inputs.hh> - -namespace Ranch -{ - - inline Inputs& Inputs::add(Input::Input& input) - { - list_.push_back(&input); - return *this; - } - - inline Inputs::const_iterator Inputs::begin() const - { - return list_.begin(); - } - - inline Inputs::const_iterator Inputs::end() const - { - return list_.end(); - } - - inline Inputs::iterator Inputs::begin() - { - return list_.begin(); - } - - inline Inputs::iterator Inputs::end() - { - return list_.end(); - } - - -} // namespace Ranch - -#endif // !RANCH_INPUTS_HXX Index: lib/cxx/ranch-cxx/ranch.hh --- lib/cxx/ranch-cxx/ranch.hh (revision 28) +++ lib/cxx/ranch-cxx/ranch.hh (working copy) @@ -1,10 +0,0 @@ - -#ifndef RANCH_HH -# define RANCH_HH - -# include <bencher.hh> -# include <input/input.hh> -# include <output/all.hh> -# include <dumper/all.hh> - -#endif // !RANCH_HH Index: lib/cxx/ranch-cxx/outputs.hxx --- lib/cxx/ranch-cxx/outputs.hxx (revision 28) +++ lib/cxx/ranch-cxx/outputs.hxx (working copy) @@ -1,38 +0,0 @@ - -#ifndef RANCH_OUTPUTS_HXX -# define RANCH_OUTPUTS_HXX - -# include <outputs.hh> - -namespace Ranch -{ - - inline Outputs& Outputs::add(Output::Output& output) - { - list_.push_back(&output); - return *this; - } - - inline Outputs::const_iterator Outputs::begin() const - { - return list_.begin(); - } - - inline Outputs::const_iterator Outputs::end() const - { - return list_.end(); - } - - inline Outputs::iterator Outputs::begin() - { - return list_.begin(); - } - - inline Outputs::iterator Outputs::end() - { - return list_.end(); - } - -} // namespace Ranch - -#endif // !RANCH_OUTPUTS_HXX Index: lib/cxx/ranch-cxx/bencher.cc --- lib/cxx/ranch-cxx/bencher.cc (revision 28) +++ lib/cxx/ranch-cxx/bencher.cc (working copy) @@ -1,103 +0,0 @@ -#include <bencher.hh> -#include <cstdarg> -#include <dumper/libdumper.hh> -#include <dumper/dumper.hh> - -namespace Ranch -{ - - Dumper::Dumper* Bencher::dumper_ = Dumper::yaml_stdout(); - - Dumper::Dumper& Bencher::dumper(Dumper::Dumper& dumper) - { - Dumper::Dumper* old_dumper = dumper_; - dumper_ = &dumper; - return *old_dumper; - } - - Dumper::Dumper& Bencher::dumper() - { - return *dumper_; - } - - Bencher::Bencher(const std::string& name, - Inputs& inputs, - Outputs& outputs, - const std::string& comment) : - name_(name), - inputs_(inputs), - outputs_(outputs), - comment_(comment), - first_start_call_(true) - { - } - - Bencher::Bencher(const std::string& name, const std::string& comment) : - name_(name), - inputs_(), - outputs_(), - comment_(comment), - first_start_call_(true) - { - } - - Bencher::~Bencher() - { - dumper_->end_bench(*this); - } - - void Bencher::start() - { - begin_bench_(); - dumper_->begin_score(*this); - start_outputs_(); - } - - void Bencher::start(double size_input_1, ...) - { - va_list ap; - - begin_bench_(); - Inputs::iterator i = inputs_.begin(); - (*i)->value(size_input_1); - - va_start(ap, size_input_1); - for (++i; i != inputs_.end(); ++i) - (*i)->value(va_arg(ap, double)); - va_end(ap); - dumper_->begin_score(*this); - start_outputs_(); - } - - void Bencher::stop(double score_output_1, ...) - { - va_list ap; - - Outputs::iterator i = outputs_.begin(); - (*i)->value(score_output_1); - - va_start(ap, score_output_1); - for (++i; i != outputs_.end(); ++i) - (*i)->value(va_arg(ap, double)); - va_end(ap); - dumper_->end_score(*this); - } - - void Bencher::start_outputs_() - { - for (Outputs::iterator i = outputs_.begin(); - i != outputs_.end(); - ++i) - (*i)->start(); - } - - void Bencher::begin_bench_() - { - if (first_start_call_) - { - first_start_call_ = false; - dumper_->begin_bench(*this); - } - } - -} // namespace Ranch Index: lib/cxx/ranch-cxx/misc/yamlize.hxx --- lib/cxx/ranch-cxx/misc/yamlize.hxx (revision 28) +++ lib/cxx/ranch-cxx/misc/yamlize.hxx (working copy) @@ -1,21 +0,0 @@ - -#ifndef RANCH_MISC_YAMLIZE_HXX -# define RANCH_MISC_YAMLIZE_HXX - -# include <misc/yamlize.hh> - -namespace Ranch -{ - namespace Misc - { - - inline std::ostream& operator<< (std::ostream& ostr, - const Yamlize& yamlize) - { - return yamlize.print(ostr); - } - - } // namespace Misc -} // namespace Ranch - -#endif // !RANCH_MISC_YAMLIZE_HXX Index: lib/cxx/ranch-cxx/misc/yamlize.hh --- lib/cxx/ranch-cxx/misc/yamlize.hh (revision 28) +++ lib/cxx/ranch-cxx/misc/yamlize.hh (working copy) @@ -1,32 +0,0 @@ - -#ifndef RANCH_MISC_YAMLIZE_HH -# define RANCH_MISC_YAMLIZE_HH - -# include <iosfwd> -# include <string> - -namespace Ranch -{ - namespace Misc - { - - class Yamlize - { - public: - Yamlize(const std::string& str); - - std::ostream& print(std::ostream& ostr) const; - - protected: - std::string str_; - - }; // class Yamlize - - std::ostream& operator<< (std::ostream& ostr, const Yamlize& yamlize); - - } // namespace Misc -} // namespace Ranch - -# include <misc/yamlize.hxx> - -#endif // !RANCH_MISC_YAMLIZE_HH Index: lib/cxx/ranch-cxx/misc/Makefile.am --- lib/cxx/ranch-cxx/misc/Makefile.am (revision 28) +++ lib/cxx/ranch-cxx/misc/Makefile.am (working copy) @@ -1,12 +0,0 @@ -include $(top_srcdir)/src/ranch.mk - -noinst_LTLIBRARIES = libmisc.la -libmisc_la_SOURCES = \ - yamlize.hh \ - yamlize.cc \ - yamlize.hxx -pkgincludedir = $(includedir)/$(PACKAGE)/misc -pkginclude_HEADERS = \ - yamlize.hh \ - yamlize.hxx - Index: lib/cxx/ranch-cxx/misc/yamlize.cc --- lib/cxx/ranch-cxx/misc/yamlize.cc (revision 28) +++ lib/cxx/ranch-cxx/misc/yamlize.cc (working copy) @@ -1,26 +0,0 @@ -#include "misc/yamlize.hh" -#include <ostream> - -namespace Ranch -{ - namespace Misc - { - - Yamlize::Yamlize(const std::string& str) : - str_(str) - { - } - - std::ostream& Yamlize::print(std::ostream& ostr) const - { - ostr << '\''; - for (std::string::const_iterator i = str_.begin(); i != str_.end(); ++i) - if (*i == '\'') - ostr << "''"; - else - ostr << *i; - return ostr << '\''; - } - - } // namespace Misc -} // namespace Ranch Index: lib/cxx/ranch-cxx/dumper/dumper.cc --- lib/cxx/ranch-cxx/dumper/dumper.cc (revision 28) +++ lib/cxx/ranch-cxx/dumper/dumper.cc (working copy) @@ -1,14 +0,0 @@ -#include "dumper/dumper.hh" - -namespace Ranch -{ - namespace Dumper - { - - Dumper::Dumper(std::ostream& ostr) : - ostr_(ostr) - { - } - - } // namespace Dumper -} // namespace Ranch Index: lib/cxx/ranch-cxx/dumper/yaml.hh --- lib/cxx/ranch-cxx/dumper/yaml.hh (revision 28) +++ lib/cxx/ranch-cxx/dumper/yaml.hh (working copy) @@ -1,34 +0,0 @@ - -#ifndef RANCH_YAML_HH -# define RANCH_YAML_HH - -# include <dumper/dumper.hh> - -namespace Ranch -{ - namespace Dumper - { - - class Yaml : public Dumper - { - public: - Yaml(std::ostream& ostr); - - virtual void begin_bench(const Bencher& bencher); - virtual void end_bench(const Bencher& bencher); - - virtual void begin_score(const Bencher& bencher); - virtual void end_score(const Bencher& bencher); - - protected: - void print_indent_(); - - protected: - unsigned int indent_; - }; // class Yaml - - } // namespace Dumper -} // namespace Ranch - -#endif // !RANCH_YAML_HH - Index: lib/cxx/ranch-cxx/dumper/libdumper.hh --- lib/cxx/ranch-cxx/dumper/libdumper.hh (revision 28) +++ lib/cxx/ranch-cxx/dumper/libdumper.hh (working copy) @@ -1,16 +0,0 @@ -#ifndef RANCH_LIBDUMPER_HH -# define RANCH_LIBDUMPER_HH - -# include "dumper/fwd.hh" - -namespace Ranch -{ - namespace Dumper - { - - Dumper* yaml_stdout(); - - } // namespace Dumper -} // namespace Ranch - -#endif // !RANCH_LIBDUMPER_HH Index: lib/cxx/ranch-cxx/dumper/yaml.cc --- lib/cxx/ranch-cxx/dumper/yaml.cc (revision 28) +++ lib/cxx/ranch-cxx/dumper/yaml.cc (working copy) @@ -1,94 +0,0 @@ -#include <dumper/yaml.hh> -#include <misc/yamlize.hh> - -namespace Ranch -{ - namespace Dumper - { - - Yaml::Yaml(std::ostream& ostr) : - Dumper(ostr), - indent_(0) - { - } - - void Yaml::print_indent_() - { - for (unsigned int i = 0; i < indent_; ++i) - ostr_ << " "; - } - - void Yaml::begin_bench(const Bencher& bencher) - { - print_indent_(); - ostr_ << "- " << Misc::Yamlize(bencher.name()) << ':' << std::endl; - print_indent_(); - ostr_ << " type:" << std::endl; - print_indent_(); - ostr_ << " inputs:" << std::endl; - for (Inputs::const_iterator i = bencher.inputs().begin(); - i != bencher.inputs().end(); - ++i) - { - print_indent_(); - ostr_ << " - " << Misc::Yamlize((*i)->name()) - << ": " << Misc::Yamlize((*i)->unit()) << std::endl; - } - print_indent_(); - ostr_ << " outputs:" << std::endl; - for (Outputs::const_iterator i = bencher.outputs().begin(); - i != bencher.outputs().end(); - ++i) - { - print_indent_(); - ostr_ << " - " << Misc::Yamlize((*i)->name()) - << ": " << Misc::Yamlize((*i)->unit()) << std::endl; - } - print_indent_(); - ostr_ << " comment: |" << std::endl; - print_indent_(); - ostr_ << " " << bencher.comment() << std::endl; - print_indent_(); - ostr_ << " content:" << std::endl; - indent_ += 3; - } - - void Yaml::end_bench(const Bencher&) - { - indent_ -= 3; - } - - void Yaml::begin_score(const Bencher& bencher) - { - print_indent_(); - ostr_ << "-" << std::endl; - print_indent_(); - ostr_ << " inputs:" << std::endl; - for (Inputs::const_iterator i = bencher.inputs().begin(); - i != bencher.inputs().end(); - ++i) - { - print_indent_(); - ostr_ << " - " << (*i)->value() << "\t# "<< **i << std::endl; - } - print_indent_(); - ostr_ << " benches:" << std::endl; - indent_ += 2; - } - - void Yaml::end_score(const Bencher& bencher) - { - indent_ -= 2; - print_indent_(); - ostr_ << " outputs:" << std::endl; - for (Outputs::const_iterator i = bencher.outputs().begin(); - i != bencher.outputs().end(); - ++i) - { - print_indent_(); - ostr_ << " - " << (*i)->value() << "\t# "<< **i << std::endl; - } - } - - } // namespace Dumper -} // namespace Ranch Index: lib/cxx/ranch-cxx/dumper/all.hh --- lib/cxx/ranch-cxx/dumper/all.hh (revision 28) +++ lib/cxx/ranch-cxx/dumper/all.hh (working copy) @@ -1,8 +0,0 @@ -#ifndef RANCH_DUMPER_ALL_HH -# define RANCH_DUMPER_ALL_HH - -# include <dumper/dumper.hh> -# include <dumper/yaml.hh> - -#endif // !RANCH_DUMPER_ALL_HH - Index: lib/cxx/ranch-cxx/dumper/libdumper.cc --- lib/cxx/ranch-cxx/dumper/libdumper.cc (revision 28) +++ lib/cxx/ranch-cxx/dumper/libdumper.cc (working copy) @@ -1,16 +0,0 @@ -#include <iostream> -#include "dumper/yaml.hh" - -namespace Ranch -{ - namespace Dumper - { - - Dumper* yaml_stdout() - { - static Yaml yaml_stdout(std::cout); - return &yaml_stdout; - } - - } // namespace Dumper -} // namespace Ranch Index: lib/cxx/ranch-cxx/dumper/Makefile.am --- lib/cxx/ranch-cxx/dumper/Makefile.am (revision 28) +++ lib/cxx/ranch-cxx/dumper/Makefile.am (working copy) @@ -1,19 +0,0 @@ -include $(top_srcdir)/src/ranch.mk - -noinst_LTLIBRARIES = libdumper.la -libdumper_la_SOURCES = \ - all.hh \ - fwd.hh \ - libdumper.hh \ - libdumper.cc \ - dumper.hh \ - dumper.cc \ - yaml.hh \ - yaml.cc -pkgincludedir = $(includedir)/$(PACKAGE)/dumper -pkginclude_HEADERS = \ - all.hh \ - fwd.hh \ - libdumper.hh \ - dumper.hh \ - yaml.hh Index: lib/cxx/ranch-cxx/dumper/dumper.hh --- lib/cxx/ranch-cxx/dumper/dumper.hh (revision 28) +++ lib/cxx/ranch-cxx/dumper/dumper.hh (working copy) @@ -1,31 +0,0 @@ - -#ifndef RANCH_DUMPER_HH -# define RANCH_DUMPER_HH - -# include <string> -# include <bencher.hh> - -namespace Ranch -{ - namespace Dumper - { - - class Dumper - { - public: - Dumper(std::ostream& ostr); - - virtual void begin_bench(const Bencher& bencher) = 0; - virtual void end_bench(const Bencher& bencher) = 0; - - virtual void begin_score(const Bencher& bencher) = 0; - virtual void end_score(const Bencher& bencher) = 0; - - protected: - std::ostream& ostr_; - }; // class Dumper - - } // namespace Dumper -} // namespace Ranch - -#endif // !RANCH_DUMPER_HH Index: lib/cxx/ranch-cxx/dumper/fwd.hh --- lib/cxx/ranch-cxx/dumper/fwd.hh (revision 28) +++ lib/cxx/ranch-cxx/dumper/fwd.hh (working copy) @@ -1,16 +0,0 @@ -#ifndef RANCH_DUMPER_FWD_HH -# define RANCH_DUMPER_FWD_HH - -namespace Ranch -{ - namespace Dumper - { - - class Dumper; - class Yaml; - - } // namespace Dumper -} // namespace Ranch - -#endif // !RANCH_DUMPER_FWD_HH - Index: lib/cxx/ranch-cxx/input/input.cc --- lib/cxx/ranch-cxx/input/input.cc (revision 28) +++ lib/cxx/ranch-cxx/input/input.cc (working copy) @@ -1,13 +0,0 @@ -#include <input/input.hh> - -namespace Ranch -{ - namespace Input - { - - } // namespace Input - -} // namespace Ranch - - - Index: lib/cxx/ranch-cxx/input/input.hxx --- lib/cxx/ranch-cxx/input/input.hxx (revision 28) +++ lib/cxx/ranch-cxx/input/input.hxx (working copy) @@ -1,21 +0,0 @@ - -#ifndef RANCH_INPUT_INPUT_HXX -# define RANCH_INPUT_INPUT_HXX - -# include <input/input.hh> -# include <ostream> - -namespace Ranch -{ - namespace Input - { - - inline Input::Input(const std::string& name, const std::string& unit) : - IO(name, unit) - { - } - - } // namespace Input -} // namespace Ranch - -#endif // !RANCH_INPUT_INPUT_HXX Index: lib/cxx/ranch-cxx/input/Makefile.am --- lib/cxx/ranch-cxx/input/Makefile.am (revision 28) +++ lib/cxx/ranch-cxx/input/Makefile.am (working copy) @@ -1,11 +0,0 @@ -include $(top_srcdir)/src/ranch.mk - -noinst_LTLIBRARIES = libinput.la -libinput_la_SOURCES = \ - input.hh \ - input.hxx \ - input.cc -pkgincludedir = $(includedir)/$(PACKAGE)/input -pkginclude_HEADERS = \ - input.hh \ - input.hxx Index: lib/cxx/ranch-cxx/input/input.hh --- lib/cxx/ranch-cxx/input/input.hh (revision 28) +++ lib/cxx/ranch-cxx/input/input.hh (working copy) @@ -1,29 +0,0 @@ - - -#ifndef RANCH_INPUT_INPUT_HH -# define RANCH_INPUT_INPUT_HH - -# include <string> -# include <iosfwd> -# include <io.hh> - -namespace Ranch -{ - namespace Input - { - - class Input : public IO - { - public: - Input(const std::string& name, const std::string& unit = ""); - - }; // class Input - - } // namespace Input - -} // namespace Ranch - -# include <input/input.hxx> - -#endif // !RANCH_INPUT_INPUT_HH - Index: lib/cxx/ranch-cxx/output/output.cc --- lib/cxx/ranch-cxx/output/output.cc (revision 28) +++ lib/cxx/ranch-cxx/output/output.cc (working copy) @@ -1,23 +0,0 @@ -#include <output/output.hh> - -namespace Ranch -{ - namespace Output - { - - Output::~Output() - { - } - - void Output::start() - { - } - - void Output::stop() - { - } - - } // namespace Output -} // namespace Ranch - - Index: lib/cxx/ranch-cxx/output/u-time.cc --- lib/cxx/ranch-cxx/output/u-time.cc (revision 28) +++ lib/cxx/ranch-cxx/output/u-time.cc (working copy) @@ -1,34 +0,0 @@ -#include <output/u-time.hh> -#include <sys/times.h> -#include <cstdio> -#include <cerrno> -#include <unistd.h> - -namespace Ranch -{ - namespace Output - { - - void UTime::start() - { - start_time_ = utime_(); - } - - void UTime::stop() - { - value_ = (utime_() - start_time_) * sysconf(_SC_CLK_TCK) * 1.0e-4; - } - - double UTime::utime_() - { - struct tms buf; - - if (times(&buf) == ((clock_t) - 1)) - perror("ranch: times"); - return (double)buf.tms_utime; - } - - } // namespace Output -} // namespace Ranch - - Index: lib/cxx/ranch-cxx/output/output.hxx --- lib/cxx/ranch-cxx/output/output.hxx (revision 28) +++ lib/cxx/ranch-cxx/output/output.hxx (working copy) @@ -1,27 +0,0 @@ - -#ifndef RANCH_OUTPUT_OUTPUT_HXX -# define RANCH_OUTPUT_OUTPUT_HXX - -# include <output/output.hh> -# include <ostream> - -namespace Ranch -{ - namespace Output - { - - inline Output::Output(const std::string& name, const std::string& unit) : - IO(name, unit) - { - } - - inline double Output::operator() () - { - stop(); - return value_; - } - - } // namespace Output -} // namespace Ranch - -#endif // !RANCH_OUTPUT_OUTPUT_HXX Index: lib/cxx/ranch-cxx/output/all.hh --- lib/cxx/ranch-cxx/output/all.hh (revision 28) +++ lib/cxx/ranch-cxx/output/all.hh (working copy) @@ -1,8 +0,0 @@ -#ifndef RANCH_OUTPUT_ALL_HH -# define RANCH_OUTPUT_ALL_HH - -# include "output/output.hh" -# include "output/u-time.hh" - -#endif // !RANCH_OUTPUT_ALL_HH - Index: lib/cxx/ranch-cxx/output/u-time.hxx --- lib/cxx/ranch-cxx/output/u-time.hxx (revision 28) +++ lib/cxx/ranch-cxx/output/u-time.hxx (working copy) @@ -1,20 +0,0 @@ - -#ifndef RANCH_OUTPUT_UTIME_HXX -# define RANCH_OUTPUT_UTIME_HXX - -# include <output/u-time.hh> - -namespace Ranch -{ - namespace Output - { - - inline UTime::UTime() : - Output("utime", "sec") - { - } - - } // namespace Output -} // namespace Ranch - -#endif // !RANCH_OUTPUT_UTIME_HXX Index: lib/cxx/ranch-cxx/output/Makefile.am --- lib/cxx/ranch-cxx/output/Makefile.am (revision 28) +++ lib/cxx/ranch-cxx/output/Makefile.am (working copy) @@ -1,20 +0,0 @@ -include $(top_srcdir)/src/ranch.mk - -noinst_LTLIBRARIES = liboutput.la -liboutput_la_SOURCES = \ - all.hh \ - output.hh \ - output.hxx \ - output.cc \ - u-time.hh \ - u-time.hxx \ - u-time.cc -pkgincludedir = $(includedir)/$(PACKAGE)/output -pkginclude_HEADERS = \ - all.hh \ - output.hh \ - output.hxx \ - u-time.hh \ - u-time.hxx - - Index: lib/cxx/ranch-cxx/output/output.hh --- lib/cxx/ranch-cxx/output/output.hh (revision 28) +++ lib/cxx/ranch-cxx/output/output.hh (working copy) @@ -1,35 +0,0 @@ - - -#ifndef RANCH_OUTPUT_OUTPUT_HH -# define RANCH_OUTPUT_OUTPUT_HH - -# include <string> -# include <iosfwd> -# include <io.hh> - -namespace Ranch -{ - namespace Output - { - - class Output : public IO - { - public: - Output(const std::string& name, const std::string& unit = ""); - virtual ~Output(); - - virtual void start(); - virtual void stop(); - - double operator() (); - - }; // class Output - - } // namespace Output - -} // namespace Ranch - -# include <output/output.hxx> - -#endif // !RANCH_OUTPUT_OUTPUT_HH - Index: lib/cxx/ranch-cxx/output/u-time.hh --- lib/cxx/ranch-cxx/output/u-time.hh (revision 28) +++ lib/cxx/ranch-cxx/output/u-time.hh (working copy) @@ -1,34 +0,0 @@ - - -#ifndef RANCH_OUTPUT_UTIME_HH -# define RANCH_OUTPUT_UTIME_HH - -# include <output/output.hh> - -namespace Ranch -{ - namespace Output - { - - class UTime : public Output - { - public: - UTime(); - - virtual void start(); - virtual void stop(); - - protected: - double utime_(); - - protected: - double start_time_; - }; // class UTime - - } // namespace Output -} // namespace Ranch - -# include <output/u-time.hxx> - -#endif // !RANCH_OUTPUT_UTIME_HH - Index: lib/cxx/ranch-cxx/ranch.mk --- lib/cxx/ranch-cxx/ranch.mk (revision 28) +++ lib/cxx/ranch-cxx/ranch.mk (working copy) @@ -1,2 +0,0 @@ - -AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src Index: lib/cxx/ranch-cxx/bencher.hh --- lib/cxx/ranch-cxx/bencher.hh (revision 28) +++ lib/cxx/ranch-cxx/bencher.hh (working copy) @@ -1,66 +0,0 @@ - -#ifndef RANCH_BENCH_HH -# define RANCH_BENCH_HH - -# include <string> -# include <inputs.hh> -# include <input/input.hh> -# include <outputs.hh> -# include <output/output.hh> -# include <dumper/fwd.hh> - -namespace Ranch -{ - - class Bencher - { - public: - - static Dumper::Dumper& dumper(Dumper::Dumper& dumper); - static Dumper::Dumper& dumper(); - - protected: - static Dumper::Dumper* dumper_; - - public: - - Bencher(const std::string& name, - Inputs& inputs, - Outputs& outputs, - const std::string& comment = ""); - Bencher(const std::string& name, const std::string& comment = ""); - ~Bencher(); - - // The va_args require at least one argument. So we declare one function - // for zero and another for 1 to N arguments. - void start(); - void start(double size_input_1, ...); - // There is always at least one output. - void stop(double score_output_1, ...); - - Bencher& add_input(Input::Input& input); - Bencher& add_output(Output::Output& output); - - const std::string& name() const; - const Inputs& inputs() const; - const Outputs& outputs() const; - const std::string& comment() const; - - protected: - void start_outputs_(); - void begin_bench_(); - - protected: - std::string name_; - Inputs inputs_; - Outputs outputs_; - std::string comment_; - bool first_start_call_; - - }; // class Bencher - -} // namespace Ranch - -# include <bencher.hxx> - -#endif // !RANCH_BENCH_HH Index: lib/cxx/ranch-cxx/io.hh --- lib/cxx/ranch-cxx/io.hh (revision 28) +++ lib/cxx/ranch-cxx/io.hh (working copy) @@ -1,37 +0,0 @@ - - -#ifndef RANCH_IO_HH -# define RANCH_IO_HH - -# include <string> -# include <iosfwd> -# include <list> - -namespace Ranch -{ - class IO - { - public: - IO(const std::string& name, const std::string& unit = ""); - - std::ostream& print(std::ostream& ostr) const; - - const std::string& name() const; - const std::string& unit() const; - double value() const; - void value(double value); - - protected: - std::string name_; - std::string unit_; - double value_; - }; // class IO - - std::ostream& operator<< (std::ostream& ostr, const IO& io); - -} // namespace Ranch - -# include <io.hxx> - -#endif // !RANCH_IO_HH - Index: lib/cxx/ranch-cxx/Makefile.am --- lib/cxx/ranch-cxx/Makefile.am (revision 28) +++ lib/cxx/ranch-cxx/Makefile.am (working copy) @@ -1,32 +0,0 @@ - -include $(top_srcdir)/src/ranch.mk - -SUBDIRS = input output dumper misc - -lib_LTLIBRARIES = libranch.la -pkginclude_HEADERS = \ - ranch.hh \ - bencher.hh \ - bencher.hxx \ - io.hh \ - io.hxx \ - inputs.hh \ - inputs.hxx \ - outputs.hh \ - outputs.hxx -libranch_la_SOURCES = \ - bencher.hh \ - bencher.hxx \ - bencher.cc \ - io.hh \ - io.hxx \ - inputs.hh \ - inputs.hxx \ - outputs.hh \ - outputs.hxx -libranch_la_LIBADD = \ - input/libinput.la \ - output/liboutput.la \ - dumper/libdumper.la \ - misc/libmisc.la - Index: lib/cxx/ranch-cxx/bencher.hxx --- lib/cxx/ranch-cxx/bencher.hxx (revision 28) +++ lib/cxx/ranch-cxx/bencher.hxx (working copy) @@ -1,45 +0,0 @@ - -#ifndef RANCH_BENCHER_HXX -# define RANCH_BENCHER_HXX - -# include <bencher.hh> - -namespace Ranch -{ - - inline const std::string& Bencher::name() const - { - return name_; - } - - inline const Inputs& Bencher::inputs() const - { - return inputs_; - } - - inline const Outputs& Bencher::outputs() const - { - return outputs_; - } - - inline const std::string& Bencher::comment() const - { - return comment_; - } - - inline Bencher& Bencher::add_input(Input::Input& input) - { - inputs_.add(input); - return *this; - } - - inline Bencher& Bencher::add_output(Output::Output& output) - { - outputs_.add(output); - return *this; - } - -} // namespace Ranch - - -#endif // !RANCH_BENCHER_HXX Index: lib/cxx/ranch-cxx/io.hxx --- lib/cxx/ranch-cxx/io.hxx (revision 28) +++ lib/cxx/ranch-cxx/io.hxx (working copy) @@ -1,50 +0,0 @@ - -#ifndef RANCH_IO_HXX -# define RANCH_IO_HXX - -# include <io.hh> -# include <ostream> - -namespace Ranch -{ - - inline IO::IO(const std::string& name, const std::string& unit) : - name_(name), - unit_(unit), - value_(0) - { - } - - inline std::ostream& IO::print(std::ostream& ostr) const - { - return ostr << name_ << '(' << unit_ << ')'; - } - - inline const std::string& IO::name() const - { - return name_; - } - - inline const std::string& IO::unit() const - { - return unit_; - } - - inline double IO::value() const - { - return value_; - } - - inline void IO::value(double value) - { - value_ = value; - } - - inline std::ostream& operator<< (std::ostream& ostr, const IO& io) - { - return io.print(ostr); - } - -} // namespace Ranch - -#endif // !RANCH_IO_HXX