namespace {
void run(senf::ClockService::clock_type t) {
- scheduler::TimerEvent timeout(
+ scheduler::TimerEvent timeout (
"test-timeout", &scheduler::terminate, scheduler::now() + t);
ppi::run();
}
//#include "AnnotationRouter.ih"
// Custom includes
-#include "Connectors.hh"
#define prefix_
//-/////////////////////////////////////////////////////////////////////////////////////////////////
#define prefix_
//-/////////////////////////////////////////////////////////////////////////////////////////////////
-senf::ppi::module::CloneSource::CloneSource(senf::Packet const & packet)
+prefix_ senf::ppi::module::CloneSource::CloneSource(senf::Packet const & packet)
: packet_(packet)
{
noroute(output);
output.onRequest(&CloneSource::request);
}
-void senf::ppi::module::CloneSource::request()
+prefix_ void senf::ppi::module::CloneSource::request()
{
output(packet_.clone());
}
-void senf::ppi::module::CloneSource::replacePacket(senf::Packet const & packet)
+prefix_ void senf::ppi::module::CloneSource::replacePacket(senf::Packet const & packet)
{
packet_ = packet;
}
#define HH_SENF_PPI_CloneSource_ 1
// Custom includes
-#include <senf/Packets/Packets.hh>
#include "Module.hh"
#include "Connectors.hh"
// Custom includes
#include <deque>
#include <senf/Utils/safe_bool.hh>
-#include <senf/Packets/Packets.hh>
#include "MonitorModule.hh"
#include "ActiveFeeder.hh"
#include <senf/Utils/Logger/SenfLog.hh>
\brief Events inline non-template implementation */
// Custom includes
-#include <senf/Utils/senfassert.hh>
-#include <senf/PPI/detail/EventBinding.hh>
#define prefix_ inline
//-/////////////////////////////////////////////////////////////////////////////////////////////////
//#include "IdleEvent.ih"
// Custom includes
-#include <senf/Scheduler/Scheduler.hh>
-#include <senf/Utils/Logger/SenfLog.hh>
//#include "IdleEvent.mpp"
#define prefix_
//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::ppi::IdleEvent
-prefix_ senf::ppi::IdleEvent::IdleEvent()
- : timer_ ("senf::ppi::IdleEvent", boost::bind(&IdleEvent::cb,this))
+prefix_ senf::ppi::IdleEvent::IdleEvent(std::string const & name)
+ : timer_ (name.empty() ? "senf::ppi::IdleEvent" : name, boost::bind(&IdleEvent::cb,this))
{}
//-/////////////////////////////////////////////////////////////////////////////////////////////////
: public EventImplementation<>
{
public:
- IdleEvent();
-
- protected:
+ IdleEvent(std::string const & name = "");
private:
virtual void v_enable();
#include "Route.hh"
#include "Connectors.hh"
#include "EventManager.hh"
-#include "ModuleManager.hh"
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>
#include <algorithm>
source.submit(p);
BOOST_CHECK_EQUAL( udpSink.qAlgorithm().size(), 1);
- for( int n = 0; n < 100; n++) {
+ for (int n = 0; n < 100; n++) {
source.submit(p);
}
// queue default size is 64
registerEvent(timer_, &RateAnalyzer::tick);
}
-prefix_ void senf::ppi::module::RateAnalyzer::startStatistics(senf::ClockService::clock_type interval)
+prefix_ void senf::ppi::module::RateAnalyzer::startStatistics(ClockService::clock_type interval)
{
timer_.interval(interval);
- factor_ = double(senf::ClockService::in_nanoseconds(interval)) /
- double(senf::ClockService::in_nanoseconds(
- senf::ClockService::seconds(1)));
+ factor_ = double(ClockService::in_nanoseconds(interval)) /
+ double(ClockService::in_nanoseconds(ClockService::seconds(1)));
}
prefix_ void senf::ppi::module::RateAnalyzer::v_handlePacket(Packet const & p)
#define prefix_
//-/////////////////////////////////////////////////////////////////////////////////////////////////
-senf::ppi::module::RateFilter::RateFilter(senf::ClockService::clock_type interval)
+prefix_ senf::ppi::module::RateFilter::RateFilter(ClockService::clock_type interval)
: timer_(interval)
{
route(input, timer_);
registerEvent(timer_, &RateFilter::timeout);
}
-void senf::ppi::module::RateFilter::timeout()
+prefix_ void senf::ppi::module::RateFilter::timeout()
{
output(input());
}
-senf::ClockService::clock_type senf::ppi::module::RateFilter::interval()
+prefix_ senf::ClockService::clock_type senf::ppi::module::RateFilter::interval()
const
{
return timer_.interval().first;
}
-void senf::ppi::module::RateFilter::interval(senf::ClockService::clock_type interval)
+prefix_ void senf::ppi::module::RateFilter::interval(ClockService::clock_type interval)
{
timer_.interval(interval);
}
SENF_PPI_MODULE(RateFilter);
public:
- RateFilter(senf::ClockService::clock_type interval);
- void interval(senf::ClockService::clock_type interval);
- senf::ClockService::clock_type interval() const;
+ RateFilter(ClockService::clock_type interval);
+ void interval(ClockService::clock_type interval);
+ ClockService::clock_type interval() const;
connector::ActiveInput<> input;
connector::ActiveOutput<> output;
namespace ppi = senf::ppi;
namespace module = ppi::module;
namespace debug = module::debug;
+namespace scheduler = senf::scheduler;
namespace {
- void timeout() {
- senf::scheduler::terminate();
+ void runPPI(senf::ClockService::clock_type t)
+ {
+ scheduler::TimerEvent timeout(
+ "socketSource test timer", &scheduler::terminate, scheduler::now() + t);
+ ppi::run();
}
int base_pid = 0;
senf::UDPv4ClientSocketHandle outputSocket;
outputSocket.writeto(senf::INet4SocketAddress(localhost4str(0)),data);
- senf::scheduler::TimerEvent timer (
- "socketSource test timer", &timeout,
- senf::ClockService::now() + senf::ClockService::milliseconds(100));
- senf::ppi::run();
+ runPPI( senf::ClockService::milliseconds(100));
BOOST_REQUIRE( ! sink.empty() );
BOOST_CHECK_EQUAL( sink.front().data().size(), data.size() );
# include SENF_PARSER()
SENF_PARSER_INHERIT ( WLANInfoElementParser );
// we just skip the value here. If somebody needs the information he has to implement
- // this strange information element hisself.
+ // this strange information element himself.
SENF_PARSER_SKIP ( length(), 0 );
SENF_PARSER_FINALIZE ( WLANSupportedRatesInfoElementParser );
unsigned size (8u);
while (ieee80211_radiotap_iterator_next(&iter) == 0) {
if (iter.is_radiotap_ns &&
- iter.this_arg_index <= int(senf::RadiotapPacketParser::MAX_INDEX))
+ iter.this_arg_index <= int(RadiotapPacketParser::MAX_INDEX))
table[iter.this_arg_index] = iter.this_arg - data;
// We need to set size here in the loop since the iter fields are only valid
// when at least one present bit is set ...
//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::RadiotapPacketType
-prefix_ void senf::RadiotapPacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::RadiotapPacketType::dump(packet p, std::ostream & os)
{
boost::io::ios_all_saver ias(os);
os << "Radiotap:\n"
using mixin::initSize;
static void init(packet p);
- static void dump(packet p, std::ostream &os);
+ static void dump(packet p, std::ostream & os);
static factory_t nextPacketType(packet p);
static optional_range nextPacketRange(packet p);
};
#define prefix_
//-/////////////////////////////////////////////////////////////////////////////////////////////////
-prefix_ void senf::WLANBeaconPacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::WLANBeaconPacketType::dump(packet p, std::ostream & os)
{
boost::io::ios_all_saver ias(os);
os << "WLAN beacon frame:\n"
using mixin::initSize;
using PacketTypeBase::nextPacketRange;
- static void dump(packet p, std::ostream &os);
+ static void dump(packet p, std::ostream & os);
};
/** \brief WLAN Beacon frame packet typedef
seqNumber_1() = 0u | sn;
}
-prefix_ void senf::WLANPacket_MgtFrameType::dump(packet p, std::ostream &os)
+prefix_ void senf::WLANPacket_MgtFrameType::dump(packet p, std::ostream & os)
{
boost::io::ios_all_saver ias(os);
os << "802.11 MAC Management Frame:\n";
<< senf::fieldName("fragment number") << p->fragmentNumber() << "\n";
}
-prefix_ void senf::WLANPacket_CtrlFrameType::dump(packet p, std::ostream &os)
+prefix_ void senf::WLANPacket_CtrlFrameType::dump(packet p, std::ostream & os)
{
boost::io::ios_all_saver ias(os);
os << "802.11 MAC Control Frame:\n";
seqNumber_1() = 0u | sn;
}
-
prefix_ senf::MACAddressParser senf::WLANPacket_DataFrameParser::destinationAddress()
const
{
}
}
-prefix_ void senf::WLANPacket_DataFrameType::dump(packet p, std::ostream &os)
+prefix_ void senf::WLANPacket_DataFrameType::dump(packet p, std::ostream & os)
{
boost::io::ios_all_saver ias(os);
os << "802.11 MAC Data Frame:\n";
using mixin::initSize;
using PacketTypeBase::nextPacketRange;
- static void dump(packet p, std::ostream &os);
+ static void dump(packet p, std::ostream & os);
};
/** \brief WLAN Management frame packet typedef
using mixin::initSize;
using PacketTypeBase::nextPacketRange;
- static void dump(packet p, std::ostream &os);
+ static void dump(packet p, std::ostream & os);
};
/** \brief WLAN Control frame packet typedef
: no_factory();
}
- static void dump(packet p, std::ostream &os);
+ static void dump(packet p, std::ostream & os);
};
/** \brief WLAN Data frame packet typedef
static const boost::uint16_t MESSAGE_ID;
static void validate(packet message) {
- return message->registerRequestCodeTLV().validate();
+ message->registerRequestCodeTLV().validate();
}
};
//-/////////////////////////////////////////////////////////////////////////////////////////////////
// MIHPacketType
-prefix_ void senf::MIHPacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::MIHPacketType::dump(packet p, std::ostream & os)
{
boost::io::ios_all_saver ias(os);
os << "MIH Packet:\n"
throw InvalidMIHPacketException("wrong MIH length: ") << senf::str(p->payloadLength());
if (p.next(senf::nothrow))
MIHMessageRegistry::instance().validate( p->messageId(), p.next());
- } catch (senf::TruncatedPacketException e) {
+ } catch (TruncatedPacketException & e) {
throw InvalidMIHPacketException("truncated MIH message");
}
}
//-/////////////////////////////////////////////////////////////////////////////////////////////////
// MIHGenericPayloadPacketType
-prefix_ void senf::MIHGenericPayloadPacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::MIHGenericPayloadPacketType::dump(packet p, std::ostream & os)
{
boost::io::ios_all_saver ias(os);
os << "MIH Payload (service specific TLVs):\n";
using mixin::initSize;
/** \brief Dump given MIH packet in readable form to given output stream */
- static void dump(packet p, std::ostream &os);
+ static void dump(packet p, std::ostream & os);
static void finalize(packet p);
static factory_t nextPacketType(packet p);
static void validate(packet p);
using mixin::initSize;
/** \brief Dump given MIHGenericPayload in readable form to given output stream */
- static void dump(packet p, std::ostream &os);
+ static void dump(packet p, std::ostream & os);
static void finalize(packet p);
};
prefix_ boost::uint16_t senf::ICMPv6PacketParser::calcChecksum()
const
{
- senf::IPv6Packet ipv6 (packet().rfind<senf::IPv6Packet>(senf::nothrow));
+ IPv6Packet ipv6 (packet().rfind<IPv6Packet>(senf::nothrow));
if (! ipv6) return 0u;
- senf::IpChecksum summer;
+ IpChecksum summer;
//-/////////////////////////////////////////////////////////////////////////////////////////////
// IPv6 pseudo header
summer.feed( ipv6->source().i(),
- ipv6->source().i() + senf::IPv6Packet::Parser::source_t::fixed_bytes );
+ ipv6->source().i() + IPv6Packet::Parser::source_t::fixed_bytes );
// need support for HopByHop routing header -> the destination used here must be the *final*
// destination ...
summer.feed( ipv6->destination().i(),
- ipv6->destination().i() + senf::IPv6PacketParser::destination_t::fixed_bytes );
+ ipv6->destination().i() + IPv6PacketParser::destination_t::fixed_bytes );
// packet length
boost::uint32_t size (data().size());
summer.feed((size>>24)&0xff);
return rv ? rv : 0xffffu;
}
-prefix_ void senf::ICMPv6PacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::ICMPv6PacketType::dump(packet p, std::ostream & os)
{
boost::io::ios_all_saver ias(os);
os << "ICMPv6 protocol:\n"
- << senf::fieldName("type") << unsigned(p->type()) <<"\n"
- << senf::fieldName("code") << unsigned(p->code()) <<"\n"
+ << senf::fieldName("type") << unsigned(p->type()) << "\n"
+ << senf::fieldName("code") << unsigned(p->code()) << "\n"
<< senf::fieldName("checksum")
<< "0x" << std::hex << std::setw(4) << unsigned(p->checksum()) << "\n";
}
<< senf::fieldName("Reserved") << unsigned(p->reserved() )
<<"\n Multicast Address Records:\n";
- senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container cAddrR (p->mcastAddrRecords() );
- senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container::iterator iAddrR (cAddrR.begin() );
+ MLDv2ListenerReport::Parser::mcastAddrRecords_t::container cAddrR (p->mcastAddrRecords() );
+ MLDv2ListenerReport::Parser::mcastAddrRecords_t::container::iterator iAddrR (cAddrR.begin() );
for (; iAddrR != cAddrR.end(); ++iAddrR) {
os << senf::fieldName(" Record Type") << unsigned(iAddrR->recordType()) << "\n"
<< senf::fieldName(" Multicast Address") << iAddrR->mcAddress() << "\n"
<< " Source Addresses\n:";
- senf::MLDv2AddressRecordParser::srcAddresses_t::container cSrcAddr (iAddrR->srcAddresses());
- senf::MLDv2AddressRecordParser::srcAddresses_t::container::iterator iSrcAddr (cSrcAddr.begin());
+ MLDv2AddressRecordParser::srcAddresses_t::container cSrcAddr (iAddrR->srcAddresses());
+ MLDv2AddressRecordParser::srcAddresses_t::container::iterator iSrcAddr (cSrcAddr.begin());
for (;iSrcAddr != cSrcAddr.end();++iSrcAddr)
os << " " << *iSrcAddr << "\n";
os << " Auxiliary Data:\n";
- senf::MLDv2AddressRecordParser::auxData_t::container cAuxD ( iAddrR->auxData() );
- senf::MLDv2AddressRecordParser::auxData_t::container::iterator iAuxD (cAuxD.begin() );
+ MLDv2AddressRecordParser::auxData_t::container cAuxD ( iAddrR->auxData() );
+ MLDv2AddressRecordParser::auxData_t::container::iterator iAuxD (cAuxD.begin() );
for (;iAuxD != cAuxD.end(); ++iAuxD)
os << " " << *iAuxD << "\n";
}
using mixin::init;
using mixin::initSize;
- static void dump(packet p, std::ostream &os);
+ static void dump(packet p, std::ostream & os);
};
typedef RTPPacketType::packet RTPPacket;
template <class Parser>
prefix_ Parser senf::GenericTLVParserBase<Base>::init()
{
- senf::PacketParserBase::size_type oldSize (bytes() );
- senf::PacketParserBase::size_type newParserSize ( senf::init_bytes<Parser>::value );
+ PacketParserBase::size_type oldSize (bytes() );
+ PacketParserBase::size_type newParserSize ( senf::init_bytes<Parser>::value );
this->resize( oldSize, newParserSize);
std::fill(this->i(), boost::next(this->i(), newParserSize), 0u);
Parser concreteParser = Parser(this->i(), this->state() );
} else {
boost::io::ios_all_saver ias(os);
os << " GenericTLVParser<" << prettyName(typeid(Base)) << ">\n"
- << " type: " << senf::format::dumpint(this->type()) << "\n"
- << " length: " << senf::format::dumpint(this->length()) << "\n"
+ << " type: " << format::dumpint(this->type()) << "\n"
+ << " length: " << format::dumpint(this->length()) << "\n"
<< " value:\n";
hexdump(value().begin(), value().end(), os);
}
prefix_ senf::PacketInterpreterBase::range senf::GenericTLVParserBase<Base>::value()
const
{
- senf::PacketData::iterator begin ( boost::next(this->i(), senf::bytes( self())) );
+ PacketData::iterator begin ( boost::next(this->i(), senf::bytes( self())) );
return PacketInterpreterBase::range(begin, boost::next( begin, this->length()) );
}
container c (*this);
typename container::iterator i (c.begin());
typename container::iterator const e (c.end());
- for(; i!=e; ++i)
+ for (; i!=e; ++i)
i->init();
}
{
if (p.data().size() < 8)
return no_factory();
- senf::PacketInterpreterBase::factory_t f (no_factory());
+ PacketInterpreterBase::factory_t f (no_factory());
if (p->type() < 1536) {
PacketRegistry<senf::ULEExtHeaderTypes>::Entry const * e (
PacketRegistry<senf::ULEExtHeaderTypes>::lookup( p->type(), nothrow ));
const
{
if (!is<OtherPacket>())
- throw WrapException<std::bad_cast>(std::bad_cast());
+ throw WrapException<std::bad_cast>(std::bad_cast())
+ << ": called packet::as() with wrong PacketType: "
+ << (valid() ? typeId().prettyName() : "invalid packet")
+ << " != " << prettyName(typeid(OtherPacket));
return OtherPacket(ptr()->as<typename OtherPacket::type>());
}
senf::Packet packet (FooPacket::create());
BarPacket::createAfter(packet);
+ BOOST_CHECK_THROW( senf::Packet().as<BarPacket>(), senf::WrapException<std::bad_cast> );
+ BOOST_CHECK_THROW( packet.as<BarPacket>(), senf::WrapException<std::bad_cast> );
+
BOOST_REQUIRE( packet );
BOOST_CHECK( packet.next() );
BOOST_CHECK( ! packet.next().next(senf::nothrow) );
out = 0;
std::string value;
{
- senf::console::CheckedArgumentIteratorWrapper arg (tokens);
- senf::console::parse( *(arg++), value );
+ console::CheckedArgumentIteratorWrapper arg (tokens);
+ console::parse( *(arg++), value );
}
static boost::sregex_iterator::regex_type rx ("[mun]?[dhms]");
boost::sregex_iterator i (value.begin(), value.end(), rx);
case 'm': v *= 60.0;
case 's': v *= 1000000000.0;
}
- out += senf::ClockService::nanoseconds(senf::ClockService::int64_type(v));
+ out += ClockService::nanoseconds(ClockService::int64_type(v));
j = match.second;
}
if (j != value.end())
- throw senf::console::SyntaxErrorException();
+ throw console::SyntaxErrorException();
}
prefix_ void senf::formatClockServiceInterval(ClockService::clock_type interval,
prefix_ void senf::scheduler::detail::FIFORunner::run()
{
- for(;;) {
+ for (;;) {
TaskList::iterator f (tasks_.begin());
TaskList::iterator l (TaskList::current(highPriorityEnd_));
run(f, l);
maxSize_(maxSize), predicate_(predicate), callback_(cb), errno_(0), complete_(false)
{
// Here we add a *static* member taking a *smart* pointer as first
- // argumnet instead of a simple bound-member as callback to the
+ // argument instead of a simple bound-member as callback to the
// scheduler. This ensures, that the refcount is at least 1 as
// long as the helper is registered with the scheduler.
}
{
// 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::scheduler::yield()
{
- senf::scheduler::detail::FIFORunner::instance().yield();
+ detail::FIFORunner::instance().yield();
}
prefix_ bool senf::scheduler::running()
prefix_ senf::log::time_type senf::scheduler::LogTimeSource::operator()()
const
{
- return senf::scheduler::now();
+ return scheduler::now();
}
//-/////////////////////////////////////////////////////////////////////////////////////////////////
TimerSet::iterator i (timers_.begin());
TimerSet::iterator const i_end (timers_.end());
for (; i != i_end; ++i)
- senf::scheduler::detail::FIFORunner::instance().dequeue(&(*i));
+ FIFORunner::instance().dequeue(&(*i));
}
void senf::scheduler::detail::TimerDispatcher::add(TimerEvent & event)
{
TimerSet::iterator i (timers_.insert(event));
- senf::scheduler::detail::FIFORunner::instance().enqueue(&(*i));
+ FIFORunner::instance().enqueue(&(*i));
}
prefix_ void senf::scheduler::detail::TimerDispatcher::remove(TimerEvent & event)
TimerSet::iterator i (TimerSet::current(event));
if (i == timers_.end())
return;
- senf::scheduler::detail::FIFORunner::instance().dequeue(&(*i));
+ FIFORunner::instance().dequeue(&(*i));
timers_.erase(i);
}
{
TimerSet::iterator i (timers_.begin());
TimerSet::iterator const i_end (timers_.end());
- ClockService::clock_type now (senf::scheduler::detail::FdManager::instance().eventTime());
+ ClockService::clock_type now (FdManager::instance().eventTime());
for (; i != i_end && i->timeout_ <= now ; ++i)
i->setRunnable();
}
prefix_ senf::scheduler::TimerEvent::~TimerEvent()
{
- if (senf::scheduler::detail::TimerDispatcher::alive())
+ if (detail::TimerDispatcher::alive())
disable();
}
prefix_ void senf::scheduler::TimerEvent::enable()
{
if (! detail::TimerSetBase::linked())
- senf::scheduler::detail::TimerDispatcher::instance().add(*this);
+ detail::TimerDispatcher::instance().add(*this);
}
prefix_ void senf::scheduler::TimerEvent::disable()
{
if (detail::TimerSetBase::linked())
- senf::scheduler::detail::TimerDispatcher::instance().remove(*this);
+ detail::TimerDispatcher::instance().remove(*this);
}
prefix_ void senf::scheduler::TimerEvent::action(Callback const & cb)
{
if (pipe(timerPipe_) < 0)
SENF_THROW_SYSTEM_EXCEPTION("pipe()");
- senf::scheduler::detail::FdManager::instance().set(
- timerPipe_[0], detail::FdManager::EV_READ, this);
+ FdManager::instance().set( timerPipe_[0], FdManager::EV_READ, this);
sigemptyset(&sigSet_);
sigaddset(&sigSet_, SIGALRM);
timer_delete(timerId_);
::signal(SIGALRM, SIG_IGN);
sigprocmask(SIG_UNBLOCK, &sigSet_, 0);
- senf::scheduler::detail::FdManager::instance().remove(timerPipe_[0]);
+ FdManager::instance().remove(timerPipe_[0]);
close(timerPipe_[0]);
close(timerPipe_[1]);
}
timerfd_ = timerfd_create(CLOCK_MONOTONIC, 0);
if (timerfd_ < 0)
SENF_THROW_SYSTEM_EXCEPTION("timerfd_create()");
- senf::scheduler::detail::FdManager::instance().set(
- timerfd_, detail::FdManager::EV_READ, this);
+ FdManager::instance().set( timerfd_, FdManager::EV_READ, this);
}
prefix_ senf::scheduler::detail::TimerFDTimerSource::~TimerFDTimerSource()
{
- senf::scheduler::detail::FdManager::instance().remove(timerfd_);
+ FdManager::instance().remove(timerfd_);
close(timerfd_);
}
prefix_ senf::DVBSectionProtocolWrapper::DVBSectionProtocolWrapper(senf::DVBDemuxSectionHandle sh)
: protocol(sh.protocol()), dir(this)
{
- namespace kw = senf::console::kw;
- namespace fty = senf::console::factory;
+ namespace kw = console::kw;
+ namespace fty = console::factory;
dir.add("buffersize", fty::Command(&DVBSectionProtocolWrapper::setBufferSize, this)
.doc("Set the size of the circular buffer used for filtered data.")
prefix_ senf::DVBPESProtocolWrapper::DVBPESProtocolWrapper(senf::DVBDemuxPESHandle sh)
: protocol(sh.protocol()), dir(this)
{
- namespace kw = senf::console::kw;
- namespace fty = senf::console::factory;
+ namespace kw = console::kw;
+ namespace fty = console::factory;
dir.add("filter",
fty::Command<void (unsigned short int,
prefix_ void senf::DVBSocketController::initConsole()
{
- namespace fty = senf::console::factory;
- namespace kw = senf::console::kw;
+ namespace fty = console::factory;
+ namespace kw = console::kw;
dir.doc("DVB Controller " + controllerNr);
++controllerNr;
{
struct in_addr ina;
if (::inet_pton(AF_INET,s.c_str(),&ina) > 0)
- return senf::INet4Address::from_inaddr(ina.s_addr);
+ return INet4Address::from_inaddr(ina.s_addr);
if (s.empty())
throw AddressSyntaxException() << ": empty string";
throw UnknownHostnameException(s);
// We are only interested in the first address ...
- return senf::INet4Address::from_inaddr(
+ return INet4Address::from_inaddr(
reinterpret_cast<in_addr*>(*(ent->h_addr_list))->s_addr);
}
{
struct in6_addr ina;
if (::inet_pton(AF_INET6,s.c_str(),&ina) > 0)
- return senf::INet6Address::from_data(&ina.s6_addr[0]);
+ return INet6Address::from_data(&ina.s6_addr[0]);
if (s.empty())
throw AddressSyntaxException() << ": empty string";
if (ent && ent->h_addrtype == AF_INET6)
// We are only interested in the first address ...
- return senf::INet6Address::from_data(
+ return INet6Address::from_data(
&reinterpret_cast<in6_addr*>(*(ent->h_addr_list))->s6_addr[0]);
if (resolve == ResolveINet4)
prefix_ void senf::detail::apply_mask(unsigned bits, ForwardIterator b, ForwardIterator e,
Function fn)
{
- for(; bits>8 && b != e; bits -= 8, ++b)
+ for (; bits>8 && b != e; bits -= 8, ++b)
fn(*b, boost::lambda::make_const(0xFFu));
if (bits > 0 && b != e)
fn( *(b++), boost::lambda::make_const(~ low_bits_mask(8-bits)));
- for(; b != e; ++b)
+ for (; b != e; ++b)
fn(*b, boost::lambda::make_const(0u));
}
ForwardIterator1 e1, ForwardIterator2 b2,
Function fn)
{
- for(; bits>8 && b1 != e1; bits -= 8, ++b1, ++b2)
+ for (; bits>8 && b1 != e1; bits -= 8, ++b1, ++b2)
if (fn(*b1, *b2, boost::lambda::make_const(0xFFu)))
return b1;
if (bits > 0 && b1 != e1)
if (fn(*b1, *b2, boost::lambda::make_const(~ low_bits_mask(8-bits))))
return b1;
- for(++b1, ++b2; b1 != e1; ++b1, ++b2)
+ for (++b1, ++b2; b1 != e1; ++b1, ++b2)
if (fn(*b1, *b2, boost::lambda::make_const(0u)))
return b1;
return e1;
/**< This override will automatically \c shutdown() the
socket whenever it is called. Additionally it will
disable SO_LINGER to ensure, that v_terminate will not
- block. Like the overriden method, this member will ignore
- failures and will never throw. It therefore safe to be
- called from a destructor. */
+ block. Like the overridden method, this member will
+ ignore failures and will never throw. It therefore
+ safe to be called from a destructor. */
///\name Abstract Interface Implementation
//\{
// Custom includes
#include <sstream>
-#include <sys/socket.h>
#include <senf/Utils/TypeInfo.hh>
//#include "SocketHandle.mpp"
map["file.refcount"] << refcount();
map["socket.server"] << isServer();
map["socket.protocol"] << v_protocolName();
- map["socket.protocol.policy"] << prettyName(typeid(protocol().policy()));
+ map["socket.protocol.policy"] << prettyName(typeid(protocol().policy()));
protocol().state(map,lod);
}
#include "SocketHandle.ih"
// Custom includes
-#include <senf/Utils/senfassert.hh>
#include "SocketProtocol.hh"
#define prefix_ inline
prefix_ senf::SocketHandle<SPolicy>::SocketHandle(FileHandle other, bool isChecked)
: FileHandle(other)
{
- SENF_ASSERT( isChecked, "Inrernal failure: Wrong overload called !!" );
+ SENF_ASSERT( isChecked, "Internal failure: Wrong overload called !!" );
SENF_ASSERT( ! valid() || dynamic_cast<SocketBody *>(&FileHandle::body()),
"Internal failure: Replacing or re-assigning non-empty incompatible handle");
}
template <class T>
StreamableString & operator<<(T const & other);
- ///< Value assigment
+ ///< Value assignment
/**< This operator will assign the string from any
arbitrary type. It will use boost::lexical_cast to
convert the argument to its string representation.
socket whenever it is closed.
\throws senf::SystemException */
virtual void v_terminate(); ///< Forcibly close socket
- /**< This override will automatically \c shutfown() the
+ /**< This override will automatically \c shutdown() the
socket whenever it is called. Additionally it will
disable SO_LINGER to ensure, that v_terminate will not
- block. Like the overriden method, this member will ignore
- failures and will never throw. It therefore safe to be
- called from a destructor. */
+ block. Like the overridden method, this member will
+ ignore failures and will never throw. It therefore
+ safe to be called from a destructor. */
virtual bool v_eof() const; ///< Check for eof condition
/**< Since the eof check for sockets is very protocol
dependent, this member will forward the call to
\brief SocketProtocol and ConcreteSocketProtocol non-inline non-template implementation
*/
-#include <sys/socket.h>
#include "SocketProtocol.hh"
//#include "SocketProtocol.ih"
// Custom includes
+#include <sys/socket.h>
//#include "SocketProtocol.mpp"
#define prefix_
/** \defgroup concrete_protocol_group Protocol Implementations (Concrete Protocol Classes)
\ingroup protocol_group
- Theese protocol classes define concrete and complete protocol implementations. They inherit from
+ These protocol classes define concrete and complete protocol implementations. They inherit from
ConcreteSocketProtocol and are used with the ProtocolClientSocketHandle and
ProtocolServerSocketHandle templates to instantiate socket handles. Appropriate typedefs are
always provided.
/**< This override will automatically \c shutdown() the
socket whenever it is called. Additionally it will
disable SO_LINGER to ensure, that v_terminate will not
- block. Like the overriden method, this member will ignore
- failures and will never throw. It is therefore safe to be
- called from a destructor.
+ block. Like the overridden method, this member will
+ ignore failures and will never throw. It is therefore
+ safe to be called from a destructor.
\fixme Move into (at least) BSDSocketProtocol */
virtual void state(SocketStateMap & map, unsigned lod) const;
// This MUST BE root() not chroot() since restriction does NOT follow symlinks.
// Therefore, if chroot() is a directory of symlinks, restricting to it will
// execute NOTHING.
- executor_.restrict_ = senf::console::root().thisptr();
+ executor_.restrict_ = console::root().thisptr();
}
prefix_ senf::console::detail::RestrictedExecutor::RestrictGuard::
{
if (! std::uncaught_exception())
executor_.insertParsedNode( *executor_.restrict_ );
- executor_.restrict_ = senf::console::root().thisptr();
+ executor_.restrict_ = console::root().thisptr();
}
//-/////////////////////////////////////////////////////////////////////////////////////////////////
{
# define HELP_COLUMN 28
- unsigned width (senf::console::Client::getWidth(output, 80u, 60u)-(HELP_COLUMN+1));
+ unsigned width (Client::getWidth(output, 80u, 60u)-(HELP_COLUMN+1));
Path dir (cwd_);
traverseDirectory(path, dir);
DirectoryNode & node (*dir.back().lock());
traverseDirectory(path, dir);
DirectoryNode & node (*dir.back().lock());
NodesMap nodes;
- dolr(output, senf::console::Client::getWidth(output, 80u, 60u)-(HELP_COLUMN+1),
+ dolr(output, Client::getWidth(output, 80u, 60u)-(HELP_COLUMN+1),
nodes, "", 0, node);
}
prefix_ senf::console::DirectoryNode & senf::console::root()
{
- static DirectoryNode::ptr rootNode(new DirectoryNode());
+ static DirectoryNode::ptr rootNode (new DirectoryNode());
return *rootNode;
}
detail::ParseDispatcher::BindInfo bind (impl().dispatcher, info);
detail::boost_spirit::parse_info<PositionIterator> result;
- for(;;) {
+ for (;;) {
result = detail::boost_spirit::parse(
b, e, * impl().grammar.use_parser<Impl::Grammar::SkipParser>());
b = result.stop;
present, if there is an argument at the current
index. */
-#ifndef DOXYVEN
-
+#ifndef DOXYGEN
# define BOOST_PP_ITERATION_PARAMS_1 \
(4, (1, BOOST_PARAMETER_MAX_ARITY, \
SENF_ABSOLUTE_INCLUDE_PATH(Utils/Console/ParsedCommand.mpp), \
5))
# include BOOST_PP_ITERATE()
-
#endif
private:
prefix_ senf::console::Client::SysBacktrace::SysBacktrace()
{
- namespace fty = senf::console::factory;
+ namespace fty = console::factory;
sysdir().add("backtrace", fty::Command(&SysBacktrace::backtrace)
.doc("Display the backtrace of the last error / exception in this console") );
IOStreamTarget (getNodename(filename, nodename), ofstream_t::member),
file_ (filename)
{
- namespace fty = senf::console::factory;
+ namespace fty = console::factory;
if (! ofstream_t::member)
SENF_THROW_SYSTEM_EXCEPTION("logfile open") << ": " << filename;
prefix_ senf::log::FileTarget::RegisterConsole::RegisterConsole()
{
- namespace kw = senf::console::kw;
- namespace fty = senf::console::factory;
+ namespace kw = console::kw;
+ namespace fty = console::factory;
detail::TargetRegistry::instance().consoleDir()
.add("file-target", fty::Command(&RegisterConsole::create)
: tag_ (detail::getDefaultTag()), noformat_ (false), showTime_ (true),
showStream_ (false), showLevel_ (true), showArea_ (true), timeBase_ (-1)
{
- namespace kw = senf::console::kw;
- namespace fty = senf::console::factory;
+ namespace kw = console::kw;
+ namespace fty = console::factory;
timeFormat("%Y-%m-%d %H:%M:%S.%f-0000");
prefix_ senf::log::SyslogTarget::RegisterConsole::RegisterConsole()
{
- namespace kw = senf::console::kw;
- namespace fty = senf::console::factory;
+ namespace kw = console::kw;
+ namespace fty = console::factory;
detail::TargetRegistry::instance().consoleDir()
.add("syslog-target",fty::Command(&RegisterConsole::create)
private:
struct RegisterConsole {
RegisterConsole();
- static boost::shared_ptr<senf::console::DirectoryNode> create(
+ static boost::shared_ptr<console::DirectoryNode> create(
LogFacility facility);
static RegisterConsole instance;
};
prefix_ void senf::log::SyslogUDPTarget::init()
{
- namespace kw = senf::console::kw;
- namespace fty = senf::console::factory;
+ namespace kw = console::kw;
+ namespace fty = console::factory;
consoleDir().remove("format");
consoleDir()
// or message will not inadvertently be interpreted as date or hostname by a receiving syslog
// daemon or proxy
if (syslogFormat_)
- prfstream << '<' << (facility_ | senf::log::SyslogTarget::LEVELMAP[level]) << "> ";
+ prfstream << '<' << (facility_ | SyslogTarget::LEVELMAP[level]) << "> ";
prfstream << prefix(timestamp, stream, area, level);
std::string const & prf (prfstream.str());
prefix_ senf::log::SyslogUDPTarget::RegisterConsole::RegisterConsole()
{
- namespace kw = senf::console::kw;
- namespace fty = senf::console::factory;
+ namespace kw = console::kw;
+ namespace fty = console::factory;
detail::TargetRegistry::instance().consoleDir()
.add("udp-target",
- fty::Command<senf::console::DirectoryNode::ptr (*)(INet4SocketAddress const &,
+ fty::Command<console::DirectoryNode::ptr (*)(INet4SocketAddress const &,
LogFacility)
>(&RegisterConsole::create)
.arg("address", "target address to send log messages to")
" }\n") );
detail::TargetRegistry::instance().consoleDir()
.add("udp-target",
- fty::Command<senf::console::DirectoryNode::ptr (*)(INet4Address const &,
- LogFacility)
+ fty::Command<console::DirectoryNode::ptr (*)(INet4Address const &, LogFacility)
>(&RegisterConsole::create)
.arg("address")
.arg("facility", kw::default_value = USER) );
detail::TargetRegistry::instance().consoleDir()
.add("udp-target",
- fty::Command<senf::console::DirectoryNode::ptr (*)(INet6SocketAddress const &,
- LogFacility)
+ fty::Command<console::DirectoryNode::ptr (*)(INet6SocketAddress const &, LogFacility)
>(&RegisterConsole::create)
.arg("address")
.arg("facility", kw::default_value = USER) );
detail::TargetRegistry::instance().consoleDir()
.add("udp-target",
- fty::Command<senf::console::DirectoryNode::ptr (*)(INet6Address const &,
- LogFacility)
+ fty::Command<console::DirectoryNode::ptr (*)(INet6Address const &, LogFacility)
>(&RegisterConsole::create)
.arg("address")
.arg("facility", kw::default_value = USER) );
}
prefix_ boost::shared_ptr<senf::console::DirectoryNode>
-senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet4SocketAddress const & target,
+senf::log::SyslogUDPTarget::RegisterConsole::create(INet4SocketAddress const & target,
LogFacility facility)
{
std::auto_ptr<Target> tp (new SyslogUDPTarget(target, facility));
}
prefix_ boost::shared_ptr<senf::console::DirectoryNode>
-senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet4Address const & target,
+senf::log::SyslogUDPTarget::RegisterConsole::create(INet4Address const & target,
LogFacility facility)
{
std::auto_ptr<Target> tp (new SyslogUDPTarget(target, facility));
}
prefix_ boost::shared_ptr<senf::console::DirectoryNode>
-senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet6SocketAddress const & target,
+senf::log::SyslogUDPTarget::RegisterConsole::create(INet6SocketAddress const & target,
LogFacility facility)
{
std::auto_ptr<Target> tp (new SyslogUDPTarget(target, facility));
}
prefix_ boost::shared_ptr<senf::console::DirectoryNode>
-senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet6Address const & target,
+senf::log::SyslogUDPTarget::RegisterConsole::create(INet6Address const & target,
LogFacility facility)
{
std::auto_ptr<Target> tp (new SyslogUDPTarget(target, facility));
#define prefix_ inline
//-/////////////////////////////////////////////////////////////////////////////////////////////////
-prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(senf::INet4Address const & target,
- int facility)
+prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet4Address const & target, int facility)
: Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
- handle_ ( senf::ConnectedUDPv4ClientSocketHandle(senf::INet4SocketAddress(target, 514u)) ),
+ handle_ ( ConnectedUDPv4ClientSocketHandle(INet4SocketAddress(target, 514u)) ),
syslogFormat_ (true)
{
init();
}
-prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(senf::INet4SocketAddress const & target,
- int facility)
+prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet4SocketAddress const & target, int facility)
: Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
- handle_ ( senf::ConnectedUDPv4ClientSocketHandle(target) ),
+ handle_ ( ConnectedUDPv4ClientSocketHandle(target) ),
syslogFormat_ (true)
{
init();
}
-prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(senf::INet6Address const & target,
- int facility)
+prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet6Address const & target, int facility)
: Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
- handle_ ( senf::ConnectedUDPv6ClientSocketHandle(senf::INet6SocketAddress(target, 514u)) ),
+ handle_ ( ConnectedUDPv6ClientSocketHandle(INet6SocketAddress(target, 514u)) ),
syslogFormat_ (true)
{
init();
}
-prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(senf::INet6SocketAddress const & target,
- int facility)
+prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet6SocketAddress const & target, int facility)
: Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
- handle_ ( senf::ConnectedUDPv6ClientSocketHandle(target) ),
+ handle_ ( ConnectedUDPv6ClientSocketHandle(target) ),
syslogFormat_ (true)
{
init();
///\name Structors and default members
//\{
- explicit SyslogUDPTarget(senf::INet4Address const & target, int facility = LOG_USER);
- explicit SyslogUDPTarget(senf::INet4SocketAddress const & target, int facility = LOG_USER);
- explicit SyslogUDPTarget(senf::INet6Address const & target, int facility = LOG_USER);
- explicit SyslogUDPTarget(senf::INet6SocketAddress const & target, int facility = LOG_USER);
+ explicit SyslogUDPTarget(INet4Address const & target, int facility = LOG_USER);
+ explicit SyslogUDPTarget(INet4SocketAddress const & target, int facility = LOG_USER);
+ explicit SyslogUDPTarget(INet6Address const & target, int facility = LOG_USER);
+ explicit SyslogUDPTarget(INet6SocketAddress const & target, int facility = LOG_USER);
//\}
//-////////////////////////////////////////////////////////////////////////
struct RegisterConsole {
RegisterConsole();
- static boost::shared_ptr<senf::console::DirectoryNode> create(
- senf::INet4SocketAddress const & target, LogFacility facility = USER);
- static boost::shared_ptr<senf::console::DirectoryNode> create(
- senf::INet4Address const & target, LogFacility facility = USER);
- static boost::shared_ptr<senf::console::DirectoryNode> create(
- senf::INet6SocketAddress const & target, LogFacility facility = USER);
- static boost::shared_ptr<senf::console::DirectoryNode> create(
- senf::INet6Address const & target, LogFacility facility = USER);
+ static boost::shared_ptr<console::DirectoryNode> create(
+ INet4SocketAddress const & target, LogFacility facility = USER);
+ static boost::shared_ptr<console::DirectoryNode> create(
+ INet4Address const & target, LogFacility facility = USER);
+ static boost::shared_ptr<console::DirectoryNode> create(
+ INet6SocketAddress const & target, LogFacility facility = USER);
+ static boost::shared_ptr<console::DirectoryNode> create(
+ INet6Address const & target, LogFacility facility = USER);
static RegisterConsole instance;
};
};
prefix_ senf::log::Target::Target(std::string const & name)
{
- namespace kw = senf::console::kw;
- namespace fty = senf::console::factory;
+ namespace kw = console::kw;
+ namespace fty = console::factory;
detail::TargetRegistry::instance().registerTarget(this, name);
consoleDir_()
unsigned limit (DISABLED::value);
RIB::iterator i (rib_.begin());
RIB::iterator const i_end (rib_.end());
- for(; i != i_end; ++i)
+ for (; i != i_end; ++i)
if ( (! i->stream_ || i->stream_ == stream) &&
(! i->area_ || i->area_ == area) &&
i->action_ == ACCEPT ) {
prefix_ void senf::log::detail::TargetRegistry::dynamicTarget(std::auto_ptr<Target> target)
{
- namespace fty = senf::console::factory;
+ namespace fty = console::factory;
target->consoleDir()
.add("remove", fty::Command<void ()>(
prefix_ senf::log::detail::TargetRegistry::TargetRegistry()
: fallbackRouting_(true)
{
- namespace kw = senf::console::kw;
- namespace fty = senf::console::factory;
+ namespace kw = console::kw;
+ namespace fty = console::factory;
console::sysdir().add("log", consoleDir_());
consoleDir_()
#endif
{
#ifndef SENF_DISABLE_CONSOLE
- namespace fty = senf::console::factory;
+ namespace fty = console::factory;
dir.add("list", fty::Command(&Statistics::consoleList, this)
.doc("List statistics collection intervals and current values.\n"
"the last 5 minutes.")
.arg("rank","Rank chain selecting the value to generate output for")
.arg("window","Optional size of sliding average window",
- senf::console::kw::default_value = 1u) );
+ console::kw::default_value = 1u) );
#endif
}
prefix_ void senf::StatisticsBase::OutputEntry::initDir()
{
- namespace fty = senf::console::factory;
-
+ namespace fty = console::factory;
dir.add("list", fty::Command(&OutputEntry::consoleList, this)
.doc("List all known connected targets. This list might not be complete.") );
}
// senf::detail::StatisticsLoggerRegistry
prefix_ void
-senf::detail::StatisticsLoggerRegistry::apply(senf::StatisticsBase & stats,
- unsigned rank,
- senf::console::DirectoryNode & dir)
+senf::detail::StatisticsLoggerRegistry::apply(StatisticsBase & stats,
+ unsigned rank, console::DirectoryNode & dir)
{
Adders::const_iterator i (adders_.begin());
Adders::const_iterator const i_end (adders_.end());
RegisterStatisticsLogger();
static void adder(senf::StatisticsBase & stats,
- unsigned rank,
- senf::console::DirectoryNode & dir);
+ unsigned rank, senf::console::DirectoryNode & dir);
static void consoleCreate(senf::StatisticsBase & stats,
- unsigned rank,
- std::string const & prefix);
+ unsigned rank, std::string const & prefix);
};
RegisterStatisticsLogger registerStatisticsLogger;
}
prefix_ void RegisterStatisticsLogger::adder(senf::StatisticsBase & stats,
- unsigned rank,
- senf::console::DirectoryNode & dir)
+ unsigned rank, senf::console::DirectoryNode & dir)
{
namespace kw = senf::console::kw;
namespace fty = senf::console::factory;
-
dir.add("logger", fty::Command<void (std::string const &)>(
boost::bind(&consoleCreate, boost::ref(stats), rank, _1))
.arg("prefix","Optional prefix string to add to each log message",
}
prefix_ void RegisterStatisticsLogger::consoleCreate(senf::StatisticsBase & stats,
- unsigned rank,
- std::string const & prefix)
+ unsigned rank, std::string const & prefix)
{
stats.output(rank).connect(senf::StatisticsLogger(prefix),
"senf::StatisticsLogger(\"" + prefix + "\")");
optional \a label string may be specified which will be added as prefix to all log entries.
The log stream defaults to senf::StatisticsStream, the level defaults to
- senf::log::MESSAGE and the are defaults to senf::log::DefaultArea.
+ senf::log::MESSAGE and the area defaults to senf::log::DefaultArea.
\code
// Connect with default parameters
prefix_ senf::term::BaseEditor::BaseEditor(AbstractTerminal & terminal)
: terminal_ (&terminal),
- keyTimeout_ (senf::ClockService::milliseconds(DEFAULT_KEY_TIMEOUT_MS)),
+ keyTimeout_ (ClockService::milliseconds(DEFAULT_KEY_TIMEOUT_MS)),
timer_ ("senf::term::BaseEditor::keySequenceTimeout",
- senf::membind(&BaseEditor::keySequenceTimeout, this)),
+ membind(&BaseEditor::keySequenceTimeout, this)),
column_ (0u), displayHeight_ (1u), line_ (0u)
{
terminal_->setCallbacks(*this);
prefix_ void senf::term::BaseEditor::cb_charReceived(char c)
{
inputBuffer_ += c;
- timer_.timeout(senf::scheduler::eventTime() + keyTimeout_);
+ timer_.timeout(scheduler::eventTime() + keyTimeout_);
processKeys();
}
prefix_ void senf::term::BaseEditor::processKeys()
{
do {
- std::pair<senf::term::KeyParser::keycode_t, std::string::size_type> result
+ std::pair<KeyParser::keycode_t, std::string::size_type> result
(keyParser_.lookup(inputBuffer_));
- if (result.first == senf::term::KeyParser::Incomplete)
+ if (result.first == KeyParser::Incomplete)
return;
v_keyReceived(result.first);
inputBuffer_.erase(0, result.second);
prefix_ senf::term::BaseTelnetProtocol::BaseTelnetProtocol(Handle handle)
: handle_ (handle), charState_ (NORMAL), command_ (CMD_NONE), option_ (0),
inputEvent_ ("senf::term::BaseTelnetProtocol::input",
- senf::membind(&BaseTelnetProtocol::readHandler, this), handle,
- senf::scheduler::FdEvent::EV_READ),
+ membind(&BaseTelnetProtocol::readHandler, this), handle,
+ scheduler::FdEvent::EV_READ),
outputEvent_ ("senf::term::BaseTelnetProtocol::output",
- senf::membind(&BaseTelnetProtocol::writeHandler, this), handle,
- senf::scheduler::FdEvent::EV_WRITE, false),
+ membind(&BaseTelnetProtocol::writeHandler, this), handle,
+ scheduler::FdEvent::EV_WRITE, false),
pendingRequests_ (0u),
requestTimeout_ (ClockService::milliseconds(DEFAULT_REQUEST_TIMEOUT_MS)),
timeout_ ("senf::term::BaseTelnetProtocol::configTimeout",
- senf::membind(&BaseTelnetProtocol::timeout, this))
+ membind(&BaseTelnetProtocol::timeout, this))
{}
prefix_ senf::term::BaseTelnetProtocol::BaseTelnetProtocol()
prefix_ void senf::term::BaseTelnetProtocol::readHandler(int state)
{
- if (state != senf::scheduler::FdEvent::EV_READ || handle_.eof()) {
+ if (state != scheduler::FdEvent::EV_READ || handle_.eof()) {
inputEvent_.disable();
v_eof();
return;
prefix_ void senf::term::BaseTelnetProtocol::writeHandler(int state)
{
- if (state != senf::scheduler::FdEvent::EV_WRITE) {
+ if (state != scheduler::FdEvent::EV_WRITE) {
outputEvent_.disable();
inputEvent_.disable();
v_eof();
*/
#define SENF_PP_SEQ_BACK(seq) BOOST_PP_SEQ_ELEM(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)),seq)
-# // No recursive call so we need some more of theese ... ARGH !!!
+# // No recursive call so we need some more of these ... ARGH !!!
# define SENF_CAT_RECURS1(a, b) SENF_CAT_RECURS1_I(a,b)
# define SENF_CAT_RECURS1_I(a, b) a ## b
# define SENF_CAT_RECURS2(a, b) SENF_CAT_RECURS2_I(a,b)