# 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' ])
###########################################################################
\brief DebugModules inline non-template implementation */
// Custom includes
-#include <senf/Utils/senfassert.hh>
#include "Setup.hh"
#define prefix_ inline
//#include "EventManager.ih"
// Custom includes
-#include <senf/Scheduler/Scheduler.hh>
#define prefix_ inline
//-/////////////////////////////////////////////////////////////////////////////////////////////////
#define HH_SENF_PPI_IOEvent_ 1
// Custom includes
-#include <senf/Scheduler/Scheduler.hh>
-#include "Events.hh"
+#include <senf/Scheduler/FdEvent.hh>
#include <senf/Utils/Exception.hh>
+#include "Events.hh"
//#include "IOEvent.mpp"
//-/////////////////////////////////////////////////////////////////////////////////////////////////
struct HangupException : public senf::Exception
{ HangupException() : senf::Exception("senf::ppi::IOEvent::HangupException") {} };
- protected:
-
private:
virtual void v_enable();
virtual void v_disable();
scheduler::FdEvent event_;
};
-
}}
//-/////////////////////////////////////////////////////////////////////////////////////////////////
#define HH_SENF_PPI_IdleEvent_ 1
// Custom includes
+#include <senf/Scheduler/TimerEvent.hh>
#include "Events.hh"
//#include "IdleEvent.mpp"
//#include "IntervalTimer.ih"
// Custom includes
-#include <senf/Scheduler/Scheduler.hh>
#include "EventManager.hh"
//#include "IntervalTimer.mpp"
// Custom includes
#include <senf/Scheduler/ClockService.hh>
+#include <senf/Scheduler/TimerEvent.hh>
#include "Events.hh"
//#include "IntervalTimer.mpp"
//#include "ModuleManager.ih"
// Custom includes
-#include <senf/Scheduler/Scheduler.hh>
#include <senf/Utils/membind.hh>
-#include "Module.hh"
#include <senf/Utils/Console/ParsedCommand.hh>
#include <senf/Utils/Console/Sysdir.hh>
+#include "Module.hh"
//#include "ModuleManager.mpp"
#define prefix_
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"
friend class Initializable;
};
-
}}
//-/////////////////////////////////////////////////////////////////////////////////////////////////
\brief PacketImpl inline non-template implementation */
// Custom includes
-#include <senf/Utils/senfassert.hh>
-// #include "PacketInterpreter.hh"
#define prefix_ inline
//-/////////////////////////////////////////////////////////////////////////////////////////////////
#include "PacketParser.ih"
// Custom includes
-#include <senf/Utils/senfassert.hh>
-#include "PacketData.hh"
#define prefix_ inline
//-/////////////////////////////////////////////////////////////////////////////////////////////////
#include "PacketRegistry.ih"
// Custom includes
-#include <senf/Utils/senfassert.hh>
#include <iostream>
#include <iomanip>
-#include <cmath>
#include <senf/Utils/TypeInfo.hh>
#include <senf/Utils/Format.hh>
+#include <senf/Utils/senfassert.hh>
#define prefix_
//-/////////////////////////////////////////////////////////////////////////////////////////////////
#include <signal.h>
#include <time.h>
#include <cassert>
+#include <senf/config.hh>
#ifdef SENF_BACKTRACE
#include <execinfo.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <senf/Utils/Exception.hh>
-#include <senf/Utils/senfassert.hh>
#include "senf/Utils/IgnoreValue.hh"
#include <senf/Utils/Console/ScopedDirectory.hh>
#include <senf/Utils/Console/ParsedCommand.hh>
// Custom includes
#include <signal.h>
-#include <senf/config.hh>
#include <boost/utility.hpp>
#include <senf/boost_intrusive/ilist.hpp>
#include <senf/boost_intrusive/ilist_hook.hpp>
bool runnable_;
Priority priority_;
-# ifdef SENF_BACKTRACE
- std::string backtrace_;
-# endif
+ std::string backtrace_; // only used if SENF_BACKTRACE is defined.
friend class FIFORunner;
};
// Custom includes
#include <sstream>
-#include <senf/Utils/senfassert.hh>
//#include "FdEvent.mpp"
#define prefix_
#include "FdEvent.ih"
// Custom includes
-#include <senf/Utils/senfassert.hh>
#include "FdManager.hh"
#define prefix_ inline
#include "ReadHelper.ih"
// Custom includes
-#include <errno.h>
#include <boost/bind.hpp>
#include <senf/Utils/Exception.hh>
-#include "Scheduler.hh"
#define prefix_
//-/////////////////////////////////////////////////////////////////////////////////////////////////
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
prefix_ void senf::ReadHelper<Handle>::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());
// Custom includes
#include <unistd.h>
#include <senf/Utils/signalnames.hh>
-#include <senf/Utils/senfassert.hh>
#define prefix_ inline
//-/////////////////////////////////////////////////////////////////////////////////////////////////
//#include "WriteHelper.ih"
// Custom includes
-#include <errno.h>
#include <boost/bind.hpp>
#include <senf/Utils/Exception.hh>
-#include "Scheduler.hh"
#define prefix_
//-/////////////////////////////////////////////////////////////////////////////////////////////////
template <class Handle>
prefix_ void senf::WriteHelper<Handle>::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 <class Handle>
prefix_ void senf::WriteHelper<Handle>::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()) {
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.
*/
#include <boost/preprocessor/stringize.hpp>
#include <senf/Utils/senfassert.hh>
#include <senf/Utils/Range.hh>
-#include "Server.hh"
#include "senf/Utils/IgnoreValue.hh"
+#include "Server.hh"
//#include "Executor.mpp"
#define prefix_
\brief Server non-inline non-template implementation */
#include "Server.hh"
-#include "Server.ih"
+//#include "Server.ih"
// Custom includes
-#include <errno.h>
-#include <iostream>
#include <boost/algorithm/string/trim.hpp>
-#include <boost/iostreams/device/file_descriptor.hpp>
-#include <boost/iostreams/stream.hpp>
#include <boost/bind.hpp>
-#include <senf/Utils/senfassert.hh>
#include <senf/Utils/membind.hh>
#include <senf/Utils/Logger/SenfLog.hh>
#include <senf/Version.hh>
try {
log << client.handle().peer();
}
- catch (senf::SystemException ex) {
+ catch (senf::SystemException & ex) {
log << "(dead socket)";
}
}));
std::string data (tail_ + helper->data());
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();
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") );
}
/** \file
\brief Server inline non-template implementation */
-#include "Server.ih"
+//#include "Server.ih"
// Custom includes
#include <set>
#include <boost/utility.hpp>
#include <boost/scoped_ptr.hpp>
-#include <boost/shared_ptr.hpp>
-#include <senf/Utils/intrusive_refcount.hh>
-#include <senf/Socket/Protocols/INet/TCPSocketHandle.hh>
-#include <senf/Socket/ServerSocketHandle.hh>
-#include <senf/Scheduler/Scheduler.hh>
-#include <senf/Scheduler/ReadHelper.hh>
-#include "Parse.hh"
-#include "Executor.hh"
+#include <senf/Scheduler/FdEvent.hh>
+#include <senf/Scheduler/TimerEvent.hh>
#include <senf/Socket/Protocols/INet/INetAddressing.hh>
#include <senf/Utils/Logger.hh>
+#include <senf/Utils/intrusive_refcount.hh>
+#include "Executor.hh"
//#include "Server.mpp"
#include "Server.ih"
// Custom includes
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
-#include <set>
+#include <senf/Scheduler/ReadHelper.hh>
+#include <senf/Socket/Protocols/INet/TCPSocketHandle.hh>
#include <senf/Utils/Logger/SenfLog.hh>
//-/////////////////////////////////////////////////////////////////////////////////////////////////
// Custom includes
#include <sstream>
-#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#include <senf/Utils/TypeInfo.hh>
// Custom includes
#include "Console.hh"
+#include <senf/Scheduler/Scheduler.hh>
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
parse(ParseCommandInfo::TokensRange const & tokens, CharAsString<CharT> & 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<CharT>(v[0]);
prefix_ std::string senf::console::ArgumentTraits< senf::console::CharAsString<CharT> >::
str(CharAsString<CharT> value)
{
- return senf::console::str(std::string(1,value.value));
+ return console::str(std::string(1,value.value));
}
template <class CharT>
prefix_ void senf::console::ReturnValueTraits< senf::console::CharAsString<CharT> >::
format(CharAsString<CharT> value, std::ostream & os)
{
- return senf::console::format(std::string(1,value.value),os);
+ console::format(std::string(1,value.value),os);
}
//-/////////////////////////////////////////////////////////////////////////////////////////////////
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 {
}
}
catch (std::bad_cast & ex) {
- throw senf::console::SyntaxErrorException("parameter syntax error");
+ throw SyntaxErrorException("parameter syntax error");
}
}
out.value = 0;
while (arg) {
Enum v;
- senf::console::parse( *(arg++), v);
+ console::parse( *(arg++), v);
out.value |= v;
}
}
senf::console::ArgumentTraits< senf::console::FlagCollection<Enum> >::str(type const & value)
{
std::stringstream ss;
- senf::console::format(value, ss);
+ console::format(value, ss);
return ss.str();
}
for (unsigned bit (0); bit<sizeof(value.value)*CHAR_BIT; ++bit, flag<<=1) {
if (value.value & flag) {
if (n++) ss << " ";
- senf::console::format(static_cast<Enum>(flag), ss);
+ console::format(static_cast<Enum>(flag), ss);
}
}
os << (n != 1 ? "(" + ss.str() + ")" : ss.str());
/** \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
*/
.name("testServer");
senf::scheduler::process();
+ return 0;
}
\f
#include <boost/utility.hpp>
#include <boost/function.hpp>
#include <senf/Scheduler/Scheduler.hh>
-#include <senf/Scheduler/FdEvent.hh>
//-/////////////////////////////////////////////////////////////////////////////////////////////////
//#include "Exception.ih"
// Custom includes
-#include <senf/config.hh>
#ifdef SENF_BACKTRACE
#include <execinfo.h>
#endif
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";
#include <cstdlib>
#include <sstream>
#include <senf/Utils/Format.hh>
+#include <senf/Utils/Console/STLSupport.hh>
#include "StatisticsTargets.hh"
//#include "Statistics.mpp"
// Custom includes
#include <float.h>
+#include <senf/Utils/Console/ParsedCommand.hh>
#include "Range.hh"
#define prefix_ inline
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.") );
}
#include <boost/utility.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/signals.hpp>
-#include "Exception.hh"
#include <senf/Utils/Logger/Logger.hh>
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ScopedDirectory.hh>
#include "StatisticAccumulator.hh"
+#include "Exception.hh"
//#include "Statistics.mpp"
//-/////////////////////////////////////////////////////////////////////////////////////////////////
prefix_ void senf::term::BaseTelnetProtocol::incrementRequestCounter()
{
++ pendingRequests_;
- timeout_.timeout(senf::scheduler::eventTime() + requestTimeout_);
+ timeout_.timeout(scheduler::eventTime() + requestTimeout_);
}
prefix_ bool senf::term::BaseTelnetProtocol::requestsPending()
// Custom includes
#include <vector>
#include <map>
-#include <senf/Socket.hh>
#include <senf/Scheduler/Scheduler.hh>
#include <senf/Scheduler/ClockService.hh>
option_type option_;
std::string data_;
- senf::scheduler::FdEvent inputEvent_;
- senf::scheduler::FdEvent outputEvent_;
+ scheduler::FdEvent inputEvent_;
+ scheduler::FdEvent outputEvent_;
unsigned pendingRequests_;
CPPDEFINES = [ '$expandLogOption' ],
CXXFLAGS = [ '-Wno-long-long', '-fno-strict-aliasing' ],
LINKFLAGS = [ '-rdynamic' ],
- LIBS = [ 'senf$LIBADDSUFFIX', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB',
+ LIBS = [ 'senf$LIBADDSUFFIX', 'rt', '$BOOSTREGEXLIB',
'$BOOSTSIGNALSLIB', '$BOOSTFSLIB' ],
)