From ea4d8395dedb38c6cc53fb040c577a7ab4d2d94b Mon Sep 17 00:00:00 2001 From: Olivier Stasse <ostasse@laas.fr> Date: Wed, 30 Jan 2019 15:59:16 +0100 Subject: [PATCH] Remove contiffstream class --- include/dynamic-graph/contiifstream.h | 70 ---------------------- include/dynamic-graph/fwd.hh | 17 +----- src/debug/contiifstream.cpp | 83 --------------------------- 3 files changed, 3 insertions(+), 167 deletions(-) delete mode 100644 include/dynamic-graph/contiifstream.h delete mode 100644 src/debug/contiifstream.cpp diff --git a/include/dynamic-graph/contiifstream.h b/include/dynamic-graph/contiifstream.h deleted file mode 100644 index 4741450..0000000 --- a/include/dynamic-graph/contiifstream.h +++ /dev/null @@ -1,70 +0,0 @@ -// -*- mode: c++ -*- -// Copyright 2010, François Bleibel, Thomas Moulard, Olivier Stasse, -// JRL, CNRS/AIST. -// -// This file is part of dynamic-graph. -// dynamic-graph 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. -// -// dynamic-graph 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 -// dynamic-graph. If not, see <http://www.gnu.org/licenses/>. - -#ifndef DYNAMIC_GRAPH_CONTIIFSTREAM_H -# define DYNAMIC_GRAPH_CONTIIFSTREAM_H -# include <fstream> -# include <list> -# include <sstream> - -# ifndef WIN32 -# include <unistd.h> -# include <pthread.h> -# endif //! WIN32 - -# include <dynamic-graph/fwd.hh> -# include <dynamic-graph/interpreter.h> -# include <dynamic-graph/config-contiifstream.hh> - -namespace dynamicgraph -{ - /// \ingroup debug - /// - /// \brief TODO - /// - class DG_CONTIIFSTREAM_DLLAPI Contiifstream - { - public: - explicit Contiifstream (const std::string& n = ""); - ~Contiifstream (); - - inline void open (const std::string& n) - { - filename = n; - cursor = 0; - } - - bool loop (); - - inline bool ready () - { - return 0 < reader.size (); - } - - std::string next (); - - protected: - std::string filename; - std::streamoff cursor; - static const unsigned int BUFFER_SIZE = 256; - char buffer[BUFFER_SIZE]; - std::list< std::string > reader; - bool first; - }; -} // end of namespace dynamicgraph. - -#endif //! DYNAMIC_GRAPH_CONTIIFSTREAM_H diff --git a/include/dynamic-graph/fwd.hh b/include/dynamic-graph/fwd.hh index 1f3fdc2..5dcb7a1 100644 --- a/include/dynamic-graph/fwd.hh +++ b/include/dynamic-graph/fwd.hh @@ -1,24 +1,13 @@ -// Copyright 2010, Thomas Moulard, JRL, CNRS/AIST +// Copyright 2010-2019, CNRS, JRL, AIST, LAAS +// Thomas Moulard, Olivier Stasse // -// This file is part of dynamic-graph. -// dynamic-graph 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. -// -// dynamic-graph 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 -// dynamic-graph. If not, see <http://www.gnu.org/licenses/>. +// See License #ifndef DYNAMIC_GRAPH_FWD_HH # define DYNAMIC_GRAPH_FWD_HH namespace dynamicgraph { - class Contiifstream; class DebugTrace; class PluginRefMap; diff --git a/src/debug/contiifstream.cpp b/src/debug/contiifstream.cpp deleted file mode 100644 index 884ae8d..0000000 --- a/src/debug/contiifstream.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2010, François Bleibel, Thomas Moulard, Olivier Stasse, -// JRL, CNRS/AIST. -// -// This file is part of dynamic-graph. -// dynamic-graph is free software: -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include <dynamic-graph/contiifstream.h> -#include <dynamic-graph/debug.h> - -namespace dynamicgraph -{ - Contiifstream::Contiifstream (const std::string& n) - : filename (n), - cursor (0), - first (true) - {} - - Contiifstream::~Contiifstream () - { - dgDEBUGINOUT(5); - } - - bool - Contiifstream::loop () - { - dgDEBUGIN(25); - - bool res = false; - std::fstream file (filename.c_str ()); - file.seekg (cursor); - file.sync (); - - while(1) - { - file.get (buffer,BUFFER_SIZE); - if (file.gcount ()) - { - res = true; - std::string line (buffer); - if (! first) - reader.push_back (line); - cursor=file.tellg (); - ++cursor; - file.get (*buffer); // get the last char ( = '\n') - dgDEBUG(15) << "line: "<< line<<std::endl; - } - else - break; - } - - first = false; - dgDEBUGOUT(25); - return res; - } - - std::string - Contiifstream::next () - { - std::string res = *reader.begin (); - reader.pop_front (); - return res; - } -} // end of namespace dynamicgraph. -- GitLab