From: tho Date: Mon, 11 Apr 2011 12:10:19 +0000 (+0000) Subject: removed needless Boost.Iostreams dependency X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=3aced0177a1c69c7af338b4e66db8694a71873ae;p=senf.git removed needless Boost.Iostreams dependency some #include cleanups git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1781 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/SConstruct b/SConstruct index 3a60e3a..655e3a7 100644 --- a/SConstruct +++ b/SConstruct @@ -180,7 +180,7 @@ SConscript('SConfigure') # Only add this here, after all configure checks have run env.Append(LIBS = '$LIBSENF$LIBADDSUFFIX', - EXTRA_LIBS = [ '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB', + EXTRA_LIBS = [ '$BOOSTREGEXLIB', '$BOOSTSIGNALSLIB', '$BOOSTFSLIB' ]) ########################################################################### diff --git a/senf/PPI/DebugModules.cci b/senf/PPI/DebugModules.cci index 1c6f5fb..2bbf549 100644 --- a/senf/PPI/DebugModules.cci +++ b/senf/PPI/DebugModules.cci @@ -24,7 +24,6 @@ \brief DebugModules inline non-template implementation */ // Custom includes -#include #include "Setup.hh" #define prefix_ inline diff --git a/senf/PPI/EventManager.cci b/senf/PPI/EventManager.cci index 1bafcc0..5c981e3 100644 --- a/senf/PPI/EventManager.cci +++ b/senf/PPI/EventManager.cci @@ -26,7 +26,6 @@ //#include "EventManager.ih" // Custom includes -#include #define prefix_ inline //-///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/senf/PPI/IOEvent.hh b/senf/PPI/IOEvent.hh index b31356f..366e70b 100644 --- a/senf/PPI/IOEvent.hh +++ b/senf/PPI/IOEvent.hh @@ -27,9 +27,9 @@ #define HH_SENF_PPI_IOEvent_ 1 // Custom includes -#include -#include "Events.hh" +#include #include +#include "Events.hh" //#include "IOEvent.mpp" //-///////////////////////////////////////////////////////////////////////////////////////////////// @@ -107,8 +107,6 @@ namespace ppi { struct HangupException : public senf::Exception { HangupException() : senf::Exception("senf::ppi::IOEvent::HangupException") {} }; - protected: - private: virtual void v_enable(); virtual void v_disable(); @@ -119,7 +117,6 @@ namespace ppi { scheduler::FdEvent event_; }; - }} //-///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/senf/PPI/IdleEvent.hh b/senf/PPI/IdleEvent.hh index b2023f8..3bdb3c9 100644 --- a/senf/PPI/IdleEvent.hh +++ b/senf/PPI/IdleEvent.hh @@ -27,6 +27,7 @@ #define HH_SENF_PPI_IdleEvent_ 1 // Custom includes +#include #include "Events.hh" //#include "IdleEvent.mpp" diff --git a/senf/PPI/IntervalTimer.cc b/senf/PPI/IntervalTimer.cc index 3b23dc6..504771b 100644 --- a/senf/PPI/IntervalTimer.cc +++ b/senf/PPI/IntervalTimer.cc @@ -27,7 +27,6 @@ //#include "IntervalTimer.ih" // Custom includes -#include #include "EventManager.hh" //#include "IntervalTimer.mpp" diff --git a/senf/PPI/IntervalTimer.hh b/senf/PPI/IntervalTimer.hh index 95aef95..53bc89a 100644 --- a/senf/PPI/IntervalTimer.hh +++ b/senf/PPI/IntervalTimer.hh @@ -28,6 +28,7 @@ // Custom includes #include +#include #include "Events.hh" //#include "IntervalTimer.mpp" diff --git a/senf/PPI/ModuleManager.cc b/senf/PPI/ModuleManager.cc index d4733d4..65e686e 100644 --- a/senf/PPI/ModuleManager.cc +++ b/senf/PPI/ModuleManager.cc @@ -27,11 +27,10 @@ //#include "ModuleManager.ih" // Custom includes -#include #include -#include "Module.hh" #include #include +#include "Module.hh" //#include "ModuleManager.mpp" #define prefix_ @@ -75,10 +74,10 @@ prefix_ senf::ppi::ModuleManager::ModuleManager() initRunner_ ("senf::ppi::init", membind(&ModuleManager::init, this), scheduler::EventHook::PRE, false) { - senf::console::sysdir().add("ppi", consoleDir_); + console::sysdir().add("ppi", consoleDir_); consoleDir_ - .add("dump", senf::console::factory::Command( + .add("dump", console::factory::Command( senf::membind(&ModuleManager::dumpModules, this)) .doc("Dump complete PPI structure\n" "The dump will contain one paragraph for each module. The first line gives module\n" diff --git a/senf/PPI/ModuleManager.hh b/senf/PPI/ModuleManager.hh index 87c44d3..2ecc80f 100644 --- a/senf/PPI/ModuleManager.hh +++ b/senf/PPI/ModuleManager.hh @@ -119,7 +119,6 @@ namespace ppi { friend class Initializable; }; - }} //-///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/senf/Packets/PacketImpl.cci b/senf/Packets/PacketImpl.cci index 40f0b25..4c8bc04 100644 --- a/senf/Packets/PacketImpl.cci +++ b/senf/Packets/PacketImpl.cci @@ -24,8 +24,6 @@ \brief PacketImpl inline non-template implementation */ // Custom includes -#include -// #include "PacketInterpreter.hh" #define prefix_ inline //-///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/senf/Packets/PacketParser.cti b/senf/Packets/PacketParser.cti index be92007..ab7e31f 100644 --- a/senf/Packets/PacketParser.cti +++ b/senf/Packets/PacketParser.cti @@ -26,8 +26,6 @@ #include "PacketParser.ih" // Custom includes -#include -#include "PacketData.hh" #define prefix_ inline //-///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/senf/Packets/PacketRegistry.ct b/senf/Packets/PacketRegistry.ct index d1ce466..8c746f9 100644 --- a/senf/Packets/PacketRegistry.ct +++ b/senf/Packets/PacketRegistry.ct @@ -26,12 +26,11 @@ #include "PacketRegistry.ih" // Custom includes -#include #include #include -#include #include #include +#include #define prefix_ //-///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/senf/Scheduler/FIFORunner.cc b/senf/Scheduler/FIFORunner.cc index d7b7044..4368729 100644 --- a/senf/Scheduler/FIFORunner.cc +++ b/senf/Scheduler/FIFORunner.cc @@ -30,13 +30,13 @@ #include #include #include +#include #ifdef SENF_BACKTRACE #include #endif #include #include #include -#include #include "senf/Utils/IgnoreValue.hh" #include #include diff --git a/senf/Scheduler/FIFORunner.hh b/senf/Scheduler/FIFORunner.hh index 1be7bff..2bd919d 100644 --- a/senf/Scheduler/FIFORunner.hh +++ b/senf/Scheduler/FIFORunner.hh @@ -28,7 +28,6 @@ // Custom includes #include -#include #include #include #include @@ -80,9 +79,7 @@ namespace detail { bool runnable_; Priority priority_; -# ifdef SENF_BACKTRACE - std::string backtrace_; -# endif + std::string backtrace_; // only used if SENF_BACKTRACE is defined. friend class FIFORunner; }; diff --git a/senf/Scheduler/FdEvent.cc b/senf/Scheduler/FdEvent.cc index 7ac5c62..cd4c7af 100644 --- a/senf/Scheduler/FdEvent.cc +++ b/senf/Scheduler/FdEvent.cc @@ -28,7 +28,6 @@ // Custom includes #include -#include //#include "FdEvent.mpp" #define prefix_ diff --git a/senf/Scheduler/FdEvent.cci b/senf/Scheduler/FdEvent.cci index e585ce5..8b64722 100644 --- a/senf/Scheduler/FdEvent.cci +++ b/senf/Scheduler/FdEvent.cci @@ -26,7 +26,6 @@ #include "FdEvent.ih" // Custom includes -#include #include "FdManager.hh" #define prefix_ inline diff --git a/senf/Scheduler/ReadHelper.ct b/senf/Scheduler/ReadHelper.ct index 7753964..0b70e3e 100644 --- a/senf/Scheduler/ReadHelper.ct +++ b/senf/Scheduler/ReadHelper.ct @@ -24,10 +24,8 @@ #include "ReadHelper.ih" // Custom includes -#include #include #include -#include "Scheduler.hh" #define prefix_ //-///////////////////////////////////////////////////////////////////////////////////////////////// @@ -37,7 +35,7 @@ prefix_ senf::ReadHelper::ReadHelper(Handle handle, std::string::size_ty InternalPredicate * predicate, Callback cb) : handle_(handle), fde_("senf::ReadHelper", boost::bind(&ReadHelper::dispatchProcess,ptr(this), handle, _1), - handle, senf::scheduler::FdEvent::EV_READ), + handle, scheduler::FdEvent::EV_READ), maxSize_(maxSize), predicate_(predicate), callback_(cb), errno_(0), complete_(false) { // Here we add a *static* member taking a *smart* pointer as first @@ -67,7 +65,7 @@ template prefix_ void senf::ReadHelper::process(Handle handle,int event) { try { - if (event != senf::scheduler::FdEvent::EV_READ) + if (event != scheduler::FdEvent::EV_READ) throw SystemException(EPIPE SENF_EXC_DEBUGINFO); std::string rcv; handle.read(rcv, maxSize_ - data_.size()); diff --git a/senf/Scheduler/SignalEvent.cci b/senf/Scheduler/SignalEvent.cci index e4757b3..c441ffe 100644 --- a/senf/Scheduler/SignalEvent.cci +++ b/senf/Scheduler/SignalEvent.cci @@ -28,7 +28,6 @@ // Custom includes #include #include -#include #define prefix_ inline //-///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/senf/Scheduler/WriteHelper.ct b/senf/Scheduler/WriteHelper.ct index aeda3b9..d05a9c8 100644 --- a/senf/Scheduler/WriteHelper.ct +++ b/senf/Scheduler/WriteHelper.ct @@ -24,10 +24,8 @@ //#include "WriteHelper.ih" // Custom includes -#include #include #include -#include "Scheduler.hh" #define prefix_ //-///////////////////////////////////////////////////////////////////////////////////////////////// @@ -62,20 +60,20 @@ prefix_ void senf::WriteHelper::revoke() template prefix_ void senf::WriteHelper::dispatchProcess(ptr helper, Handle handle, - senf::scheduler::FdEvent::Events event) + scheduler::FdEvent::Events event) { // since we have a 'ptr' argument, the instance cannot be deleted // before this method returns - return helper->process(handle,event); + helper->process(handle, event); } template prefix_ void senf::WriteHelper::process(Handle handle, - senf::scheduler::FdEvent::Events event) + scheduler::FdEvent::Events event) { bool complete_ (false); try { - if (event != senf::scheduler::FdEvent::EV_WRITE) + if (event != scheduler::FdEvent::EV_WRITE) throw SystemException(EPIPE SENF_EXC_DEBUGINFO); offset_ = handle.write(std::make_pair(offset_,data_.end())); if (offset_ == data_.end()) { diff --git a/senf/Utils/Backtrace.hh b/senf/Utils/Backtrace.hh index f1d59f7..e358d0b 100644 --- a/senf/Utils/Backtrace.hh +++ b/senf/Utils/Backtrace.hh @@ -35,7 +35,7 @@ namespace senf { /** \defgroup backtraces Backtrace formatting and parsing - These functions help format and barse backtrace information as returned by the glibc + These functions help format and parse backtrace information as returned by the glibc ::backtrace function. */ diff --git a/senf/Utils/Console/Executor.cc b/senf/Utils/Console/Executor.cc index 2c97f4b..4a7d8f9 100644 --- a/senf/Utils/Console/Executor.cc +++ b/senf/Utils/Console/Executor.cc @@ -34,8 +34,8 @@ #include #include #include -#include "Server.hh" #include "senf/Utils/IgnoreValue.hh" +#include "Server.hh" //#include "Executor.mpp" #define prefix_ diff --git a/senf/Utils/Console/Server.cc b/senf/Utils/Console/Server.cc index 9b6d170..e39a44f 100644 --- a/senf/Utils/Console/Server.cc +++ b/senf/Utils/Console/Server.cc @@ -24,16 +24,11 @@ \brief Server non-inline non-template implementation */ #include "Server.hh" -#include "Server.ih" +//#include "Server.ih" // Custom includes -#include -#include #include -#include -#include #include -#include #include #include #include @@ -132,7 +127,7 @@ prefix_ void senf::console::Server::removeClient(Client & client) try { log << client.handle().peer(); } - catch (senf::SystemException ex) { + catch (senf::SystemException & ex) { log << "(dead socket)"; } })); @@ -165,7 +160,7 @@ senf::console::detail::DumbClientReader::clientData(senf::ReadHelperdata()); tail_ = helper->tail(); - boost::trim(data); // Gets rid of superfluous \r or \n characters + boost::trim(data); // Gets rid of superfluous \r or \n characters handleInput(data); showPrompt(); @@ -405,9 +400,7 @@ prefix_ unsigned senf::console::Client::getWidth(std::ostream & os, unsigned def prefix_ senf::console::Client::SysBacktrace::SysBacktrace() { - namespace fty = console::factory; - - sysdir().add("backtrace", fty::Command(&SysBacktrace::backtrace) + sysdir().add("backtrace", factory::Command(&SysBacktrace::backtrace) .doc("Display the backtrace of the last error / exception in this console") ); } diff --git a/senf/Utils/Console/Server.cci b/senf/Utils/Console/Server.cci index 1c73c98..7665fd7 100644 --- a/senf/Utils/Console/Server.cci +++ b/senf/Utils/Console/Server.cci @@ -23,7 +23,7 @@ /** \file \brief Server inline non-template implementation */ -#include "Server.ih" +//#include "Server.ih" // Custom includes diff --git a/senf/Utils/Console/Server.hh b/senf/Utils/Console/Server.hh index a7a747c..91f4163 100644 --- a/senf/Utils/Console/Server.hh +++ b/senf/Utils/Console/Server.hh @@ -30,16 +30,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include "Parse.hh" -#include "Executor.hh" +#include +#include #include #include +#include +#include "Executor.hh" //#include "Server.mpp" #include "Server.ih" diff --git a/senf/Utils/Console/Server.ih b/senf/Utils/Console/Server.ih index e293878..75fb060 100644 --- a/senf/Utils/Console/Server.ih +++ b/senf/Utils/Console/Server.ih @@ -29,7 +29,8 @@ // Custom includes #include #include -#include +#include +#include #include //-///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/senf/Utils/Console/Traits.cti b/senf/Utils/Console/Traits.cti index 1bdd459..8219ccc 100644 --- a/senf/Utils/Console/Traits.cti +++ b/senf/Utils/Console/Traits.cti @@ -27,7 +27,6 @@ // Custom includes #include -#include #include #include diff --git a/senf/Utils/Console/UDPServer.test.cc b/senf/Utils/Console/UDPServer.test.cc index de3cff6..b663c9d 100644 --- a/senf/Utils/Console/UDPServer.test.cc +++ b/senf/Utils/Console/UDPServer.test.cc @@ -28,6 +28,7 @@ // Custom includes #include "Console.hh" +#include #include #include diff --git a/senf/Utils/Console/Utility.ct b/senf/Utils/Console/Utility.ct index 603bbc7..bc771dc 100644 --- a/senf/Utils/Console/Utility.ct +++ b/senf/Utils/Console/Utility.ct @@ -42,7 +42,7 @@ prefix_ void senf::console::ArgumentTraits< senf::console::CharAsString > parse(ParseCommandInfo::TokensRange const & tokens, CharAsString & out) { std::string v; - senf::console::parse(tokens,v); + console::parse(tokens,v); if (v.size() != 1) throw SyntaxErrorException("Invalid size of character constant"); out.value = static_cast(v[0]); @@ -59,14 +59,14 @@ template prefix_ std::string senf::console::ArgumentTraits< senf::console::CharAsString >:: str(CharAsString value) { - return senf::console::str(std::string(1,value.value)); + return console::str(std::string(1,value.value)); } template prefix_ void senf::console::ReturnValueTraits< senf::console::CharAsString >:: format(CharAsString value, std::ostream & os) { - return senf::console::format(std::string(1,value.value),os); + console::format(std::string(1,value.value),os); } //-///////////////////////////////////////////////////////////////////////////////////////////////// @@ -77,7 +77,7 @@ prefix_ void senf::console::ArgumentTraits< senf::console::ValueRange >:: parse(ParseCommandInfo::TokensRange const & tokens, type & out) { if (tokens.size() != 1) - throw senf::console::SyntaxErrorException("parameter syntax error"); + throw SyntaxErrorException("parameter syntax error"); std::string v (tokens.begin()[0].value()); std::string::size_type i (v.find(':')); try { @@ -89,7 +89,7 @@ parse(ParseCommandInfo::TokensRange const & tokens, type & out) } } catch (std::bad_cast & ex) { - throw senf::console::SyntaxErrorException("parameter syntax error"); + throw SyntaxErrorException("parameter syntax error"); } } @@ -132,7 +132,7 @@ parse(ParseCommandInfo::TokensRange const & tokens, type & out) out.value = 0; while (arg) { Enum v; - senf::console::parse( *(arg++), v); + console::parse( *(arg++), v); out.value |= v; } } @@ -149,7 +149,7 @@ prefix_ std::string senf::console::ArgumentTraits< senf::console::FlagCollection >::str(type const & value) { std::stringstream ss; - senf::console::format(value, ss); + console::format(value, ss); return ss.str(); } @@ -166,7 +166,7 @@ format(type const & value, std::ostream & os) for (unsigned bit (0); bit(flag), ss); + console::format(static_cast(flag), ss); } } os << (n != 1 ? "(" + ss.str() + ")" : ss.str()); diff --git a/senf/Utils/Console/Utility.hh b/senf/Utils/Console/Utility.hh index 8f37737..6743e84 100644 --- a/senf/Utils/Console/Utility.hh +++ b/senf/Utils/Console/Utility.hh @@ -95,7 +95,7 @@ namespace console { /** \brief Value range A value range may be represented in the console either by a single value (setting both \a - low and \a high to the same value) or as a lower and upper bound seperated by a colon. + low and \a high to the same value) or as a lower and upper bound separated by a colon. \ingroup senf_console_utilities */ diff --git a/senf/Utils/Console/testServer.cc b/senf/Utils/Console/testServer.cc index 9db2b09..f1991e9 100644 --- a/senf/Utils/Console/testServer.cc +++ b/senf/Utils/Console/testServer.cc @@ -119,6 +119,7 @@ int main(int, char **) .name("testServer"); senf::scheduler::process(); + return 0; } diff --git a/senf/Utils/Daemon/Daemon.ih b/senf/Utils/Daemon/Daemon.ih index a691ab1..8414327 100644 --- a/senf/Utils/Daemon/Daemon.ih +++ b/senf/Utils/Daemon/Daemon.ih @@ -33,7 +33,6 @@ #include #include #include -#include //-///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/senf/Utils/Exception.cc b/senf/Utils/Exception.cc index 276d7dd..aeb7aaa 100644 --- a/senf/Utils/Exception.cc +++ b/senf/Utils/Exception.cc @@ -27,7 +27,6 @@ //#include "Exception.ih" // Custom includes -#include #ifdef SENF_BACKTRACE #include #endif @@ -44,7 +43,7 @@ prefix_ void senf::ExceptionMixin::addBacktrace() { void * entries[SENF_DEBUG_BACKTRACE_NUMCALLERS]; - unsigned nEntries( ::backtrace(entries, SENF_DEBUG_BACKTRACE_NUMCALLERS) ); + unsigned nEntries (::backtrace(entries, SENF_DEBUG_BACKTRACE_NUMCALLERS)); std::stringstream ss; ss << "\nException at\n"; diff --git a/senf/Utils/Statistics.cc b/senf/Utils/Statistics.cc index 5175388..8e25803 100644 --- a/senf/Utils/Statistics.cc +++ b/senf/Utils/Statistics.cc @@ -31,6 +31,7 @@ #include #include #include +#include #include "StatisticsTargets.hh" //#include "Statistics.mpp" diff --git a/senf/Utils/Statistics.cci b/senf/Utils/Statistics.cci index 98c7c0c..b008d98 100644 --- a/senf/Utils/Statistics.cci +++ b/senf/Utils/Statistics.cci @@ -27,6 +27,7 @@ // Custom includes #include +#include #include "Range.hh" #define prefix_ inline @@ -65,8 +66,7 @@ prefix_ senf::StatisticsBase::OutputEntry::OutputEntry(const OutputEntry& other) prefix_ void senf::StatisticsBase::OutputEntry::initDir() { - namespace fty = console::factory; - dir.add("list", fty::Command(&OutputEntry::consoleList, this) + dir.add("list", console::factory::Command(&OutputEntry::consoleList, this) .doc("List all known connected targets. This list might not be complete.") ); } diff --git a/senf/Utils/Statistics.hh b/senf/Utils/Statistics.hh index 41ead1a..7f2672b 100644 --- a/senf/Utils/Statistics.hh +++ b/senf/Utils/Statistics.hh @@ -35,10 +35,10 @@ #include #include #include -#include "Exception.hh" #include -#include +#include #include "StatisticAccumulator.hh" +#include "Exception.hh" //#include "Statistics.mpp" //-///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/senf/Utils/Termlib/Telnet.cci b/senf/Utils/Termlib/Telnet.cci index 22681f7..70282d2 100644 --- a/senf/Utils/Termlib/Telnet.cci +++ b/senf/Utils/Termlib/Telnet.cci @@ -82,7 +82,7 @@ prefix_ senf::term::BaseTelnetProtocol::Handle senf::term::BaseTelnetProtocol::h prefix_ void senf::term::BaseTelnetProtocol::incrementRequestCounter() { ++ pendingRequests_; - timeout_.timeout(senf::scheduler::eventTime() + requestTimeout_); + timeout_.timeout(scheduler::eventTime() + requestTimeout_); } prefix_ bool senf::term::BaseTelnetProtocol::requestsPending() diff --git a/senf/Utils/Termlib/Telnet.hh b/senf/Utils/Termlib/Telnet.hh index 88ff468..04100e2 100644 --- a/senf/Utils/Termlib/Telnet.hh +++ b/senf/Utils/Termlib/Telnet.hh @@ -29,7 +29,6 @@ // Custom includes #include #include -#include #include #include @@ -320,8 +319,8 @@ namespace term { option_type option_; std::string data_; - senf::scheduler::FdEvent inputEvent_; - senf::scheduler::FdEvent outputEvent_; + scheduler::FdEvent inputEvent_; + scheduler::FdEvent outputEvent_; unsigned pendingRequests_; diff --git a/site_scons/senfutil.py b/site_scons/senfutil.py index 30c1f90..0abb05e 100644 --- a/site_scons/senfutil.py +++ b/site_scons/senfutil.py @@ -168,7 +168,7 @@ def SetupForSENF(env, senf_path = [], flavor=None): CPPDEFINES = [ '$expandLogOption' ], CXXFLAGS = [ '-Wno-long-long', '-fno-strict-aliasing' ], LINKFLAGS = [ '-rdynamic' ], - LIBS = [ 'senf$LIBADDSUFFIX', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB', + LIBS = [ 'senf$LIBADDSUFFIX', 'rt', '$BOOSTREGEXLIB', '$BOOSTSIGNALSLIB', '$BOOSTFSLIB' ], )