\li Simple functions to manage daemon processes
\li Standard exception classes
- \li satcom::lib::intrusive_refcount to simplify the implementation
+ \li senf::intrusive_refcount to simplify the implementation
of classes usable with boost::intrusive_ptr
\li boost::bind extensions
\li An interface to the \c g++ demangler integrated with type_info
environment. Included are a number of templates to help
bootstrapping a new project or component.
- \see <a href="../../satscons/doc/html/index.html">SENFSCons
+ \see <a href="../../senfscons/doc/html/index.html">SENFSCons
reference</a>
*/
The default editor (probably VI) will be started with the current
value of the svn:externals property (which will probably be
- empty). Now add all the modules you want plus \c satscons and
+ empty). Now add all the modules you want plus \c senfscons and
possibly \c doclib (if you want to build the documentation). You
will almost certainly neeed the \c Utils module, since all other
modules depend on it.
module, the file will look like
<pre class="fragment">
- satscons http://svn.berlios.de/svnroot/repos/senf/trunk/satscons
+ senfscons http://svn.berlios.de/svnroot/repos/senf/trunk/senfscons
Utils http://svn.berlios.de/svnroot/repos/senf/trunk/Utils
Scheduler http://svn.berlios.de/svnroot/repos/senf/trunk/Scheduler
Socket http://svn.berlios.de/svnroot/repos/senf/trunk/Socket</pre>
\section new_conf Configuring SENFSCons
To set up the build environment, copy the
- <tt>satscons/SConstruct.template</tt> to <tt>Satscons</tt> in the
+ <tt>senfscons/SConstruct.template</tt> to <tt>Satscons</tt> in the
project root. The default setup of this file is to build all
subdirectories (using the \c SConscript files of the
subdirectories). You can add additonal global targets and
If you want to use a non-default compiler or the boost library is
not installed in the system directories, you will have to copy
- <tt>satscons/SConfig.template</tt> to <tt>SConfig</tt> in the
+ <tt>senfscons/SConfig.template</tt> to <tt>SConfig</tt> in the
project root and edit it there. You should \e never add \c SConfig
to the repository since it should only contain local settings
necessary for building on your local system. You should therefore
<pre class="fragment">
$ scons -u [target]</pre>
- \see <a href="../../satscons/doc/html/index.html">SENFSCons reference</a> \n
+ \see <a href="../../senfscons/doc/html/index.html">SENFSCons reference</a> \n
<a class="ext" href="http://www.scons.org/documentation.php">SCons documentation</a> \n
<a class="ext" href="http://svnbook.red-bean.com">Subversion online book</a> \n
<a class="ext" href="http://subversion.tigris.org">Subversion Homepage</a>
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::pkf::DataPacket::v_nextInterpreter()
+prefix_ void senf::DataPacket::v_nextInterpreter()
const
{}
-prefix_ void satcom::pkf::DataPacket::v_finalize()
+prefix_ void senf::DataPacket::v_finalize()
{}
-prefix_ void satcom::pkf::DataPacket::v_dump(std::ostream & os)
+prefix_ void senf::DataPacket::v_dump(std::ostream & os)
const
{
os << "Payload:\n"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Arg>
-prefix_ satcom::pkf::DataPacket::DataPacket(Arg const & arg)
+prefix_ senf::DataPacket::DataPacket(Arg const & arg)
: Packet(arg)
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
/** \brief Non-interpreted Packet
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "DataPacket.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cc.p////////////////////////////////////////
namespace {
- namespace pkf = satcom::pkf;
- pkf::PacketRegistry<pkf::EtherTypes>::RegistrationProxy<pkf::EthVLanPacket>
+ senf::PacketRegistry<senf::EtherTypes>::RegistrationProxy<senf::EthVLanPacket>
registerEthVLanPacket(0x8100);
}
-prefix_ void satcom::pkf::EthernetPacket::v_nextInterpreter()
+prefix_ void senf::EthernetPacket::v_nextInterpreter()
const
{
// TODO: Add LLC/SNAP support -> only use the registry
namespace {
- void dumpmac(std::ostream & os, satcom::pkf::EthernetPacket::Parse_MAC mac)
+ void dumpmac(std::ostream & os, senf::EthernetPacket::Parse_MAC mac)
{
for (unsigned i = 0; i < 6; ++i) {
if (i > 0)
}
-prefix_ void satcom::pkf::EthernetPacket::v_dump(std::ostream & os)
+prefix_ void senf::EthernetPacket::v_dump(std::ostream & os)
const
{
if (type() <= 1500)
<< unsigned(type()) << "\n" << std::dec;
}
-prefix_ void satcom::pkf::EthernetPacket::v_finalize()
+prefix_ void senf::EthernetPacket::v_finalize()
{}
-prefix_ void satcom::pkf::EthVLanPacket::v_nextInterpreter()
+prefix_ void senf::EthVLanPacket::v_nextInterpreter()
const
{
// TODO: Add LLC/SNAP support -> only use the registry
registerInterpreter(type(),begin()+bytes(),end());
}
-prefix_ void satcom::pkf::EthVLanPacket::v_finalize()
+prefix_ void senf::EthVLanPacket::v_finalize()
{}
-prefix_ void satcom::pkf::EthVLanPacket::v_dump(std::ostream & os)
+prefix_ void senf::EthVLanPacket::v_dump(std::ostream & os)
const
{
os << "Ethernet 802.1q (VLAN):\n"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Arg>
-prefix_ satcom::pkf::EthernetPacket::EthernetPacket(Arg const & arg)
+prefix_ senf::EthernetPacket::EthernetPacket(Arg const & arg)
: Packet(arg)
{}
template <class Arg>
-prefix_ satcom::pkf::EthVLanPacket::EthVLanPacket(Arg const & arg)
+prefix_ senf::EthVLanPacket::EthVLanPacket(Arg const & arg)
: Packet(arg)
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "EthernetPacket.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
template <class Iterator=nil, class IPacket=nil>
struct Parse_Ethernet : public ParserBase<Iterator,IPacket>
friend class Packet;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::pkf;
+using namespace senf;
BOOST_AUTO_UNIT_TEST(ethernetPacket_parser)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
static retrieval function:
template <class T>
- struct satcom::vtable::impl::TypeRegistry
+ struct senf::vtable::impl::TypeRegistry
{
static unsigned id() {
- static satcom::vtable::impl::AutoTypeId typeid;
+ static senf::vtable::impl::AutoTypeId typeid;
return typeid.id();
}
};
- struct satcom::vtable::impl::AutoTypeId
+ struct senf::vtable::impl::AutoTypeId
{
AutoTypeId() : id(nextAutoTypeId()) {}
unsigned id;
This setup will assign id's uniquely. The Id's will be ordered by the
first TypeRegistry::id() call. To get the Type id of a type, just call
-satcom::vtable::impl::TypeRegistry<SomeType>::id().
+senf::vtable::impl::TypeRegistry<SomeType>::id().
The above is bogus ... we don't register the extensible types, we
register the extensions which are arbitrary types.
///////////////////////////////ct.p////////////////////////////////////////
template <unsigned HEADER, unsigned TRAILER>
-prefix_ void satcom::pkf::GenericPacket<HEADER,TRAILER>::v_nextInterpreter()
+prefix_ void senf::GenericPacket<HEADER,TRAILER>::v_nextInterpreter()
const
{
this->registerInterpreter<DataPacket>(this->end_header(), this->begin_trailer());
}
template <unsigned HEADER, unsigned TRAILER>
-prefix_ void satcom::pkf::GenericPacket<HEADER,TRAILER>::v_finalize()
+prefix_ void senf::GenericPacket<HEADER,TRAILER>::v_finalize()
{}
template <unsigned HEADER, unsigned TRAILER>
-prefix_ void satcom::pkf::GenericPacket<HEADER,TRAILER>::v_dump(std::ostream & os)
+prefix_ void senf::GenericPacket<HEADER,TRAILER>::v_dump(std::ostream & os)
const
{
// TODO: implement v_dump()
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
template <unsigned HEADER, unsigned TRAILER>
template <class Arg>
-prefix_ satcom::pkf::GenericPacket<HEADER,TRAILER>::GenericPacket(Arg const & arg)
+prefix_ senf::GenericPacket<HEADER,TRAILER>::GenericPacket(Arg const & arg)
: Packet(arg)
{}
template <unsigned HEADER, unsigned TRAILER>
-prefix_ void satcom::pkf::GenericPacket<HEADER,TRAILER>::init()
+prefix_ void senf::GenericPacket<HEADER,TRAILER>::init()
{
insert(begin(),HEADER,0);
insert(end(),TRAILER,0);
}
template <unsigned HEADER, unsigned TRAILER>
-prefix_ typename satcom::pkf::GenericPacket<HEADER,TRAILER>::iterator
-satcom::pkf::GenericPacket<HEADER,TRAILER>::begin_header()
+prefix_ typename senf::GenericPacket<HEADER,TRAILER>::iterator
+senf::GenericPacket<HEADER,TRAILER>::begin_header()
const
{
return this->begin();
}
template <unsigned HEADER, unsigned TRAILER>
-prefix_ typename satcom::pkf::GenericPacket<HEADER,TRAILER>::iterator
-satcom::pkf::GenericPacket<HEADER,TRAILER>::end_header()
+prefix_ typename senf::GenericPacket<HEADER,TRAILER>::iterator
+senf::GenericPacket<HEADER,TRAILER>::end_header()
const
{
return this->begin() + HEADER;
}
template <unsigned HEADER, unsigned TRAILER>
-prefix_ typename satcom::pkf::GenericPacket<HEADER,TRAILER>::size_type
-satcom::pkf::GenericPacket<HEADER,TRAILER>::header_len()
+prefix_ typename senf::GenericPacket<HEADER,TRAILER>::size_type
+senf::GenericPacket<HEADER,TRAILER>::header_len()
{
return HEADER;
}
template <unsigned HEADER, unsigned TRAILER>
-prefix_ typename satcom::pkf::GenericPacket<HEADER,TRAILER>::iterator
-satcom::pkf::GenericPacket<HEADER,TRAILER>::begin_trailer()
+prefix_ typename senf::GenericPacket<HEADER,TRAILER>::iterator
+senf::GenericPacket<HEADER,TRAILER>::begin_trailer()
const
{
return this->end() - TRAILER;
}
template <unsigned HEADER, unsigned TRAILER>
-prefix_ typename satcom::pkf::GenericPacket<HEADER,TRAILER>::iterator
-satcom::pkf::GenericPacket<HEADER,TRAILER>::end_trailer()
+prefix_ typename senf::GenericPacket<HEADER,TRAILER>::iterator
+senf::GenericPacket<HEADER,TRAILER>::end_trailer()
const
{
return this->end();
}
template <unsigned HEADER, unsigned TRAILER>
-prefix_ typename satcom::pkf::GenericPacket<HEADER,TRAILER>::size_type
-satcom::pkf::GenericPacket<HEADER,TRAILER>::trailer_len()
+prefix_ typename senf::GenericPacket<HEADER,TRAILER>::size_type
+senf::GenericPacket<HEADER,TRAILER>::trailer_len()
{
return TRAILER;
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
/** \brief General packet comprised of header, trailer and payload
friend class Packet;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "GenericPacket.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cc.p////////////////////////////////////////
namespace {
- namespace pkf = satcom::pkf;
- pkf::PacketRegistry<pkf::EtherTypes>::RegistrationProxy<pkf::IpV4Packet>
+ senf::PacketRegistry<senf::EtherTypes>::RegistrationProxy<senf::IpV4Packet>
registerIpV4Packet(0x0800);
}
-prefix_ void satcom::pkf::IpV4Packet::v_nextInterpreter()
+prefix_ void senf::IpV4Packet::v_nextInterpreter()
const
{
registerInterpreter(protocol(),begin()+bytes(),end());
}
-prefix_ void satcom::pkf::IpV4Packet::v_finalize()
+prefix_ void senf::IpV4Packet::v_finalize()
{}
-prefix_ void satcom::pkf::IpV4Packet::v_dump(std::ostream & os)
+prefix_ void senf::IpV4Packet::v_dump(std::ostream & os)
const
{
struct in_addr in;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Arg>
-prefix_ satcom::pkf::IpV4Packet::IpV4Packet(Arg const & arg)
+prefix_ senf::IpV4Packet::IpV4Packet(Arg const & arg)
: Packet(arg)
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "IpV4Packet.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
template <class Iterator=nil, class IpV4Packet=nil>
struct Parse_IpV4 : public ParserBase<Iterator,IpV4Packet>
friend class Packet;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::pkf;
+using namespace senf;
BOOST_AUTO_UNIT_TEST(ipV4Packet_parser)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
--- /dev/null
+/** \mainpage The SENF Packet Library
+
+ \section arch Overall Architecture
+
+ The general Architecture of the Packet Framework (pkf for short)
+ is seperated into two components: The basic packet handling and
+ the parser framework.
+
+ The basic packet handling implements a packet interpreter
+ chain. Every packet is represented as a chain of interpreters
+ where each interpreter is a facade looking into the same
+ packet. Each interpreter will interpret a specific header of a
+ packet. For example, an ethernet frame might have an interpreter
+ chain consisting of EthernetPacket, IPPacket, UDPPacket and
+ DataPacket. Each of these interpreters will interpret a section of
+ the raw data bytes. The interpreter ranges overlap since every
+ packet also includes it's payload.
+
+ The parser framework is used to interpret the raw bytes of a
+ specific packet and parse the values present in that packet. For
+ example, Parse_Ethernet will parse the ethernet source MAC,
+ destination MAC and ethertype given any random access iterator to
+ the first byte of the ethernet frame. Parsers are extremely light
+ classes. They are temporary classes passed around by value. In
+ most cases, they are just comprised of a single pointer adorned
+ with type information.
+
+ \section handling Packet Handling
+
+ The packet handling is implemented within
+ senf::Packet. This class is the baseclass to all packet
+ interpreter facades. To implement a new packet type, publically
+ derive from senf::Packet and implement the virtual
+ interface (see the class documentation for details).
+
+ \section framework Parser Framework
+
+ The parser framework provides an abstract framwork to parse packet
+ oriented data. A Parser is a template class taking an arbitrary
+ iterator as input and allowing random access to data elements of
+ the interpreted type, like source and destination MAC of an
+ ethernet frame. The parser framework is to be used hierarchically
+ and recursively, the parser methods should return further parsers
+ which can return further parsers and so on.
+
+ The parser framework contains some basic parsers to be used to
+ build up more complex parsers:
+
+ - ParseInt.hh: Lots of parsers for integer numbers like
+ senf::Parse_UInt8, for integer bitfields like
+ senf::Parse_UIntField and senf::Parse_Flag to
+ parse boolean flags.
+
+ - ParseArray.hh: The senf::Parse_Array parser to parse
+ arbitrary fixed-size arrays of fixed-size elements (that is
+ sub-parsers).
+
+ - ParseVec.hh: The senf::Parse_Vector parser to parse
+ dynamically sized arrays of fixed-size elements (that is
+ sub-parsers).
+
+ See senf::ParserBase for further information.
+
+ \section stuff Other Utilities
+
+ The pkf also comprises some additional utilities to support the
+ development of packet classes.
+
+ The senf::PacketRegistry implements a registry of packets
+ keyed by an arbitrary type. The registry is used to find a packet
+ type given some kind of id (like the ethertype value from the
+ ethernet header). Together with it's support classes (especially
+ senf::PacketRegistryMixin) this class greatly simplifies
+ implementing the needed table lookups.
+ */
+
+\f
+// Local Variables:
+// mode: c++
+// mode: flyspell
+// mode: auto-fill
+// ispell-local-dictionary: "american"
+// End:
// This is the custom deleter used for the pointers in the
// interpreters list. This deleter is only called, when the Packet is
// removed from the interpreters list.
-prefix_ void satcom::pkf::impl::ListPacketDeleter::operator()(Packet * p)
+prefix_ void senf::impl::ListPacketDeleter::operator()(Packet * p)
{
PacketImpl * impl = PacketImpl::impl(p);
if (impl->releaseInterpreter(p))
// struct PacketImpl
-prefix_ satcom::pkf::Packet::interpreter_list::iterator
-satcom::pkf::impl::PacketImpl::appendInterpreter(Packet * p)
+prefix_ senf::Packet::interpreter_list::iterator
+senf::impl::PacketImpl::appendInterpreter(Packet * p)
{
BOOST_ASSERT( p->impl_ == 0 );
return p->self_;
}
-prefix_ satcom::pkf::Packet::interpreter_list::iterator
-satcom::pkf::impl::PacketImpl::prependInterpreter(Packet * p)
+prefix_ senf::Packet::interpreter_list::iterator
+senf::impl::PacketImpl::prependInterpreter(Packet * p)
{
BOOST_ASSERT( p->impl_ == 0 );
SATCOM_PKF_REFC_MSG("] PacketImpl::prependInterpreter (" << this << "): refcount_ = " << refcount_ << "\n");
p->impl_ = this;
this->interpreters_.push_front(
- boost::shared_ptr<Packet>(p, pkf::impl::ListPacketDeleter()));
+ boost::shared_ptr<Packet>(p, impl::ListPacketDeleter()));
p->self_ = this->interpreters_.begin();
return p->self_;
// Called, whenever a Packet is removed from the list by the
// ListPacketDeleter;
-prefix_ bool satcom::pkf::impl::PacketImpl::releaseInterpreter(Packet * p)
+prefix_ bool senf::impl::PacketImpl::releaseInterpreter(Packet * p)
{
// We have to be extra careful here: This method might be called
// AFTER the PacketImpl instance has already been destructed while
}
namespace {
- bool whenceCmp(unsigned a, unsigned b, bool end, satcom::pkf::Packet::Whence whence)
+ bool whenceCmp(unsigned a, unsigned b, bool end, senf::Packet::Whence whence)
{
- using satcom::pkf::Packet;
+ using senf::Packet;
return ((whence == Packet::OUTSIDE && ! end)
|| whence == Packet::BEFORE
|| (whence == Packet::INSIDE && end)) ? a>=b : a>b;
}
prefix_ void
-satcom::pkf::impl::PacketImpl::updateIterators(Packet::size_type index,
+senf::impl::PacketImpl::updateIterators(Packet::size_type index,
Packet::difference_type n,
Packet::interpreter_list::iterator self,
Packet::Whence whence)
}
}
-prefix_ void satcom::pkf::impl::PacketImpl::packet_add_ref(Packet const * p)
+prefix_ void senf::impl::PacketImpl::packet_add_ref(Packet const * p)
{
p->add_ref();
if (p->impl_)
p->impl_->add_ref();
}
-prefix_ void satcom::pkf::impl::PacketImpl::packet_release(Packet * p)
+prefix_ void senf::impl::PacketImpl::packet_release(Packet * p)
{
bool del (p->release());
if (p->impl_ && p->impl_->release())
///////////////////////////////////////////////////////////////////////////
// class Packet
-prefix_ satcom::pkf::Packet::ptr satcom::pkf::Packet::next()
+prefix_ senf::Packet::ptr senf::Packet::next()
const
{
interpreter_list::iterator n = boost::next(this->self_);
return ptr(n->get(),true);
}
-prefix_ satcom::pkf::Packet::ptr satcom::pkf::Packet::last()
+prefix_ senf::Packet::ptr senf::Packet::last()
const
{
Packet * p = this->impl_->interpreters_.back().get();
return ptr(p,true);
}
-prefix_ void satcom::pkf::Packet::i_registerInterpreter(Packet * p)
+prefix_ void senf::Packet::i_registerInterpreter(Packet * p)
const
{
BOOST_ASSERT( !p->impl_ );
this->parsed_ = true;
}
-prefix_ void satcom::pkf::Packet::i_replaceInterpreter(Packet * p)
+prefix_ void senf::Packet::i_replaceInterpreter(Packet * p)
{
BOOST_ASSERT( !p->impl_ );
// We need to increment the refcount of impl_ beforehand,
impl->appendInterpreter(p);
}
-prefix_ void satcom::pkf::Packet::i_setInterpreter(impl::PacketImpl * i)
+prefix_ void senf::Packet::i_setInterpreter(impl::PacketImpl * i)
{
// Using prependInterpreter makes this usable for both, the
// create-from-data and wrap-packet constructors
i->prependInterpreter(this);
}
-prefix_ void satcom::pkf::Packet::insert(iterator pos, byte v, Whence whence)
+prefix_ void senf::Packet::insert(iterator pos, byte v, Whence whence)
{
size_type index(pos-impl_->data_.begin());
BOOST_ASSERT( index >= begin_ && index <= end_);
impl_->updateIterators(index,1,self_,whence);
}
-prefix_ void satcom::pkf::Packet::insert(iterator pos, size_type n, byte v, Whence whence)
+prefix_ void senf::Packet::insert(iterator pos, size_type n, byte v, Whence whence)
{
size_type index(pos-impl_->data_.begin());
BOOST_ASSERT( index >= begin_ && index <= end_ );
impl_->updateIterators(index,n,self_,whence);
}
-prefix_ void satcom::pkf::Packet::erase(iterator pos)
+prefix_ void senf::Packet::erase(iterator pos)
{
size_type index(pos-impl_->data_.begin());
BOOST_ASSERT( index >= begin_ && index < end_ );
impl_->updateIterators(index,-1,self_,INSIDE);
}
-prefix_ void satcom::pkf::Packet::erase(iterator first, iterator last)
+prefix_ void senf::Packet::erase(iterator first, iterator last)
{
size_type index(first-impl_->data_.begin());
size_type sz(last-first);
impl_->updateIterators(index,-sz,self_,INSIDE);
}
-prefix_ void satcom::pkf::Packet::dump(std::ostream & os)
+prefix_ void senf::Packet::dump(std::ostream & os)
const
{
v_dump(os);
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ satcom::pkf::impl::PacketImpl::PacketImpl()
+prefix_ senf::impl::PacketImpl::PacketImpl()
: data_(), interpreters_(), refcount_(1)
{
SATCOM_PKF_REFC_MSG("] PacketImpl::PacketImpl (" << this << "): refcount_ = 1\n");
}
-prefix_ satcom::pkf::impl::PacketImpl::PacketImpl(unsigned size, Packet::byte initValue)
+prefix_ senf::impl::PacketImpl::PacketImpl(unsigned size, Packet::byte initValue)
: data_(size,initValue), interpreters_(), refcount_(1)
{
SATCOM_PKF_REFC_MSG("] PacketImpl::PacketImpl (" << this << "): refcount_ = 1\n");
}
-prefix_ satcom::pkf::impl::PacketImpl::~PacketImpl()
+prefix_ senf::impl::PacketImpl::~PacketImpl()
{
BOOST_ASSERT( !refcount_ );
SATCOM_PKF_REFC_MSG("] PacketImpl::~PacketImpl (" << this << ")\n");
// PacketImpl::add_ref and PacketImpl::release are only called from
// intrusive_ptr_add_ref and intrusive_ptr_release
-prefix_ void satcom::pkf::impl::PacketImpl::add_ref()
+prefix_ void senf::impl::PacketImpl::add_ref()
{
++refcount_;
SATCOM_PKF_REFC_MSG("] PacketImpl::add_ref (" << this << "): refcount_ = " << refcount_ << "\n");
}
-prefix_ bool satcom::pkf::impl::PacketImpl::release()
+prefix_ bool senf::impl::PacketImpl::release()
{
BOOST_ASSERT( refcount_ > 0 );
--refcount_;
return ! refcount_;
}
-prefix_ void satcom::pkf::impl::PacketImpl::truncateInterpreters(Packet const * p)
+prefix_ void senf::impl::PacketImpl::truncateInterpreters(Packet const * p)
{
BOOST_ASSERT( p->impl_ == this );
this->interpreters_.erase(p->self_,this->interpreters_.end());
}
-prefix_ void satcom::pkf::impl::PacketImpl::truncateInterpretersAfter(Packet const * p)
+prefix_ void senf::impl::PacketImpl::truncateInterpretersAfter(Packet const * p)
{
BOOST_ASSERT( p->impl_ == this );
this->interpreters_.erase(boost::next(p->self_),this->interpreters_.end());
}
-prefix_ satcom::pkf::impl::PacketImpl* satcom::pkf::impl::PacketImpl::impl(Packet const * p)
+prefix_ senf::impl::PacketImpl* senf::impl::PacketImpl::impl(Packet const * p)
{
return p->impl_;
}
/*
-prefix_ std::ostream & satcom::pkf::operator<<(std::ostream & os, Packet const & packet)
+prefix_ std::ostream & senf::operator<<(std::ostream & os, Packet const & packet)
{
packet.dump(os);
return os;
// These methods are called by the user codes Packet::ptr's. They
// refcount both the Packet and the owning PacketImpl.
-prefix_ void satcom::pkf::intrusive_ptr_add_ref(Packet const * p)
+prefix_ void senf::intrusive_ptr_add_ref(Packet const * p)
{
impl::PacketImpl::packet_add_ref(p);
}
-prefix_ void satcom::pkf::intrusive_ptr_release(Packet * p)
+prefix_ void senf::intrusive_ptr_release(Packet * p)
{
impl::PacketImpl::packet_release(p);
}
-prefix_ void satcom::pkf::impl::intrusive_ptr_add_ref(PacketImpl * p)
+prefix_ void senf::impl::intrusive_ptr_add_ref(PacketImpl * p)
{
p->add_ref();
}
-prefix_ void satcom::pkf::impl::intrusive_ptr_release(PacketImpl * p)
+prefix_ void senf::impl::intrusive_ptr_release(PacketImpl * p)
{
if (p->release())
delete p;
///////////////////////////////////////////////////////////////////////////
// class Packet
-prefix_ satcom::pkf::Packet::iterator satcom::pkf::Packet::begin()
+prefix_ senf::Packet::iterator senf::Packet::begin()
const
{
return impl_->data_.begin()+begin_;
}
-prefix_ satcom::pkf::Packet::iterator satcom::pkf::Packet::end()
+prefix_ senf::Packet::iterator senf::Packet::end()
const
{
return impl_->data_.begin()+end_;
}
-prefix_ size_t satcom::pkf::Packet::size()
+prefix_ size_t senf::Packet::size()
const
{
return end_-begin_;
}
-prefix_ satcom::pkf::Packet::ptr satcom::pkf::Packet::prev()
+prefix_ senf::Packet::ptr senf::Packet::prev()
const
{
if (this->self_ == this->impl_->interpreters_.begin())
return ptr(boost::prior(this->self_)->get(),true);
}
-prefix_ satcom::pkf::Packet::ptr satcom::pkf::Packet::head()
+prefix_ senf::Packet::ptr senf::Packet::head()
const
{
// Re-converting the to a smart pointer is correct here, since the
return ptr(this->impl_->interpreters_.front().get(),true);
}
-prefix_ satcom::pkf::Packet::~Packet()
+prefix_ senf::Packet::~Packet()
{
// FIXME: This is bad ... we cannot check this since this
// assertion fails at the moment if the Packet constructor throws
SATCOM_PKF_REFC_MSG("] Packet::~Packet (" << this << ")\n");
}
-prefix_ void satcom::pkf::Packet::add_ref()
+prefix_ void senf::Packet::add_ref()
const
{
++this->refcount_;
SATCOM_PKF_REFC_MSG("] Packet::add_ref (" << this << "): refcount_ = " << this->refcount_ << "\n");
}
-prefix_ bool satcom::pkf::Packet::release()
+prefix_ bool senf::Packet::release()
{
BOOST_ASSERT( this->refcount_ > 0 );
--this->refcount_;
return !this->refcount_ && !this->impl_;
}
-prefix_ bool satcom::pkf::Packet::unlink()
+prefix_ bool senf::Packet::unlink()
{
SATCOM_PKF_REFC_MSG("] Packet::unlink (" << this << "): refcount_ = " << this->refcount_ << "\n");
this->impl_ = 0;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ct.p////////////////////////////////////////
template <class OtherPacket, class InputIterator>
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr
-satcom::pkf::Packet::create(InputIterator b, InputIterator e)
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr
+senf::Packet::create(InputIterator b, InputIterator e)
{
boost::intrusive_ptr<impl::PacketImpl> impl (new impl::PacketImpl(b,e),false);
if (!check<OtherPacket>(impl->data_.begin(),impl->data_.end()))
}
template <class OtherPacket>
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr satcom::pkf::Packet::create()
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr senf::Packet::create()
{
boost::intrusive_ptr<impl::PacketImpl> impl (
new impl::PacketImpl(min_bytes<OtherPacket>(),0));
}
template <class OuterPacket>
-prefix_ typename satcom::pkf::Packet::ptr_t<OuterPacket>::ptr
-satcom::pkf::Packet::create(Packet::ptr payload)
+prefix_ typename senf::Packet::ptr_t<OuterPacket>::ptr
+senf::Packet::create(Packet::ptr payload)
{
// TODO: should I instead of using head() throw away all
// interpreters before payload? ... probably yes ...
}
template <class OtherPacket>
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr satcom::pkf::Packet::reinterpret()
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr senf::Packet::reinterpret()
{
// THIS INVALIDATES this !!!!!!!
if (!check<OtherPacket>(begin(),end()))
}
template <class OtherPacket>
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr
-satcom::pkf::Packet::registerInterpreter(raw_container::iterator begin,
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr
+senf::Packet::registerInterpreter(raw_container::iterator begin,
raw_container::iterator end)
const
{
#include BOOST_PP_ITERATE()
template <class OtherPacket>
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr satcom::pkf::Packet::find_next()
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr senf::Packet::find_next()
const
{
ptr p (next());
}
template <class OtherPacket>
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr satcom::pkf::Packet::find_prev()
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr senf::Packet::find_prev()
const
{
ptr p (prev());
}
template <class OtherPacket>
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr satcom::pkf::Packet::get_next()
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr senf::Packet::get_next()
const
{
typename ptr_t<OtherPacket>::ptr p (find_next<OtherPacket>());
}
template <class OtherPacket>
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr satcom::pkf::Packet::get_prev()
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr senf::Packet::get_prev()
const
{
typename ptr_t<OtherPacket>::ptr p (find_prev<OtherPacket>());
}
template <class InputIterator>
-prefix_ void satcom::pkf::Packet::insert(iterator pos, InputIterator f, InputIterator l,
+prefix_ void senf::Packet::insert(iterator pos, InputIterator f, InputIterator l,
Whence whence)
{
size_type index(pos-impl_->data_.begin());
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <typename OtherPacket>
-prefix_ bool satcom::pkf::Packet::is()
+prefix_ bool senf::Packet::is()
const
{
return dynamic_cast<OtherPacket const *>(this);
}
template <typename OtherPacket>
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr satcom::pkf::Packet::as()
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr senf::Packet::as()
{
return typename ptr_t<OtherPacket>::ptr(dynamic_cast<OtherPacket*>(this),true);
}
// This constructor appends a new interreter to the interpreter chain
// of an existing Packet
template <class Operation>
-prefix_ satcom::pkf::Packet::Packet(Operation const & arg)
+prefix_ senf::Packet::Packet(Operation const & arg)
: impl_(0), begin_(arg.begin()), end_(arg.end()), self_(),
parsed_(false), refcount_(1)
{
}
template <class InputIterator>
-prefix_ satcom::pkf::impl::PacketImpl::PacketImpl(InputIterator begin, InputIterator end)
+prefix_ senf::impl::PacketImpl::PacketImpl(InputIterator begin, InputIterator end)
: data_(begin, end), interpreters_(), refcount_(1)
{
SATCOM_PKF_REFC_MSG("] PacketImpl::PacketImpl (" << this << "): refcount_ = 1\n")
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
// beginning. This really is just another type of deque
// implementation.
-
-/** \mainpage The SENF Packet Library
-
- \section arch Overall Architecture
-
- The general Architecture of the Packet Framework (pkf for short)
- is seperated into two components: The basic packet handling and
- the parser framework.
-
- The basic packet handling implements a packet interpreter
- chain. Every packet is represented as a chain of interpreters
- where each interpreter is a facade looking into the same
- packet. Each interpreter will interpret a specific header of a
- packet. For example, an ethernet frame might have an interpreter
- chain consisting of EthernetPacket, IPPacket, UDPPacket and
- DataPacket. Each of these interpreters will interpret a section of
- the raw data bytes. The interpreter ranges overlap since every
- packet also includes it's payload.
-
- The parser framework is used to interpret the raw bytes of a
- specific packet and parse the values present in that packet. For
- example, Parse_Ethernet will parse the ethernet source MAC,
- destination MAC and ethertype given any random access iterator to
- the first byte of the ethernet frame. Parsers are extremely light
- classes. They are temporary classes passed around by value. In
- most cases, they are just comprised of a single pointer adorned
- with type information.
-
- \section handling Packet Handling
-
- The packet handling is implemented within
- satcom::pkf::Packet. This class is the baseclass to all packet
- interpreter facades. To implement a new packet type, publically
- derive from satcom::pkf::Packet and implement the virtual
- interface (see the class documentation for details).
-
- \section framework Parser Framework
-
- The parser framework provides an abstract framwork to parse packet
- oriented data. A Parser is a template class taking an arbitrary
- iterator as input and allowing random access to data elements of
- the interpreted type, like source and destination MAC of an
- ethernet frame. The parser framework is to be used hierarchically
- and recursively, the parser methods should return further parsers
- which can return further parsers and so on.
-
- The parser framework contains some basic parsers to be used to
- build up more complex parsers:
-
- - ParseInt.hh: Lots of parsers for integer numbers like
- satcom::pkf::Parse_UInt8, for integer bitfields like
- satcom::pkf::Parse_UIntField and satcom::pkf::Parse_Flag to
- parse boolean flags.
-
- - ParseArray.hh: The satcom::pkf::Parse_Array parser to parse
- arbitrary fixed-size arrays of fixed-size elements (that is
- sub-parsers).
-
- - ParseVec.hh: The satcom::pkf::Parse_Vector parser to parse
- dynamically sized arrays of fixed-size elements (that is
- sub-parsers).
-
- See satcom::pkf::ParserBase for further information.
-
- \section stuff Other Utilities
-
- The pkf also comprises some additional utilities to support the
- development of packet classes.
-
- The satcom::pkf::PacketRegistry implements a registry of packets
- keyed by an arbitrary type. The registry is used to find a packet
- type given some kind of id (like the ethertype value from the
- ethernet header). Together with it's support classes (especially
- satcom::pkf::PacketRegistryMixin) this class greatly simplifies
- implementing the needed table lookups.
- */
-
/** \file
\brief Main packet interface
*/
#include "Packet.mpp"
// ////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
namespace impl { template <class OtherPacket> class PkReg_EntryImpl; }
namespace impl { class PacketImpl; }
This class is the base class of all Packets. It implements the
generic Packet interface and provides the packet management
- framework. satcom::pkf::Packet manages the necessary memory
+ framework. senf::Packet manages the necessary memory
resources and controlls the chain of packet interpreters.
The Packet user always interfaces with the pkf via a Packet
\code
class ExamplePacket
- : public satcom::pkf::Packet
+ : public senf::Packet
{
public:
typedef ptr_t<ExamplePacket>::ptr ptr;
private:
template <class Arg>
ExamplePacket(Arg arg [, other args ... ])
- : satcom::pkf::Packet(arg)
+ : senf::Packet(arg)
{}
virtual void v_nextInterpreter() const
// calculate checksum etc
}
- friend class satcom::pkf::Packet;
+ friend class senf::Packet;
};
\endcode
Please do not implement the methods inline to not clutter up
the header file. This is done here in the example to simplify
it. If a class is to be registered in some
- satcom:pkf::PacketRegistry, it must not take any additional
+ senf:PacketRegistry, it must not take any additional
constructor parameters.
After having implemented the bare framework, the most comman
\code
class ExamplePacket
- : public satcom::pkf::Packet,
- public Parse_Example<satcom::pkf::Packet::iterator,
+ : public senf::Packet,
+ public Parse_Example<senf::Packet::iterator,
ExamplePacket>
{
private:
template <class InputIterator>
ExamplePacket(InputIterator begin, InputIterator end)
- : satcom::pkf::Packet(begin,end)
+ : senf::Packet(begin,end)
{}
};
\endcode
- See the satcom::pkf::ParserBase Documentation for how to
+ See the senf::ParserBase Documentation for how to
implement Parse_Example.
The implementation of v_nextInterpreter most of the time
relies on some packet registry. This is simplified using the
- satcom::pkf::PacketRegistryMixin class as follows. Again, we
+ senf::PacketRegistryMixin class as follows. Again, we
only show the differences from the preceding Example:
\code
};
class ExamplePacket
- : public satcom::pkf::Packet,
- public Parse_Example<satcom::pkf::Packet::iterator,
+ : public senf::Packet,
+ public Parse_Example<senf::Packet::iterator,
ExamplePacket>,
- public satcom::pkf::PacketRegistryMixin<ExampleRegistry,
+ public senf::PacketRegistryMixin<ExampleRegistry,
ExamplePacket>
{
- using satcom::pkf::Packet::registerInterpreter;
- using satcom::pkf::PacketRegsitryMixin<ExampleRegistry,ExamplePacket>::registerInterpreter;
+ using senf::Packet::registerInterpreter;
+ using senf::PacketRegsitryMixin<ExampleRegistry,ExamplePacket>::registerInterpreter;
private:
virtual void v_nextInterpreter() const
{
\endcode
For further details on the packet registry, see
- satcom::pkf::PacketRegistry.
+ senf::PacketRegistry.
\section packet_impl Implementation details
imporved by either allocating some headroom/tailroom in the
vector and using this when inserting data at the beginning or
end. Alternatively, a new container class (like the
- satcom::lib::deque_list) could be used to support zero-copy
+ senf::deque_list) could be used to support zero-copy
semantics.
At the moment, we leave the implementation at
typedef std::vector<byte> raw_container;
typedef boost::shared_ptr<Packet> interpreter_list_ptr;
- typedef std::list<satcom::pkf::Packet::interpreter_list_ptr> interpreter_list;
+ typedef std::list<senf::Packet::interpreter_list_ptr> interpreter_list;
typedef unsigned refcount_t;
///@}
instance. The new instance is automatically added to the
interpreter chain after the current interpreter.
- See also satcom::pkf::PacketRegistryMixin on how to
+ See also senf::PacketRegistryMixin on how to
use a Registry to find the next interpreters implementing
class.
*/
struct TruncatedPacketException : public std::exception
{ virtual char const * what() const throw() { return "truncated packet"; } };
-}}
+}
// ////////////////////////////hh.e////////////////////////////////////////
#include "Packet.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define SATCOM_PKF_REFC_MSG(x)
#endif
-namespace satcom {
-namespace pkf {
+namespace senf {
+
namespace impl {
// This deleter is used in the PacketImpl list holding the
// method invocations
void intrusive_ptr_add_ref(PacketImpl * p);
void intrusive_ptr_release(PacketImpl * p);
-}}}
+}}
-struct satcom::pkf::Packet::PacketOp_register
+struct senf::Packet::PacketOp_register
{
size_type b;
size_type e;
{ p->i_registerInterpreter(self); }
};
-struct satcom::pkf::Packet::PacketOp_replace
+struct senf::Packet::PacketOp_replace
{
Packet * p;
{ p->i_replaceInterpreter(self); }
};
-struct satcom::pkf::Packet::PacketOp_set
+struct senf::Packet::PacketOp_set
{
impl::PacketImpl * i;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
// Packet::reinterpret implementation
template <class OtherPacket, BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A) >
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr
-satcom::pkf::Packet::reinterpret( BOOST_PP_ENUM( BOOST_PP_ITERATION(), pkARG, ) )
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr
+senf::Packet::reinterpret( BOOST_PP_ENUM( BOOST_PP_ITERATION(), pkARG, ) )
{
if (!OtherPacket::check(begin(),end()))
throw TruncatedPacketException();
// Packet::registerIterpreter implementation
template <class OtherPacket, BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A) >
-prefix_ typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr
-satcom::pkf::Packet::registerInterpreter(raw_container::iterator begin,
+prefix_ typename senf::Packet::ptr_t<OtherPacket>::ptr
+senf::Packet::registerInterpreter(raw_container::iterator begin,
raw_container::iterator end,
BOOST_PP_ENUM( BOOST_PP_ITERATION(), pkARG, ) )
const
template < class OtherPacket, class InputIterator,
BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A) >
-static typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr create(
+static typename senf::Packet::ptr_t<OtherPacket>::ptr create(
InputIterator b, InputIterator e,
BOOST_PP_ENUM( BOOST_PP_ITERATION(), pkARG, ) );
template < class OtherPacket, class InputIterator,
BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A) >
-typename satcom::pkf::Packet::ptr_t<OtherPacket>::ptr satcom::pkf::Packet::create(
+typename senf::Packet::ptr_t<OtherPacket>::ptr senf::Packet::create(
InputIterator b, InputIterator e,
BOOST_PP_ENUM( BOOST_PP_ITERATION(), pkARG, ) )
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::pkf;
+using namespace senf;
// Since Packet is abstract, we can only test the Packet interface using
// a simple implementation: DataPacket and GenericPacket.
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////PacketRegistry..p////////////////////////////////////////
-satcom::pkf::impl::PkReg_EntryImpl<satcom::pkf::DataPacket>
- satcom::pkf::impl::pkreg_dataEntry;
+senf::impl::PkReg_EntryImpl<senf::DataPacket>
+ senf::impl::pkreg_dataEntry;
///////////////////////////////PacketRegistry..e////////////////////////////////////////
#undef prefix_
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
template <class KeyType>
template <class OtherPacket>
-prefix_ void satcom::pkf::impl::PacketRegistryImpl<KeyType>::registerPacket(key_t key)
+prefix_ void senf::impl::PacketRegistryImpl<KeyType>::registerPacket(key_t key)
{
// If this assertion fails, a Packet was registered with an already known key
BOOST_ASSERT( registry_.insert(std::make_pair(
key, Entry_ptr(new impl::PkReg_EntryImpl<OtherPacket>()))).second );
// If this assertion fails, the same Packet was registered with two different keys
BOOST_ASSERT( reverseRegistry_.insert(
- std::make_pair(satcom::lib::typeIdValue<OtherPacket>(), key)).second );
+ std::make_pair(senf::typeIdValue<OtherPacket>(), key)).second );
}
template <class KeyType>
-prefix_ typename satcom::pkf::impl::PacketRegistryImpl<KeyType>::key_t
-satcom::pkf::impl::PacketRegistryImpl<KeyType>::key(satcom::lib::TypeIdValue const & type)
+prefix_ typename senf::impl::PacketRegistryImpl<KeyType>::key_t
+senf::impl::PacketRegistryImpl<KeyType>::key(senf::TypeIdValue const & type)
{
typename ReversePacketMap::iterator i (reverseRegistry_.find(type));
if (i==reverseRegistry_.end())
template <class OtherPacket>
prefix_ void
-satcom::pkf::impl::PkReg_EntryImpl<OtherPacket>::registerInterpreter(Packet const * p,
+senf::impl::PkReg_EntryImpl<OtherPacket>::registerInterpreter(Packet const * p,
Packet::iterator b,
Packet::iterator e)
{
}
template <class OtherPacket>
-prefix_ satcom::pkf::Packet::ptr
-satcom::pkf::impl::PkReg_EntryImpl<OtherPacket>::reinterpret(Packet * p)
+prefix_ senf::Packet::ptr
+senf::impl::PkReg_EntryImpl<OtherPacket>::reinterpret(Packet * p)
{
return p->template reinterpret<OtherPacket>();
}
template <class KeyType>
-prefix_ typename satcom::pkf::impl::PacketRegistryImpl<KeyType>::Entry *
-satcom::pkf::impl::PacketRegistryImpl<KeyType>::lookup(key_t key)
+prefix_ typename senf::impl::PacketRegistryImpl<KeyType>::Entry *
+senf::impl::PacketRegistryImpl<KeyType>::lookup(key_t key)
{
typename PacketMap::iterator i (registry_.find(key));
if (i==registry_.end())
template <class Tag>
template <class InputIterator>
-prefix_ satcom::pkf::Packet::ptr
-satcom::pkf::PacketRegistry<Tag>::create(typename Tag::key_t key, InputIterator b,
+prefix_ senf::Packet::ptr
+senf::PacketRegistry<Tag>::create(typename Tag::key_t key, InputIterator b,
InputIterator e)
{
Packet::ptr p (Packet::create<DataPacket>(b,e));
}
template <class Tag>
-prefix_ typename satcom::pkf::PacketRegistry<Tag>::Registry &
-satcom::pkf::PacketRegistry<Tag>::registry()
+prefix_ typename senf::PacketRegistry<Tag>::Registry &
+senf::PacketRegistry<Tag>::registry()
{
static Registry registry;
return registry;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
template <class Tag>
template <class OtherPacket>
-prefix_ void satcom::pkf::PacketRegistry<Tag>::registerPacket(typename Tag::key_t key)
+prefix_ void senf::PacketRegistry<Tag>::registerPacket(typename Tag::key_t key)
{
registry().registerPacket<OtherPacket>(key);
}
template <class Tag>
template <class OtherPacket>
-prefix_ satcom::pkf::PacketRegistry<Tag>::RegistrationProxy<OtherPacket>::
+prefix_ senf::PacketRegistry<Tag>::RegistrationProxy<OtherPacket>::
RegistrationProxy(typename Tag::key_t key)
{
PacketRegistry<Tag>::template registerPacket<OtherPacket>(key);
template <class Tag>
template <class OtherPacket>
-prefix_ typename Tag::key_t satcom::pkf::PacketRegistry<Tag>::key()
+prefix_ typename Tag::key_t senf::PacketRegistry<Tag>::key()
{
- return registry().key(satcom::lib::typeIdValue<OtherPacket>());
+ return registry().key(senf::typeIdValue<OtherPacket>());
}
template <class KeyType>
template <class OtherPacket>
prefix_ void
-satcom::pkf::impl::PacketRegistryImpl<KeyType>::registerInterpreter(Packet * p,
+senf::impl::PacketRegistryImpl<KeyType>::registerInterpreter(Packet * p,
Packet::iterator b,
Packet::iterator e)
{
template <class Tag, class Derived>
prefix_ void
-satcom::pkf::PacketRegistryMixin<Tag,Derived>::registerInterpreter(typename Tag::key_t key,
+senf::PacketRegistryMixin<Tag,Derived>::registerInterpreter(typename Tag::key_t key,
Packet::iterator b,
Packet::iterator e)
const
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "PacketRegistry.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
namespace impl { template <class key> class PacketRegistryImpl; }
This mixin class provides a new registerInterpreter
implementation which can be used besides the methods provided
- bei satcom::pkf::Packet to add a new interpreter to the
+ bei senf::Packet to add a new interpreter to the
interpreter chain.
\code
struct PacketTypeNotRegistered : public std::exception
{ virtual char const * what() const throw() { return "packet type not registered"; } };
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "PacketRegistry.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ih.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
namespace impl {
struct PkReg_Entry {
template <class OtherPacket>
void registerPacket(key_t key);
- key_t key(satcom::lib::TypeIdValue const & type);
+ key_t key(senf::TypeIdValue const & type);
Entry * lookup(key_t key);
typedef boost::shared_ptr<Entry> Entry_ptr;
typedef std::map<key_t, Entry_ptr> PacketMap;
- typedef std::map<satcom::lib::TypeIdValue, key_t> ReversePacketMap;
+ typedef std::map<senf::TypeIdValue, key_t> ReversePacketMap;
PacketMap registry_;
ReversePacketMap reverseRegistry_;
extern PkReg_EntryImpl<DataPacket> pkreg_dataEntry;
-}}}
+}}
///////////////////////////////ih.e////////////////////////////////////////
#endif
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
namespace {
- using namespace satcom::pkf;
+ using namespace senf;
struct BaseTag {
typedef unsigned key_t;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <unsigned elements, class Parser, class Iterator, class IPacket>
-prefix_ satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::Parse_Array()
+prefix_ senf::Parse_Array<elements,Parser,Iterator,IPacket>::Parse_Array()
{}
template <unsigned elements, class Parser, class Iterator, class IPacket>
prefix_
-satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::Parse_Array(Iterator const & i)
+senf::Parse_Array<elements,Parser,Iterator,IPacket>::Parse_Array(Iterator const & i)
: ParserBase<Iterator,IPacket>(i)
{}
template <unsigned elements, class Parser, class Iterator, class IPacket>
-prefix_ unsigned satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::bytes()
+prefix_ unsigned senf::Parse_Array<elements,Parser,Iterator,IPacket>::bytes()
{
return elements*Parser::bytes();
}
template <unsigned elements, class Parser, class Iterator, class IPacket>
prefix_ bool
-satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::check(Iterator const & e)
+senf::Parse_Array<elements,Parser,Iterator,IPacket>::check(Iterator const & e)
const
{
return e-this->i() >= bytes();
}
template <unsigned elements, class Parser, class Iterator, class IPacket>
-prefix_ void satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::init()
+prefix_ void senf::Parse_Array<elements,Parser,Iterator,IPacket>::init()
const
{
iterator e=end();
///////////////////////////////////////////////////////////////////////////
template <unsigned elements, class Parser, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::size_type
-satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::size()
+prefix_ typename senf::Parse_Array<elements,Parser,Iterator,IPacket>::size_type
+senf::Parse_Array<elements,Parser,Iterator,IPacket>::size()
{
return elements;
}
template <unsigned elements, class Parser, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::iterator
-satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::begin()
+prefix_ typename senf::Parse_Array<elements,Parser,Iterator,IPacket>::iterator
+senf::Parse_Array<elements,Parser,Iterator,IPacket>::begin()
const
{
return iterator(this->i());
}
template <unsigned elements, class Parser, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::iterator
-satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::end()
+prefix_ typename senf::Parse_Array<elements,Parser,Iterator,IPacket>::iterator
+senf::Parse_Array<elements,Parser,Iterator,IPacket>::end()
const
{
return iterator(this->i()+bytes());
}
template <unsigned elements, class Parser, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::range_type
-satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::range()
+prefix_ typename senf::Parse_Array<elements,Parser,Iterator,IPacket>::range_type
+senf::Parse_Array<elements,Parser,Iterator,IPacket>::range()
const
{
return std::make_pair(begin(),end());
}
template <unsigned elements, class Parser, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::iterator
-satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::value()
+prefix_ typename senf::Parse_Array<elements,Parser,Iterator,IPacket>::iterator
+senf::Parse_Array<elements,Parser,Iterator,IPacket>::value()
const
{
return begin();
}
template <unsigned elements, class Parser, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::value_type
-satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::operator[](difference_type i)
+prefix_ typename senf::Parse_Array<elements,Parser,Iterator,IPacket>::value_type
+senf::Parse_Array<elements,Parser,Iterator,IPacket>::operator[](difference_type i)
const
{
return begin()[i];
template <unsigned elements, class Parser, class Iterator, class IPacket>
template <class InputIterator>
-prefix_ satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket> const &
-satcom::pkf::Parse_Array<elements,Parser,Iterator,IPacket>::operator=(InputIterator const & i)
+prefix_ senf::Parse_Array<elements,Parser,Iterator,IPacket> const &
+senf::Parse_Array<elements,Parser,Iterator,IPacket>::operator=(InputIterator const & i)
{
copy_n(i,size(),begin());
}
///////////////////////////////////////////////////////////////////////////
template <class Parser, class Iterator>
-prefix_ Iterator satcom::pkf::impl::Parse_Array_iterator<Parser,Iterator>::raw()
+prefix_ Iterator senf::impl::Parse_Array_iterator<Parser,Iterator>::raw()
const
{
return i_;
}
template <class Parser, class Iterator>
-prefix_ Parser satcom::pkf::impl::Parse_Array_iterator<Parser,Iterator>::operator[](int i)
+prefix_ Parser senf::impl::Parse_Array_iterator<Parser,Iterator>::operator[](int i)
const
{
return (*this+i).dereference();
}
template <class Parser, class Iterator>
-prefix_ satcom::pkf::impl::Parse_Array_iterator<Parser,Iterator>::Parse_Array_iterator()
+prefix_ senf::impl::Parse_Array_iterator<Parser,Iterator>::Parse_Array_iterator()
: i_()
{}
template <class Parser, class Iterator>
-prefix_ satcom::pkf::impl::Parse_Array_iterator<Parser,Iterator>::
+prefix_ senf::impl::Parse_Array_iterator<Parser,Iterator>::
Parse_Array_iterator(Iterator const & i)
: i_(i)
{}
template <class Parser, class Iterator>
prefix_ Parser
-satcom::pkf::impl::Parse_Array_iterator<Parser,Iterator>::dereference()
+senf::impl::Parse_Array_iterator<Parser,Iterator>::dereference()
const
{
return Parser(i_);
}
template <class Parser, class Iterator>
-prefix_ bool satcom::pkf::impl::Parse_Array_iterator<Parser,Iterator>::
+prefix_ bool senf::impl::Parse_Array_iterator<Parser,Iterator>::
equal(Parse_Array_iterator const & other)
const
{
}
template <class Parser, class Iterator>
-prefix_ int satcom::pkf::impl::Parse_Array_iterator<Parser,Iterator>::
+prefix_ int senf::impl::Parse_Array_iterator<Parser,Iterator>::
distance_to(Parse_Array_iterator const & other)
const
{
}
template <class Parser, class Iterator>
-prefix_ void satcom::pkf::impl::Parse_Array_iterator<Parser,Iterator>::increment()
+prefix_ void senf::impl::Parse_Array_iterator<Parser,Iterator>::increment()
{
i_ += Parser::bytes();
}
template <class Parser, class Iterator>
-prefix_ void satcom::pkf::impl::Parse_Array_iterator<Parser,Iterator>::decrement()
+prefix_ void senf::impl::Parse_Array_iterator<Parser,Iterator>::decrement()
{
i_ -= Parser::bytes();
}
template <class Parser, class Iterator>
prefix_ void
-satcom::pkf::impl::Parse_Array_iterator<Parser,Iterator>::advance(int n)
+senf::impl::Parse_Array_iterator<Parser,Iterator>::advance(int n)
{
i_ += n*Parser::bytes();
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "ParseArray.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
namespace impl { template <class,class> class Parse_Array_iterator; }
Parse_Array const & operator= (InputIterator const & i);
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "ParseArray.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ih.p////////////////////////////////////////
template <class Parser, class Iterator>
-class satcom::pkf::impl::Parse_Array_iterator
+class senf::impl::Parse_Array_iterator
: public boost::iterator_facade< Parse_Array_iterator<Parser,Iterator>,
Parser,
boost::random_access_traversal_tag,
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::pkf;
+using namespace senf;
BOOST_AUTO_UNIT_TEST(parseArray_test)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////hh.p////////////////////////////////////////
#include "ParseInt.ih"
-namespace satcom {
-namespace pkf {
+namespace senf {
+
template <class Iterator=nil, class IPacket=nil>
struct Parse_Int8
Parse_Flag const & operator= (value_type other) { value(other); return *this; }
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "ParseInt.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ih.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
namespace impl {
///////////////////////////////////////////////////////////////////////////
: public parse_bitfield_i<Iterator,start/8,(end-1)/8-start/8,start%8,end-8*(start/8)>
{};
-}}}
+}}
///////////////////////////////ih.e////////////////////////////////////////
#endif
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::pkf;
+using namespace senf;
BOOST_AUTO_UNIT_TEST(parseInt_fixedSizes)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ct.p////////////////////////////////////////
template <class Parser, class Sentinel, class Iterator, class IPacket>
-prefix_ unsigned satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::bytes()
+prefix_ unsigned senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::bytes()
const
{
iterator i (begin());
template <class Parser, class Sentinel, class Iterator, class IPacket>
prefix_ bool
-satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::check(Iterator const & e)
+senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::check(Iterator const & e)
const
{
byte_iterator i (this->i());
}
template <class Parser, class Sentinel, class Iterator, class IPacket>
-prefix_ void satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::init()
+prefix_ void senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::init()
const
{
iterator i (begin());
}
///////////////////////////////////////////////////////////////////////////
-// satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>
+// senf::Parse_ListS_wrapper<Parser,Sentinel,Container>
template <class Parser, class Sentinel, class Container>
template <class Value>
prefix_ void
-satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::insert(iterator pos,
+senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::insert(iterator pos,
Value const & t)
{
// FIXME: What, if pos == end() / default constructed iterator ?
template <class Parser, class Sentinel, class Container>
template <class Value>
prefix_ void
-satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::insert(iterator pos, size_type n,
+senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::insert(iterator pos, size_type n,
Value const & t)
{
size_type ix (pos.raw()-container_.begin());
template <class Parser, class Sentinel, class Container>
template <class InputIterator>
prefix_ void
-satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::insert(iterator pos,
+senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::insert(iterator pos,
InputIterator f,
InputIterator l)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Parser, class Sentinel, class Iterator, class IPacket>
-prefix_ satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::Parse_ListS()
+prefix_ senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::Parse_ListS()
{}
template <class Parser, class Sentinel, class Iterator, class IPacket>
prefix_
-satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::Parse_ListS(Iterator const & i)
+senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::Parse_ListS(Iterator const & i)
: ParserBase<Iterator,IPacket>(i)
{}
template <class Parser, class Sentinel, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::size_type
-satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::size()
+prefix_ typename senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::size_type
+senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::size()
const
{
return std::distance(begin(),end());
}
template <class Parser, class Sentinel, class Iterator, class IPacket>
-prefix_ bool satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::empty()
+prefix_ bool senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::empty()
const
{
return begin()==end();
}
template <class Parser, class Sentinel, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::iterator
-satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::begin()
+prefix_ typename senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::iterator
+senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::begin()
const
{
return iterator(this->i());
}
template <class Parser, class Sentinel, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::iterator
-satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::end()
+prefix_ typename senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::iterator
+senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::end()
const
{
return iterator();
}
template <class Parser, class Sentinel, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::range_type
-satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::range()
+prefix_ typename senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::range_type
+senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::range()
const
{
return std::make_pair(begin(),end());
}
template <class Parser, class Sentinel, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::range_type
-satcom::pkf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::value()
+prefix_ typename senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::range_type
+senf::Parse_ListS<Parser,Sentinel,Iterator,IPacket>::value()
const
{
return range();
}
///////////////////////////////////////////////////////////////////////////
-// satcom::pkf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>
+// senf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>
template <class Parser, class Sentinel, class Iterator>
prefix_
-satcom::pkf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::Parse_ListS_iterator()
+senf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::Parse_ListS_iterator()
: i_(), atEnd_(true)
{}
template <class Parser, class Sentinel, class Iterator>
prefix_
-satcom::pkf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::
+senf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::
Parse_ListS_iterator(Iterator const & i)
: i_(i), atEnd_(false)
{
}
template <class Parser, class Sentinel, class Iterator>
-prefix_ Iterator satcom::pkf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::raw()
+prefix_ Iterator senf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::raw()
const
{
return i_;
template <class Parser, class Sentinel, class Iterator>
prefix_ Parser
-satcom::pkf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::dereference()
+senf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::dereference()
const
{
return Parser(i_);
}
template <class Parser, class Sentinel, class Iterator>
-prefix_ bool satcom::pkf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::
+prefix_ bool senf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::
equal(Parse_ListS_iterator const & other)
const
{
}
template <class Parser, class Sentinel, class Iterator>
-prefix_ void satcom::pkf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::increment()
+prefix_ void senf::impl::Parse_ListS_iterator<Parser,Sentinel,Iterator>::increment()
{
BOOST_ASSERT( !atEnd_ );
i_ += dereference().bytes();
}
///////////////////////////////////////////////////////////////////////////
-// satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>
+// senf::Parse_ListS_wrapper<Parser,Sentinel,Container>
template <class Parser, class Sentinel, class Container>
template <class P, class S, class I, class IP>
-prefix_ satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::
+prefix_ senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::
Parse_ListS_wrapper(Parse_ListS<P,S,I,IP> const & list, Container & container)
: i_(list.i()-container.begin()), container_(container)
{}
template <class Parser, class Sentinel, class Container>
-prefix_ typename satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::size_type
-satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::size()
+prefix_ typename senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::size_type
+senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::size()
const
{
return std::distance(begin(),end());
}
template <class Parser, class Sentinel, class Container>
-prefix_ bool satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::empty()
+prefix_ bool senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::empty()
const
{
return begin()==end();
}
template <class Parser, class Sentinel, class Container>
-prefix_ typename satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::iterator
-satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::begin()
+prefix_ typename senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::iterator
+senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::begin()
const
{
return iterator(container_.begin()+i_);
}
template <class Parser, class Sentinel, class Container>
-prefix_ typename satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::iterator
-satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::end()
+prefix_ typename senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::iterator
+senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::end()
const
{
return iterator();
}
template <class Parser, class Sentinel, class Container>
-prefix_ typename satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::range_type
-satcom::pkf::Parse_ListS_wrapper<Parser,Sentinel,Container>::range()
+prefix_ typename senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::range_type
+senf::Parse_ListS_wrapper<Parser,Sentinel,Container>::range()
const
{
return std::make_pair(begin(),end());
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "ParseListS.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
template <class Parser, class Sentinel, class Container> class Parse_ListS_wrapper;
namespace impl {
Container & container_;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "ParseListS.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ih.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
namespace impl {
template <class Parser, class Sentinel, class Iterator>
bool atEnd_;
};
-}}}
+}}
///////////////////////////////ih.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::pkf;
+using namespace senf;
namespace {
template <class Value>
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
template <class Parser, class SizeParser, class Container>
template <class Value>
prefix_ void
-satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::insert(iterator pos,
+senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::insert(iterator pos,
Value const & t)
{
size_type ix(pos.raw()-container_.begin());
template <class Parser, class SizeParser, class Container>
template <class Value>
prefix_ void
-satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::insert(iterator pos,
+senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::insert(iterator pos,
size_type n,
Value const & t)
{
template <class Parser, class SizeParser, class Container>
template <class InputIterator>
prefix_ void
-satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::insert(iterator pos,
+senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::insert(iterator pos,
InputIterator f,
InputIterator l)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Parser, class SizeParser, class Iterator, class IPacket>
-prefix_ satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::
+prefix_ senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::
Parse_Vector(SizeParser const & size)
: size_(size)
{}
template <class Parser, class SizeParser, class Iterator, class IPacket>
-prefix_ satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::
+prefix_ senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::
Parse_Vector(size_parser const & size, Iterator const & i)
: ParserBase<Iterator,IPacket>(i), size_(size)
{}
template <class Parser, class SizeParser, class Iterator, class IPacket>
-prefix_ unsigned satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::bytes()
+prefix_ unsigned senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::bytes()
const
{
return Parser::bytes()*size();
template <class Parser, class SizeParser, class Iterator, class IPacket>
prefix_ void
-satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::check(Iterator const & e)
+senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::check(Iterator const & e)
const
{
return e-this->i() >= bytes();
}
template <class Parser, class SizeParser, class Iterator, class IPacket>
-prefix_ void satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::init()
+prefix_ void senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::init()
const
{
iterator e (end());
///////////////////////////////////////////////////////////////////////////
template <class Parser, class SizeParser, class Iterator, class IPacket>
-prefix_ typename satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::size_type
-satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::size()
+prefix_ typename senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::size_type
+senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::size()
const
{
return size_.value();
}
template <class Parser, class SizeParser, class Iterator, class IPacket>
-prefix_ bool satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::empty()
+prefix_ bool senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::empty()
const
{
return size()==0;
template <class Parser, class SizeParser, class Iterator, class IPacket>
prefix_
-typename satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::iterator
-satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::begin()
+typename senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::iterator
+senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::begin()
const
{
return iterator(this->i());
template <class Parser, class SizeParser, class Iterator, class IPacket>
prefix_
-typename satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::iterator
-satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::end()
+typename senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::iterator
+senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::end()
const
{
return iterator(this->i()+bytes());
template <class Parser, class SizeParser, class Iterator, class IPacket>
prefix_
-typename satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::range_type
-satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::range()
+typename senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::range_type
+senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::range()
const
{
return std::make_pair(begin(),end());
template <class Parser, class SizeParser, class Iterator, class IPacket>
prefix_
-typename satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::range_type
-satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::value()
+typename senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::range_type
+senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::value()
const
{
return range();
template <class Parser, class SizeParser, class Iterator, class IPacket>
prefix_
-typename satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::value_type
-satcom::pkf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::operator[](difference_type i)
+typename senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::value_type
+senf::Parse_Vector<Parser,SizeParser,Iterator,IPacket>::operator[](difference_type i)
const
{
return begin()[i];
}
///////////////////////////////////////////////////////////////////////////
-// satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>
+// senf::Parse_Vector_wrapper<Parser,SizeParser,Container>
template <class Parser, class SizeParser, class Container>
template <class P, class SP, class I, class IP>
-prefix_ satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::
+prefix_ senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::
Parse_Vector_wrapper(Parse_Vector<P,SP,I,IP> const & vector, Container & container)
: i_(vector.i()-container.begin()), size_i_(vector.size_.i()-container.begin()),
container_(container)
{}
template <class Parser, class SizeParser, class Container>
-prefix_ typename satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::size_type
-satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::size()
+prefix_ typename senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::size_type
+senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::size()
const
{
return SizeParser(container_.begin()+size_i_).value();
}
template <class Parser, class SizeParser, class Container>
-prefix_ bool satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::empty()
+prefix_ bool senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::empty()
const
{
return size() == 0;
}
template <class Parser, class SizeParser, class Container>
-prefix_ typename satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::iterator
-satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::begin()
+prefix_ typename senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::iterator
+senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::begin()
const
{
return iterator(container_.begin() + i_);
}
template <class Parser, class SizeParser, class Container>
-prefix_ typename satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::iterator
-satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::end()
+prefix_ typename senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::iterator
+senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::end()
const
{
return iterator(container_.begin() + i_ + Parser::bytes()*size());
}
template <class Parser, class SizeParser, class Container>
-prefix_ typename satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::range_type
-satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::range()
+prefix_ typename senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::range_type
+senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::range()
const
{
return std::make_pair(begin(), end());
}
template <class Parser, class SizeParser, class Container>
-prefix_ typename satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::value_type
-satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::operator[](difference_type i)
+prefix_ typename senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::value_type
+senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::operator[](difference_type i)
const
{
return begin()[i];
}
template <class Parser, class SizeParser, class Container>
-prefix_ void satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::shift(iterator pos,
+prefix_ void senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::shift(iterator pos,
size_type n)
{
container_.insert(pos.raw(),n*Parser::bytes(),0);
}
template <class Parser, class SizeParser, class Container>
-prefix_ void satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::erase(iterator pos,
+prefix_ void senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::erase(iterator pos,
size_type n)
{
container_.erase(pos.raw(),pos.raw()+n*Parser::bytes());
}
template <class Parser, class SizeParser, class Container>
-prefix_ void satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::erase(iterator f,
+prefix_ void senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::erase(iterator f,
iterator l)
{
erase(f,l-f);
}
template <class Parser, class SizeParser, class Container>
-prefix_ void satcom::pkf::Parse_Vector_wrapper<Parser,SizeParser,Container>::clear()
+prefix_ void senf::Parse_Vector_wrapper<Parser,SizeParser,Container>::clear()
{
container_.erase(container_.begin()+i_,container_.begin()+i_+size()*Parser::bytes());
SizeParser(container_.begin()+size_i_) = 0;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "ParseVec.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
template <class Parser, class SizeParser, class Container> class Parse_Vector_wrapper;
Container & container_;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "ParseVec.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::pkf;
+using namespace senf;
BOOST_AUTO_UNIT_TEST(parseVec_test)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Iterator, class IPacket>
-prefix_ Iterator satcom::pkf::ParserBase<Iterator,IPacket>::i()
+prefix_ Iterator senf::ParserBase<Iterator,IPacket>::i()
const
{
return static_cast<IPacket const *>(this)->begin();
}
template <class Iterator>
-prefix_ satcom::pkf::ParserBase<Iterator,satcom::pkf::nil>::ParserBase(Iterator const & i)
+prefix_ senf::ParserBase<Iterator,senf::nil>::ParserBase(Iterator const & i)
: i_(i)
{}
template <class Iterator>
-prefix_ Iterator satcom::pkf::ParserBase<Iterator,satcom::pkf::nil>::i()
+prefix_ Iterator senf::ParserBase<Iterator,senf::nil>::i()
const
{
return i_;
}
template <class Parser, class Iterator>
-prefix_ bool satcom::pkf::impl::check(Iterator const & b, Iterator const & e,
+prefix_ bool senf::impl::check(Iterator const & b, Iterator const & e,
impl::ParserBase *)
{
return impl::ParserCheck<Parser,Parser_traits<Parser>::fixed_size>::check(b,e);
}
template <class Parser, class Iterator>
-prefix_ bool satcom::pkf::impl::check(Iterator const & b, Iterator const & e,
+prefix_ bool senf::impl::check(Iterator const & b, Iterator const & e,
void *)
{
return Parser::check(b,e);
}
template <class Parser, class Iterator>
-prefix_ bool satcom::pkf::check(Iterator const & b, Iterator const & e)
+prefix_ bool senf::check(Iterator const & b, Iterator const & e)
{
return impl::check<Parser,Iterator>(b,e,static_cast<Parser*>(0));
}
template <class Parser>
-prefix_ unsigned satcom::pkf::impl::min_bytes(impl::ParserBase *)
+prefix_ unsigned senf::impl::min_bytes(impl::ParserBase *)
{
return impl::ParserMinBytes<Parser,Parser_traits<Parser>::fixed_size>::bytes();
}
template <class Parser>
-prefix_ unsigned satcom::pkf::impl::min_bytes(void *)
+prefix_ unsigned senf::impl::min_bytes(void *)
{
return 0;
}
template <class Parser>
-prefix_ unsigned satcom::pkf::min_bytes()
+prefix_ unsigned senf::min_bytes()
{
return impl::min_bytes<Parser>(static_cast<Parser*>(0));
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#include "ParserBase.ih"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
namespace impl { struct ParserBase; }
\code
template <class Iterator=nil, class IPacket=nil>
struct Parser_Example
- : protected satcom::pkf::ParserBase<Iterator,IPacket>
+ : protected senf::ParserBase<Iterator,IPacket>
{
// fixed interface of all parser classes
template <class Parser>
unsigned min_bytes();
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "ParserBase.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ih.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
namespace impl {
struct ParserBase {};
static unsigned bytes() { return Parser::bytes(); }
};
-}}}
+}}
///////////////////////////////ih.e////////////////////////////////////////
#endif
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-namespace pkf = satcom::pkf;
-
// The non-inherited Version is extensively tested in PaseInt.test.hh
BOOST_AUTO_UNIT_TEST(parserBase_inherited)
namespace {
- template <class Iterator=pkf::nil, class IPacket=pkf::nil>
- struct Parse_Test : public pkf::ParserBase<Iterator,IPacket>
+ template <class Iterator=senf::nil, class IPacket=senf::nil>
+ struct Parse_Test : public senf::ParserBase<Iterator,IPacket>
{
- template <class I=pkf::nil, class P=pkf::nil>
+ template <class I=senf::nil, class P=senf::nil>
struct rebind { typedef Parse_Test<I,P> parser; };
typedef Iterator byte_iterator;
Parse_Test() {}
- Parse_Test(Iterator const & i) : pkf::ParserBase<Iterator,IPacket>(i) {}
+ Parse_Test(Iterator const & i) : senf::ParserBase<Iterator,IPacket>(i) {}
static unsigned bytes() { return 14; }
};
- template <class Iterator=pkf::nil, class IPacket=pkf::nil>
- struct Parse_Test2 : public pkf::ParserBase<Iterator,IPacket>
+ template <class Iterator=senf::nil, class IPacket=senf::nil>
+ struct Parse_Test2 : public senf::ParserBase<Iterator,IPacket>
{
- template <class I=pkf::nil, class P=pkf::nil>
+ template <class I=senf::nil, class P=senf::nil>
struct rebind { typedef Parse_Test<I,P> parser; };
typedef Iterator byte_iterator;
Parse_Test2() {}
- Parse_Test2(Iterator const & i) : pkf::ParserBase<Iterator,IPacket>(i) {}
+ Parse_Test2(Iterator const & i) : senf::ParserBase<Iterator,IPacket>(i) {}
unsigned bytes() const { return 14; }
static unsigned check(Iterator a, Iterator b)
BOOST_AUTO_UNIT_TEST(parserBase_construction)
{
- BOOST_STATIC_ASSERT( pkf::Parser_traits< Parse_Test<> >::fixed_size );
- BOOST_STATIC_ASSERT( ! pkf::Parser_traits< Parse_Test2<> >::fixed_size );
+ BOOST_STATIC_ASSERT( senf::Parser_traits< Parse_Test<> >::fixed_size );
+ BOOST_STATIC_ASSERT( ! senf::Parser_traits< Parse_Test2<> >::fixed_size );
- BOOST_CHECK_EQUAL( pkf::min_bytes< Parse_Test<int> >(), 14u );
- BOOST_CHECK( pkf::check< Parse_Test<int> >(0,14) );
- BOOST_CHECK( ! pkf::check< Parse_Test<int> >(2,15) );
+ BOOST_CHECK_EQUAL( senf::min_bytes< Parse_Test<int> >(), 14u );
+ BOOST_CHECK( senf::check< Parse_Test<int> >(0,14) );
+ BOOST_CHECK( ! senf::check< Parse_Test<int> >(2,15) );
- BOOST_CHECK_EQUAL( pkf::min_bytes< Parse_Test2<int> >(), 10u );
- BOOST_CHECK( pkf::check< Parse_Test2<int> >(2,13) );
- BOOST_CHECK( pkf::check< Parse_Test2<int> >(2,12) );
+ BOOST_CHECK_EQUAL( senf::min_bytes< Parse_Test2<int> >(), 10u );
+ BOOST_CHECK( senf::check< Parse_Test2<int> >(2,13) );
+ BOOST_CHECK( senf::check< Parse_Test2<int> >(2,12) );
}
///////////////////////////////cc.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::pkf::RTCPPacket::v_nextInterpreter()
+prefix_ void senf::RTCPPacket::v_nextInterpreter()
const
{
registerInterpreter<DataPacket>(begin()+bytes(),end());
}
-prefix_ void satcom::pkf::RTCPPacket::v_finalize()
+prefix_ void senf::RTCPPacket::v_finalize()
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Arg>
-prefix_ satcom::pkf::RTCPPacket::RTCPPacket(Arg const & arg)
+prefix_ senf::RTCPPacket::RTCPPacket(Arg const & arg)
: Packet(arg)
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "RTCPPacket.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
template <class I=nil,class P=nil> struct Parse_RTCP_RR;
template <class I=nil,class P=nil> struct Parse_RTCP_SR;
friend class Packet;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::pkf;
+using namespace senf;
BOOST_AUTO_UNIT_TEST(rtcpPacket_parser)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::pkf::RTPPacket::v_nextInterpreter()
+prefix_ void senf::RTPPacket::v_nextInterpreter()
const
{
}
}
-prefix_ void satcom::pkf::RTPPacket::v_finalize()
+prefix_ void senf::RTPPacket::v_finalize()
{}
-prefix_ void satcom::pkf::RTPPacket::v_dump(std::ostream & os)
+prefix_ void senf::RTPPacket::v_dump(std::ostream & os)
const
{
os << "RTP:\n"
<< " csrc list : <not shown>\n";
}
-prefix_ void satcom::pkf::RTPExtensionBasePacket::v_nextInterpreter()
+prefix_ void senf::RTPExtensionBasePacket::v_nextInterpreter()
const
{
registerInterpreter(get_prev<RTPPacket>()->payloadType(),begin()+p.bytes(),end()-paddingOctets);
}
-prefix_ void satcom::pkf::RTPExtensionBasePacket::v_dump(std::ostream & os)
+prefix_ void senf::RTPExtensionBasePacket::v_dump(std::ostream & os)
const
{
os << "RTP extension packet:\n"
<< " content not shown\n";
}
-prefix_ void satcom::pkf::RTPUnknownExtensionPacket::v_finalize()
+prefix_ void senf::RTPUnknownExtensionPacket::v_finalize()
{}
///////////////////////////////cc.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Arg>
-prefix_ satcom::pkf::RTPPacket::RTPPacket(Arg const & arg)
+prefix_ senf::RTPPacket::RTPPacket(Arg const & arg)
: Packet(arg)
{}
template <class Arg>
-prefix_ satcom::pkf::RTPExtensionBasePacket::
+prefix_ senf::RTPExtensionBasePacket::
RTPExtensionBasePacket(Arg const & arg)
: Packet(arg)
{}
template <class Arg>
-prefix_ satcom::pkf::RTPUnknownExtensionPacket::
+prefix_ senf::RTPUnknownExtensionPacket::
RTPUnknownExtensionPacket(Arg const & arg)
: RTPExtensionBasePacket(arg)
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "RTPPacket.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
template <class Iterator=nil, class IPacket=nil>
struct Parse_RTP : public ParserBase<Iterator,IPacket>
friend class Packet;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::pkf;
+using namespace senf;
BOOST_AUTO_UNIT_TEST(rtpPacket_parser)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
namespace {
- namespace pkf = satcom::pkf;
- pkf::PacketRegistry<pkf::IpV4Types>::RegistrationProxy<pkf::UDPPacket>
+ senf::PacketRegistry<senf::IpV4Types>::RegistrationProxy<senf::UDPPacket>
registerUDPPacket(17);
}
-prefix_ void satcom::pkf::UDPPacket::v_nextInterpreter()
+prefix_ void senf::UDPPacket::v_nextInterpreter()
const
{
registerInterpreter<DataPacket>(begin()+bytes(),end());
}
-prefix_ void satcom::pkf::UDPPacket::v_finalize()
+prefix_ void senf::UDPPacket::v_finalize()
{}
-prefix_ void satcom::pkf::UDPPacket::v_dump(std::ostream & os)
+prefix_ void senf::UDPPacket::v_dump(std::ostream & os)
const
{
os << "UDP:\n"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Arg>
-prefix_ satcom::pkf::UDPPacket::UDPPacket(Arg const & arg)
+prefix_ senf::UDPPacket::UDPPacket(Arg const & arg)
: Packet(arg)
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "UDPPacket.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace pkf {
+namespace senf {
+
template <class Iterator=nil, class IPacket=nil>
struct Parse_UDP : public ParserBase<Iterator,IPacket>
friend class Packet;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::pkf;
+using namespace senf;
BOOST_AUTO_UNIT_TEST(udpPacket_parser)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ satcom::lib::TypeIdValue::TypeIdValue()
+prefix_ senf::TypeIdValue::TypeIdValue()
: value_(new ValueImpl<void>())
{}
-prefix_ satcom::lib::TypeIdValue::TypeIdValue(TypeIdValue const & other)
+prefix_ senf::TypeIdValue::TypeIdValue(TypeIdValue const & other)
{
value_.reset(other.value_->clone());
}
-prefix_ satcom::lib::TypeIdValue const &
-satcom::lib::TypeIdValue::operator=(TypeIdValue const & other)
+prefix_ senf::TypeIdValue const &
+senf::TypeIdValue::operator=(TypeIdValue const & other)
{
value_.reset(other.value_->clone());
return *this;
}
-prefix_ bool satcom::lib::TypeIdValue::operator==(TypeIdValue const & other)
+prefix_ bool senf::TypeIdValue::operator==(TypeIdValue const & other)
const
{
return value_->id() == other.value_->id();
}
-prefix_ bool satcom::lib::TypeIdValue::operator<(TypeIdValue const & other)
+prefix_ bool senf::TypeIdValue::operator<(TypeIdValue const & other)
const
{
return value_->id().before(other.value_->id());
}
-prefix_ std::string satcom::lib::TypeIdValue::name()
+prefix_ std::string senf::TypeIdValue::name()
const
{
return std::string(value_->id().name());
}
-prefix_ satcom::lib::TypeIdValue const satcom::lib::typeIdValue()
+prefix_ senf::TypeIdValue const senf::typeIdValue()
{
return TypeIdValue();
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Type>
-prefix_ satcom::lib::TypeIdValue::TypeIdValue(Type *)
+prefix_ senf::TypeIdValue::TypeIdValue(Type *)
: value_(new ValueImpl<Type>())
{}
template <class Type>
-prefix_ std::type_info const & satcom::lib::TypeIdValue::ValueImpl<Type>::id()
+prefix_ std::type_info const & senf::TypeIdValue::ValueImpl<Type>::id()
{
return typeid(Type);
}
template <class Type>
-prefix_ satcom::lib::TypeIdValue::Value *
-satcom::lib::TypeIdValue::ValueImpl<Type>::clone()
+prefix_ senf::TypeIdValue::Value *
+senf::TypeIdValue::ValueImpl<Type>::clone()
{
return new ValueImpl<Type>();
}
template <class Type>
-prefix_ satcom::lib::TypeIdValue const satcom::lib::typeIdValue()
+prefix_ senf::TypeIdValue const senf::typeIdValue()
{
return TypeIdValue(static_cast<Type*>(0));
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "typeidvalue.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
/** \brief Wrapper to use types as key's in a map
*/
template <class Type>
TypeIdValue const typeIdValue();
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "typeidvalue.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
# -*- python -*-
import sys, glob
-sys.path.append('satscons')
+sys.path.append('senfscons')
import SatSCons
###########################################################################
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ satcom::lib::ReadUntil::ReadUntil(std::string target_)
+prefix_ senf::ReadUntil::ReadUntil(std::string target_)
: target(target_)
{}
-prefix_ std::string::size_type satcom::lib::ReadUntil::operator()(std::string data)
+prefix_ std::string::size_type senf::ReadUntil::operator()(std::string data)
{
return data.find(target);
}
///////////////////////////////ct.p////////////////////////////////////////
template <class Handle>
-prefix_ satcom::lib::ReadHelper<Handle>::ReadHelper(Handle handle, std::string::size_type maxSize,
+prefix_ senf::ReadHelper<Handle>::ReadHelper(Handle handle, std::string::size_type maxSize,
InternalPredicate * predicate, Callback cb)
: handle_(handle), maxSize_(maxSize), predicate_(predicate), callback_(cb),
errno_(0), complete_(false)
// argumnet 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.
- satcom::lib::Scheduler::instance()
+ senf::Scheduler::instance()
.add(handle,boost::bind(&ReadHelper::dispatchProcess,ptr(this),_1,_2),
- satcom::lib::Scheduler::EV_READ);
+ senf::Scheduler::EV_READ);
}
template <class Handle>
-prefix_ void satcom::lib::ReadHelper<Handle>::revoke()
+prefix_ void senf::ReadHelper<Handle>::revoke()
{
ptr guard (this); // To ensure, 'this' is deleted only after this method terminates ...
- satcom::lib::Scheduler::instance()
- .remove(handle_,satcom::lib::Scheduler::EV_READ);
+ senf::Scheduler::instance()
+ .remove(handle_,senf::Scheduler::EV_READ);
}
template <class Handle>
prefix_ void
-satcom::lib::ReadHelper<Handle>::dispatchProcess(ptr helper, Handle handle,
- satcom::lib::Scheduler::EventId event)
+senf::ReadHelper<Handle>::dispatchProcess(ptr helper, Handle handle,
+ senf::Scheduler::EventId event)
{
// since we have a 'ptr' argument, the instance cannot be deleted
// before this method returns
}
template <class Handle>
-prefix_ void satcom::lib::ReadHelper<Handle>::process(Handle handle,
- satcom::lib::Scheduler::EventId event)
+prefix_ void senf::ReadHelper<Handle>::process(Handle handle,
+ senf::Scheduler::EventId event)
{
try {
- if (event != satcom::lib::Scheduler::EV_READ)
+ if (event != senf::Scheduler::EV_READ)
throw SystemException(EPIPE);
std::string rcv (handle.read(maxSize_ - data_.size()));
data_.append(rcv);
done();
}
}
- catch (satcom::lib::SystemException const & ex) {
+ catch (senf::SystemException const & ex) {
errno_ = ex.err;
done();
}
}
template <class Handle>
-prefix_ void satcom::lib::ReadHelper<Handle>::done()
+prefix_ void senf::ReadHelper<Handle>::done()
{
revoke();
callback_(ptr(this));
template <class Handle>
template <class Predicate>
prefix_ std::string::size_type
-satcom::lib::ReadHelper<Handle>::InternalPredicate::Dispatcher<Predicate>::
+senf::ReadHelper<Handle>::InternalPredicate::Dispatcher<Predicate>::
operator()(std::string const & data)
{
return predicate(data);
///////////////////////////////cti.p///////////////////////////////////////
template <class Handle>
-prefix_ typename satcom::lib::ReadHelper<Handle>::ptr
-satcom::lib::ReadHelper<Handle>::dispatch(Handle handle, std::string::size_type maxSize,
+prefix_ typename senf::ReadHelper<Handle>::ptr
+senf::ReadHelper<Handle>::dispatch(Handle handle, std::string::size_type maxSize,
Callback callback)
{
return ptr(new ReadHelper(handle, maxSize, 0, callback));
template <class Handle>
template <class Predicate>
-prefix_ typename satcom::lib::ReadHelper<Handle>::ptr
-satcom::lib::ReadHelper<Handle>::dispatch(Handle handle, std::string::size_type maxSize,
+prefix_ typename senf::ReadHelper<Handle>::ptr
+senf::ReadHelper<Handle>::dispatch(Handle handle, std::string::size_type maxSize,
Predicate predicate, Callback callback)
{
return ptr(new ReadHelper(handle, maxSize,
}
template <class Handle>
-prefix_ Handle satcom::lib::ReadHelper<Handle>::handle()
+prefix_ Handle senf::ReadHelper<Handle>::handle()
const
{
return handle_;
}
template <class Handle>
-prefix_ unsigned satcom::lib::ReadHelper<Handle>::maxSize()
+prefix_ unsigned senf::ReadHelper<Handle>::maxSize()
const
{
return maxSize_;
}
template <class Handle>
-prefix_ std::string const & satcom::lib::ReadHelper<Handle>::data()
+prefix_ std::string const & senf::ReadHelper<Handle>::data()
const
{
return data_;
}
template <class Handle>
-prefix_ std::string const & satcom::lib::ReadHelper<Handle>::tail()
+prefix_ std::string const & senf::ReadHelper<Handle>::tail()
const
{
return tail_;
}
template <class Handle>
-prefix_ bool satcom::lib::ReadHelper<Handle>::complete()
+prefix_ bool senf::ReadHelper<Handle>::complete()
const
{
return complete_;
}
template <class Handle>
-prefix_ bool satcom::lib::ReadHelper<Handle>::error()
+prefix_ bool senf::ReadHelper<Handle>::error()
const
{
return errno_ != 0;
}
template <class Handle>
-prefix_ void satcom::lib::ReadHelper<Handle>::throw_error()
+prefix_ void senf::ReadHelper<Handle>::throw_error()
const
{
if (errno_ != 0) throw SystemException(errno_);
//#include "ReadHelper.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
template <class Handle>
class ReadHelper
- : public satcom::lib::intrusive_refcount
+ : public senf::intrusive_refcount
{
public:
///////////////////////////////////////////////////////////////////////////
ReadHelper(Handle handle, unsigned maxSize, InternalPredicate * predicate, Callback cb);
- static void dispatchProcess(ptr helper, Handle handle, satcom::lib::Scheduler::EventId event);
- void process(Handle handle, satcom::lib::Scheduler::EventId event);
+ static void dispatchProcess(ptr helper, Handle handle, senf::Scheduler::EventId event);
+ void process(Handle handle, senf::Scheduler::EventId event);
void done();
Handle handle_;
std::string target;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "ReadHelper.cci"
///////////////////////////////ih.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
template <class Handle>
struct ReadHelper<Handle>::InternalPredicate
virtual std::string::size_type operator()(std::string const & data) = 0;
};
-}}
+}
///////////////////////////////ih.e////////////////////////////////////////
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ satcom::lib::Scheduler::Scheduler & satcom::lib::Scheduler::instance()
+prefix_ senf::Scheduler::Scheduler & senf::Scheduler::instance()
{
static Scheduler instance;
return instance;
}
-prefix_ void satcom::lib::Scheduler::timeout(unsigned long timeout, TimerCallback const & cb)
+prefix_ void senf::Scheduler::timeout(unsigned long timeout, TimerCallback const & cb)
{
timerQueue_.push(TimerSpec(now()+1000*timeout,cb));
}
-prefix_ satcom::lib::Scheduler::Scheduler()
+prefix_ senf::Scheduler::Scheduler()
: epollFd_(epoll_create(EPollInitialSize))
{
if (epollFd_<0)
throw SystemException(errno);
}
-prefix_ void satcom::lib::Scheduler::do_add(int fd, SimpleCallback const & cb, int eventMask)
+prefix_ void senf::Scheduler::do_add(int fd, SimpleCallback const & cb, int eventMask)
{
FdTable::iterator i (fdTable_.find(fd));
int action (EPOLL_CTL_MOD);
throw SystemException(errno);
}
-prefix_ void satcom::lib::Scheduler::do_remove(int fd, int eventMask)
+prefix_ void senf::Scheduler::do_remove(int fd, int eventMask)
{
FdTable::iterator i (fdTable_.find(fd));
if (i == fdTable_.end())
}
-prefix_ int satcom::lib::Scheduler::EventSpec::epollMask()
+prefix_ int senf::Scheduler::EventSpec::epollMask()
const
{
int mask (0);
return mask;
}
-prefix_ void satcom::lib::Scheduler::process()
+prefix_ void senf::Scheduler::process()
{
terminate_ = false;
while (! terminate_) {
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ void satcom::lib::Scheduler::terminate()
+prefix_ void senf::Scheduler::terminate()
{
terminate_ = true;
}
-prefix_ int satcom::lib::retrieve_filehandle(int fd)
+prefix_ int senf::retrieve_filehandle(int fd)
{
return fd;
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Handle>
-prefix_ void satcom::lib::Scheduler::add(Handle const & handle,
+prefix_ void senf::Scheduler::add(Handle const & handle,
typename GenericCallback<Handle>::Callback const & cb,
int eventMask)
{
}
template <class Handle>
-prefix_ void satcom::lib::Scheduler::remove(Handle const & handle, int eventMask)
+prefix_ void senf::Scheduler::remove(Handle const & handle, int eventMask)
{
// retrieve_filehandle is found via ADL
do_remove(retrieve_filehandle(handle),eventMask);
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "scheduler.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
/** \brief Singleton class to manage the event loop
int retrieve_filehandle(int fd);
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "Scheduler.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::lib;
+using namespace senf;
namespace {
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ct.p////////////////////////////////////////
template <class Handle>
-prefix_ satcom::lib::WriteHelper<Handle>::WriteHelper(Handle handle, std::string data,
+prefix_ senf::WriteHelper<Handle>::WriteHelper(Handle handle, std::string data,
Callback callback)
: handle_(handle), data_(data), callback_(callback),
offset_(0), errno_(0)
{
- satcom::lib::Scheduler::instance()
+ senf::Scheduler::instance()
.add(handle_, boost::bind(&WriteHelper::dispatchProcess, ptr(this), _1, _2),
- satcom::lib::Scheduler::EV_WRITE);
+ senf::Scheduler::EV_WRITE);
}
template <class Handle>
-prefix_ std::string const & satcom::lib::WriteHelper<Handle>::data()
+prefix_ std::string const & senf::WriteHelper<Handle>::data()
const
{
if (offset_ > 0) {
}
template <class Handle>
-prefix_ void satcom::lib::WriteHelper<Handle>::revoke()
+prefix_ void senf::WriteHelper<Handle>::revoke()
{
ptr guard (this); // To ensure, 'this' is deleted only after this method terminates ...
- satcom::lib::Scheduler::instance()
- .remove(handle_, satcom::lib::Scheduler::EV_WRITE);
+ senf::Scheduler::instance()
+ .remove(handle_, senf::Scheduler::EV_WRITE);
}
template <class Handle>
prefix_ void
-satcom::lib::WriteHelper<Handle>::dispatchProcess(ptr helper, Handle handle,
- satcom::lib::Scheduler::EventId event)
+senf::WriteHelper<Handle>::dispatchProcess(ptr helper, Handle handle,
+ senf::Scheduler::EventId event)
{
// since we have a 'ptr' argument, the instance cannot be deleted
// before this method returns
}
template <class Handle>
-prefix_ void satcom::lib::WriteHelper<Handle>::process(Handle handle,
- satcom::lib::Scheduler::EventId event)
+prefix_ void senf::WriteHelper<Handle>::process(Handle handle,
+ senf::Scheduler::EventId event)
{
try {
- if (event != satcom::lib::Scheduler::EV_WRITE)
- throw satcom::lib::SystemException(EPIPE);
+ if (event != senf::Scheduler::EV_WRITE)
+ throw senf::SystemException(EPIPE);
offset_ += handle.write(data_.data()+offset_,data_.size()-offset_);
if (offset_ >= data_.size()) {
data_.erase();
done();
}
}
- catch (satcom::lib::SystemException const & ex) {
+ catch (senf::SystemException const & ex) {
errno_ = ex.err;
done();
}
}
template <class Handle>
-prefix_ void satcom::lib::WriteHelper<Handle>::done()
+prefix_ void senf::WriteHelper<Handle>::done()
{
revoke();
callback_(ptr(this));
///////////////////////////////cti.p///////////////////////////////////////
template <class Handle>
-prefix_ typename satcom::lib::WriteHelper<Handle>::ptr
-satcom::lib::WriteHelper<Handle>::dispatch(Handle handle, std::string data, Callback callback)
+prefix_ typename senf::WriteHelper<Handle>::ptr
+senf::WriteHelper<Handle>::dispatch(Handle handle, std::string data, Callback callback)
{
return ptr(new WriteHelper(handle, data, callback));
}
template <class Handle>
-prefix_ Handle satcom::lib::WriteHelper<Handle>::handle()
+prefix_ Handle senf::WriteHelper<Handle>::handle()
const
{
return handle_;
}
template <class Handle>
-prefix_ bool satcom::lib::WriteHelper<Handle>::complete()
+prefix_ bool senf::WriteHelper<Handle>::complete()
const
{
return data_.empty();
}
template <class Handle>
-prefix_ bool satcom::lib::WriteHelper<Handle>::error()
+prefix_ bool senf::WriteHelper<Handle>::error()
const
{
return errno_ != 0;
}
template <class Handle>
-prefix_ void satcom::lib::WriteHelper<Handle>::throw_error()
+prefix_ void senf::WriteHelper<Handle>::throw_error()
const
{
if (errno_ != 0)
- throw satcom::lib::SystemException(errno_);
+ throw senf::SystemException(errno_);
}
//#include "WriteHelper.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
template <class Handle>
class WriteHelper
- : public satcom::lib::intrusive_refcount
+ : public senf::intrusive_refcount
{
public:
///////////////////////////////////////////////////////////////////////////
private:
WriteHelper(Handle handle, std::string data, Callback callback);
- static void dispatchProcess(ptr helper, Handle handle, satcom::lib::Scheduler::EventId event);
- void process(Handle handle, satcom::lib::Scheduler::EventId event);
+ static void dispatchProcess(ptr helper, Handle handle, senf::Scheduler::EventId event);
+ void process(Handle handle, senf::Scheduler::EventId event);
void done();
Handle handle_;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "WriteHelper.cci"
void use_em()
{
// Pull in symbols from the wanted packets ...
- satcom::pkf::Packet::create<satcom::pkf::IpV4Packet>(0,0);
- satcom::pkf::Packet::create<satcom::pkf::UDPPacket>(0,0);
+ senf::Packet::create<senf::IpV4Packet>(0,0);
+ senf::Packet::create<senf::UDPPacket>(0,0);
}
}
int main (int argc, char const * argv[])
{
try {
- satcom::lib::PacketSocketHandle sock;
- sock.bind(satcom::lib::LLSocketAddress("eth0"));
- // sock.protocol().promisc("eth0",satcom::lib::PacketProtocol::Promiscuous);
+ senf::PacketSocketHandle sock;
+ sock.bind(senf::LLSocketAddress("eth0"));
+ // sock.protocol().promisc("eth0",senf::PacketProtocol::Promiscuous);
while (true) { // forever
std::string data (sock.read());
- satcom::pkf::EthernetPacket::ptr packet (
- satcom::pkf::Packet::create<satcom::pkf::EthernetPacket>(
+ senf::EthernetPacket::ptr packet (
+ senf::Packet::create<senf::EthernetPacket>(
data.begin(), data.end()));
packet->dump(std::cout);
hexdump(packet->last()->begin(),
}
}
catch (std::exception const & ex) {
- std::cerr << satcom::lib::prettyName(typeid(ex)) << ": " << ex.what() << "\n";
+ std::cerr << senf::prettyName(typeid(ex)) << ": " << ex.what() << "\n";
}
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "AddressingPolicy.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
struct NoAddressingPolicy : public AddressingPolicyBase
{};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "AddressingPolicy.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ std::pair<bool,unsigned> satcom::lib::BSDSocketProtocol::linger()
+prefix_ std::pair<bool,unsigned> senf::BSDSocketProtocol::linger()
const
{
struct linger ling;
return std::make_pair(ling.l_onoff, ling.l_linger);
}
-prefix_ void satcom::lib::BSDSocketProtocol::linger(bool enable, unsigned timeout)
+prefix_ void senf::BSDSocketProtocol::linger(bool enable, unsigned timeout)
const
{
struct linger ling;
throw SystemException(errno);
}
-prefix_ struct timeval satcom::lib::BSDSocketProtocol::timestamp()
+prefix_ struct timeval senf::BSDSocketProtocol::timestamp()
const
{
// BUG: Check, why this fails with ENOFILE (!!!!) at least when
///////////////////////////////////////////////////////////////////////////
-prefix_ bool satcom::lib::AddressableBSDSocketProtocol::reuseaddr()
+prefix_ bool senf::AddressableBSDSocketProtocol::reuseaddr()
const
{
int value;
return value;
}
-prefix_ void satcom::lib::AddressableBSDSocketProtocol::reuseaddr(bool value)
+prefix_ void senf::AddressableBSDSocketProtocol::reuseaddr(bool value)
const
{
int ivalue (value);
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "BSDSocketProtocol.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
class BSDSocketProtocol
: public virtual SocketProtocol
void reuseaddr(bool value) const;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ unsigned satcom::lib::SocketBufferingPolicy::rcvbuf(FileHandle handle)
+prefix_ unsigned senf::SocketBufferingPolicy::rcvbuf(FileHandle handle)
{
unsigned size;
socklen_t len (sizeof(size));
return size/2;
}
-prefix_ void satcom::lib::SocketBufferingPolicy::rcvbuf(FileHandle handle, unsigned size)
+prefix_ void senf::SocketBufferingPolicy::rcvbuf(FileHandle handle, unsigned size)
{
if (::setsockopt(handle.fd(),SOL_SOCKET,SO_RCVBUF,&size,sizeof(size)) < 0)
throw SystemException(errno);
}
-prefix_ unsigned satcom::lib::SocketBufferingPolicy::sndbuf(FileHandle handle)
+prefix_ unsigned senf::SocketBufferingPolicy::sndbuf(FileHandle handle)
{
unsigned size;
socklen_t len (sizeof(size));
}
-prefix_ void satcom::lib::SocketBufferingPolicy::sndbuf(FileHandle handle, unsigned size)
+prefix_ void senf::SocketBufferingPolicy::sndbuf(FileHandle handle, unsigned size)
{
if (::setsockopt(handle.fd(),SOL_SOCKET,SO_SNDBUF,&size,sizeof(size)) < 0)
throw SystemException(errno);
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "BufferingPolicy.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
// TODO: Should this be dependent on Read / WritePolicy ?
struct SocketBufferingPolicy : public BufferingPolicyBase
static void sndbuf(FileHandle handle, unsigned size);
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "BufferingPolicy.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ct.p////////////////////////////////////////
template <class Policy>
-prefix_ std::string satcom::lib::ClientSocketHandle<Policy>::read(unsigned limit)
+prefix_ std::string senf::ClientSocketHandle<Policy>::read(unsigned limit)
{
std::string rv;
this->read(rv,limit);
}
template <class Policy>
-prefix_ void satcom::lib::ClientSocketHandle<Policy>::read(std::string & buffer, unsigned limit)
+prefix_ void senf::ClientSocketHandle<Policy>::read(std::string & buffer, unsigned limit)
{
unsigned nread = available();
if (limit>0 && nread>limit)
template <class Policy>
prefix_ std::pair<std::string, typename Policy::AddressingPolicy::Address>
-satcom::lib::ClientSocketHandle<Policy>::readfrom()
+senf::ClientSocketHandle<Policy>::readfrom()
{
std::string rv;
typename Policy::AddressingPolicy::Address addr;
}
template <class Policy>
-prefix_ void satcom::lib::ClientSocketHandle<Policy>::
+prefix_ void senf::ClientSocketHandle<Policy>::
readfrom(std::string & buffer, typename Policy::AddressingPolicy::Address & from)
{
unsigned nread = available();
}
template <class Policy>
-prefix_ unsigned satcom::lib::ClientSocketHandle<Policy>::write(std::string const & data)
+prefix_ unsigned senf::ClientSocketHandle<Policy>::write(std::string const & data)
{
unsigned written = this->write(data.data(),data.size());
if (written == 0)
}
template <class Policy>
-prefix_ unsigned satcom::lib::ClientSocketHandle<Policy>::available()
+prefix_ unsigned senf::ClientSocketHandle<Policy>::available()
{
unsigned nread = this->protocol().available();
if (nread == 0 && this->blocking()) {
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
template <class Policy>
template <class OtherPolicy>
-prefix_ satcom::lib::ClientSocketHandle<Policy>::
+prefix_ senf::ClientSocketHandle<Policy>::
ClientSocketHandle(ClientSocketHandle<OtherPolicy> other,
typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type *)
: SocketHandle<Policy>(other,true)
{}
template <class Policy>
-prefix_ satcom::lib::ClientSocketHandle<Policy>::ClientSocketHandle(FileHandle other,
+prefix_ senf::ClientSocketHandle<Policy>::ClientSocketHandle(FileHandle other,
bool isChecked)
: SocketHandle<Policy>(other, isChecked)
{}
template <class Policy>
-prefix_ satcom::lib::ClientSocketHandle<Policy>::
+prefix_ senf::ClientSocketHandle<Policy>::
ClientSocketHandle(std::auto_ptr<SocketProtocol> protocol, int fd)
: SocketHandle<Policy>(protocol,false)
{
template <class Policy>
template <class OtherPolicy>
-prefix_ typename satcom::lib::SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const &
-satcom::lib::ClientSocketHandle<Policy>::operator=(ClientSocketHandle<OtherPolicy> other)
+prefix_ typename senf::SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const &
+senf::ClientSocketHandle<Policy>::operator=(ClientSocketHandle<OtherPolicy> other)
{
assign(other);
return *this;
// reading and writing
template <class Policy>
-prefix_ unsigned satcom::lib::ClientSocketHandle<Policy>::read(char * buffer,
+prefix_ unsigned senf::ClientSocketHandle<Policy>::read(char * buffer,
unsigned size)
{
return Policy::ReadPolicy::read(*this, buffer, size);
}
template <class Policy>
-prefix_ unsigned satcom::lib::ClientSocketHandle<Policy>::
+prefix_ unsigned senf::ClientSocketHandle<Policy>::
readfrom(char * buffer, unsigned size, typename Policy::AddressingPolicy::Address & from)
{
return Policy::ReadPolicy::readfrom(*this, buffer, size, from);
}
template <class Policy>
-prefix_ unsigned satcom::lib::ClientSocketHandle<Policy>::write(char const * buffer,
+prefix_ unsigned senf::ClientSocketHandle<Policy>::write(char const * buffer,
unsigned size)
{
return Policy::WritePolicy::write(*this, buffer, size);
}
template <class Policy>
-prefix_ unsigned satcom::lib::ClientSocketHandle<Policy>::
+prefix_ unsigned senf::ClientSocketHandle<Policy>::
writeto(typename boost::call_traits<typename Policy::AddressingPolicy::Address>::param_type addr,
std::string const & data)
{
}
template <class Policy>
-prefix_ unsigned satcom::lib::ClientSocketHandle<Policy>::
+prefix_ unsigned senf::ClientSocketHandle<Policy>::
writeto(typename boost::call_traits<typename Policy::AddressingPolicy::Address>::param_type addr,
char const * buffer, unsigned size)
{
template <class Policy>
prefix_ typename Policy::AddressingPolicy::Address
-satcom::lib::ClientSocketHandle<Policy>::peer()
+senf::ClientSocketHandle<Policy>::peer()
{
typename Policy::AddressingPolicy::Address addr;
this->peer(addr);
}
template <class Policy>
-prefix_ void satcom::lib::ClientSocketHandle<Policy>::
+prefix_ void senf::ClientSocketHandle<Policy>::
peer(typename Policy::AddressingPolicy::Address & addr)
{
Policy::AddressingPolicy::peer(*this,addr);
template <class Policy>
prefix_ typename Policy::AddressingPolicy::Address
-satcom::lib::ClientSocketHandle<Policy>::local()
+senf::ClientSocketHandle<Policy>::local()
{
typename Policy::AddressingPolicy::Address addr;
this->local(addr);
}
template <class Policy>
-prefix_ void satcom::lib::ClientSocketHandle<Policy>::
+prefix_ void senf::ClientSocketHandle<Policy>::
local(typename Policy::AddressingPolicy::Address & addr)
{
Policy::AddressingPolicy::local(*this,addr);
}
template <class Policy>
-prefix_ void satcom::lib::ClientSocketHandle<Policy>::connect(AddressParam addr)
+prefix_ void senf::ClientSocketHandle<Policy>::connect(AddressParam addr)
{
Policy::AddressingPolicy::connect(*this,addr);
}
template <class Policy>
-prefix_ void satcom::lib::ClientSocketHandle<Policy>::
+prefix_ void senf::ClientSocketHandle<Policy>::
bind(typename boost::call_traits<typename Policy::AddressingPolicy::Address>::param_type addr)
{
Policy::AddressingPolicy::bind(*this,addr);
// Buffering
template <class Policy>
-prefix_ unsigned satcom::lib::ClientSocketHandle<Policy>::rcvbuf()
+prefix_ unsigned senf::ClientSocketHandle<Policy>::rcvbuf()
{
return Policy::BufferingPolicy::rcvbuf(*this);
}
template <class Policy>
-prefix_ void satcom::lib::ClientSocketHandle<Policy>::rcvbuf(unsigned size)
+prefix_ void senf::ClientSocketHandle<Policy>::rcvbuf(unsigned size)
{
Policy::BufferingPolicy::rcvbuf(*this,size);
}
template <class Policy>
-prefix_ unsigned satcom::lib::ClientSocketHandle<Policy>::sndbuf()
+prefix_ unsigned senf::ClientSocketHandle<Policy>::sndbuf()
{
return Policy::BufferingPolicy::sndbuf(*this);
}
template <class Policy>
-prefix_ void satcom::lib::ClientSocketHandle<Policy>::sndbuf(unsigned size)
+prefix_ void senf::ClientSocketHandle<Policy>::sndbuf(unsigned size)
{
Policy::BufferingPolicy::sndbuf(*this,size);
}
///////////////////////////////////////////////////////////////////////////
template <class Policy>
-prefix_ satcom::lib::ClientSocketHandle<Policy>
-satcom::lib::ClientSocketHandle<Policy>::cast_static(FileHandle handle)
+prefix_ senf::ClientSocketHandle<Policy>
+senf::ClientSocketHandle<Policy>::cast_static(FileHandle handle)
{
return ClientSocketHandle(handle, true);
}
template <class Policy>
-prefix_ satcom::lib::ClientSocketHandle<Policy>
-satcom::lib::ClientSocketHandle<Policy>::cast_dynamic(FileHandle handle)
+prefix_ senf::ClientSocketHandle<Policy>
+senf::ClientSocketHandle<Policy>::cast_dynamic(FileHandle handle)
{
SocketHandle<Policy> h (SocketHandle<Policy>::cast_dynamic(handle));
if (static_cast<SocketBody&>(FileHandle::body(h)).isServer())
}
template <class Policy>
-prefix_ void satcom::lib::ClientSocketHandle<Policy>::state(SocketStateMap & map, unsigned lod)
+prefix_ void senf::ClientSocketHandle<Policy>::state(SocketStateMap & map, unsigned lod)
{
map["handle"] = prettyName(typeid(*this));
this->body().state(map,lod);
}
template <class Policy>
-prefix_ std::string satcom::lib::ClientSocketHandle<Policy>::dumpState(unsigned lod)
+prefix_ std::string senf::ClientSocketHandle<Policy>::dumpState(unsigned lod)
{
SocketStateMap map;
state(map,lod);
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "ClientSocketHandle.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
template <class Policy> class ServerSocketHandle;
private:
unsigned available();
- friend class satcom::lib::ServerSocketHandle<Policy>;
+ friend class senf::ServerSocketHandle<Policy>;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "ClientSocketHandle.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
namespace {
- namespace sl = satcom::lib;
+ namespace sl = senf;
class MySocketHandle
: public sl::ClientSocketHandle<sl::test::SomeProtocol::Policy>
}
BOOST_CHECK_NO_THROW( BOOST_CHECK_EQUAL( myh.write("TEST-WRITE"), 10u ) );
- BOOST_CHECK_THROW( myh.write("TEST"),satcom::lib::SystemException );
+ BOOST_CHECK_THROW( myh.write("TEST"),senf::SystemException );
BOOST_CHECK_NO_THROW( BOOST_CHECK_EQUAL( myh.write("TEST-WRITE9",10), 10u ) );
BOOST_CHECK_NO_THROW( BOOST_CHECK_EQUAL( myh.writeto(0,"TEST-WRITE"), 10u ) );
BOOST_CHECK_NO_THROW( BOOST_CHECK_EQUAL( myh.writeto(0,"TEST-WRITE9",10), 10u ) );
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::lib::ConnectedCommunicationPolicy::listen(FileHandle handle,
+prefix_ void senf::ConnectedCommunicationPolicy::listen(FileHandle handle,
unsigned backlog)
{
::listen(handle.fd(),backlog);
}
-prefix_ int satcom::lib::ConnectedCommunicationPolicy::do_accept(FileHandle handle,
+prefix_ int senf::ConnectedCommunicationPolicy::do_accept(FileHandle handle,
struct sockaddr * addr,
unsigned len)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Policy>
-prefix_ int satcom::lib::ConnectedCommunicationPolicy::
+prefix_ int senf::ConnectedCommunicationPolicy::
accept(ServerSocketHandle<Policy> handle,
typename ServerSocketHandle<Policy>::Address & address,
typename IfAddressingPolicyIsNot<Policy,NoAddressingPolicy>::type *)
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
struct sockaddr;
-namespace satcom {
-namespace lib {
+namespace senf {
+
template <class Policy> class ServerSocketHandle;
struct UnconnectedCommunicationPolicy : public CommunicationPolicyBase
{};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::lib::FileBody::v_close()
+prefix_ void senf::FileBody::v_close()
{
if (::close(fd_) != 0)
throw SystemException(errno);
}
-prefix_ void satcom::lib::FileBody::v_terminate()
+prefix_ void senf::FileBody::v_terminate()
{
::close(fd_);
}
-prefix_ bool satcom::lib::FileBody::v_eof()
+prefix_ bool senf::FileBody::v_eof()
const
{
return false;
}
-prefix_ bool satcom::lib::FileBody::v_valid()
+prefix_ bool senf::FileBody::v_valid()
const
{
return true;
}
-prefix_ bool satcom::lib::FileBody::blocking()
+prefix_ bool senf::FileBody::blocking()
const
{
int flags = ::fcntl(fd(),F_GETFL);
return ! (flags & O_NONBLOCK);
}
-prefix_ void satcom::lib::FileBody::blocking(bool status)
+prefix_ void senf::FileBody::blocking(bool status)
{
int flags = ::fcntl(fd(),F_GETFL);
if (flags < 0) throw SystemException(errno);
if (::fcntl(fd(), F_SETFL, flags) < 0) throw SystemException(errno);
}
-prefix_ bool satcom::lib::FileBody::pollCheck(int fd, bool incoming, bool block)
+prefix_ bool senf::FileBody::pollCheck(int fd, bool incoming, bool block)
const
{
struct ::pollfd pfd;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cci.p///////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::FileBody
+// senf::FileBody
-prefix_ satcom::lib::FileBody::FileBody(int fd)
+prefix_ senf::FileBody::FileBody(int fd)
: fd_(fd)
{}
-prefix_ satcom::lib::FileBody::~FileBody()
+prefix_ senf::FileBody::~FileBody()
{
if (valid())
try {
}
}
-prefix_ void satcom::lib::FileBody::close()
+prefix_ void senf::FileBody::close()
{
if (!valid())
throw SystemException(EBADF);
fd_ = -1;
}
-prefix_ void satcom::lib::FileBody::terminate()
+prefix_ void senf::FileBody::terminate()
{
if (valid()) {
v_terminate();
}
}
-prefix_ int satcom::lib::FileBody::fd()
+prefix_ int senf::FileBody::fd()
const
{
return fd_;
}
-prefix_ void satcom::lib::FileBody::fd(int fd)
+prefix_ void senf::FileBody::fd(int fd)
{
fd_ = fd;
}
-prefix_ bool satcom::lib::FileBody::eof()
+prefix_ bool senf::FileBody::eof()
const
{
return v_eof();
}
-prefix_ bool satcom::lib::FileBody::valid()
+prefix_ bool senf::FileBody::valid()
const
{
return fd_!=-1 && v_valid();
}
-prefix_ bool satcom::lib::FileBody::readable()
+prefix_ bool senf::FileBody::readable()
const
{
return pollCheck(fd(),true);
}
-prefix_ void satcom::lib::FileBody::waitReadable()
+prefix_ void senf::FileBody::waitReadable()
const
{
pollCheck(fd(),true,true);
}
-prefix_ bool satcom::lib::FileBody::writeable()
+prefix_ bool senf::FileBody::writeable()
const
{
return pollCheck(fd(),false);
}
-prefix_ void satcom::lib::FileBody::waitWriteable()
+prefix_ void senf::FileBody::waitWriteable()
const
{
pollCheck(fd(),false,true);
}
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::FileHandle
+// senf::FileHandle
-prefix_ void satcom::lib::FileHandle::close()
+prefix_ void senf::FileHandle::close()
{
body().close();
}
-prefix_ void satcom::lib::FileHandle::terminate()
+prefix_ void senf::FileHandle::terminate()
{
body().terminate();
}
-prefix_ bool satcom::lib::FileHandle::readable()
+prefix_ bool senf::FileHandle::readable()
const
{
return body().readable();
}
-prefix_ void satcom::lib::FileHandle::waitReadable()
+prefix_ void senf::FileHandle::waitReadable()
const
{
body().waitReadable();
}
-prefix_ bool satcom::lib::FileHandle::writeable()
+prefix_ bool senf::FileHandle::writeable()
const
{
return body().writeable();
}
-prefix_ void satcom::lib::FileHandle::waitWriteable()
+prefix_ void senf::FileHandle::waitWriteable()
const
{
body().waitWriteable();
}
-prefix_ bool satcom::lib::FileHandle::blocking()
+prefix_ bool senf::FileHandle::blocking()
const
{
return body().blocking();
}
-prefix_ void satcom::lib::FileHandle::blocking(bool status)
+prefix_ void senf::FileHandle::blocking(bool status)
{
body().blocking(status);
}
-prefix_ bool satcom::lib::FileHandle::eof()
+prefix_ bool senf::FileHandle::eof()
const
{
return body().eof();
}
-prefix_ bool satcom::lib::FileHandle::valid()
+prefix_ bool senf::FileHandle::valid()
const
{
return body().valid();
}
-prefix_ bool satcom::lib::FileHandle::boolean_test()
+prefix_ bool senf::FileHandle::boolean_test()
const
{
return valid() && !eof();
}
-prefix_ int satcom::lib::FileHandle::fd()
+prefix_ int senf::FileHandle::fd()
const
{
return body().fd();
}
-prefix_ satcom::lib::FileHandle::FileHandle(std::auto_ptr<FileBody> body)
+prefix_ senf::FileHandle::FileHandle(std::auto_ptr<FileBody> body)
: body_(body.release())
{}
-prefix_ satcom::lib::FileBody & satcom::lib::FileHandle::body()
+prefix_ senf::FileBody & senf::FileHandle::body()
{
return *body_;
}
-prefix_ satcom::lib::FileBody const & satcom::lib::FileHandle::body()
+prefix_ senf::FileBody const & senf::FileHandle::body()
const
{
return *body_;
}
-prefix_ satcom::lib::FileBody & satcom::lib::FileHandle::body(FileHandle & handle)
+prefix_ senf::FileBody & senf::FileHandle::body(FileHandle & handle)
{
return handle.body();
}
-prefix_ satcom::lib::FileBody const &
-satcom::lib::FileHandle::body(FileHandle const & handle)
+prefix_ senf::FileBody const &
+senf::FileHandle::body(FileHandle const & handle)
{
return handle.body();
}
-prefix_ void satcom::lib::FileHandle::fd(int fd)
+prefix_ void senf::FileHandle::fd(int fd)
{
body().fd(fd);
}
-prefix_ satcom::lib::FileHandle::FileHandle
-satcom::lib::FileHandle::cast_static(FileHandle handle)
+prefix_ senf::FileHandle::FileHandle
+senf::FileHandle::cast_static(FileHandle handle)
{
return handle;
}
-prefix_ satcom::lib::FileHandle
-satcom::lib::FileHandle::cast_dynamic(FileHandle handle)
+prefix_ senf::FileHandle
+senf::FileHandle::cast_dynamic(FileHandle handle)
{
return handle;
}
-prefix_ int satcom::lib::retrieve_filehandle(FileHandle handle)
+prefix_ int senf::retrieve_filehandle(FileHandle handle)
{
return handle.fd();
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////hh.p////////////////////////////////////////
#include "FileHandle.ih"
-namespace satcom {
-namespace lib {
+namespace senf {
+
/** \brief
*/
int retrieve_filehandle(FileHandle handle);
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "FileHandle.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ih.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
/** \brief
*/
class FileBody
- : public satcom::lib::intrusive_refcount
+ : public senf::intrusive_refcount
{
public:
///////////////////////////////////////////////////////////////////////////
int fd_;
};
-}}
+}
///////////////////////////////ih.e////////////////////////////////////////
#endif
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cc.p////////////////////////////////////////
namespace {
- class FHandle : public satcom::lib::FileHandle
+ class FHandle : public senf::FileHandle
{
public:
FHandle(int fd=-1)
- : satcom::lib::FileHandle(std::auto_ptr<satcom::lib::FileBody>(
- new satcom::lib::FileBody(fd))) {}
+ : senf::FileHandle(std::auto_ptr<senf::FileBody>(
+ new senf::FileBody(fd))) {}
FHandle(std::string name)
- : satcom::lib::FileHandle(std::auto_ptr<satcom::lib::FileBody>(
- new satcom::lib::FileBody()))
+ : senf::FileHandle(std::auto_ptr<senf::FileBody>(
+ new senf::FileBody()))
{
int rv = ::open(name.c_str(),O_RDWR|O_NONBLOCK) ;
if (rv<0)
- throw satcom::lib::SystemException(errno);
+ throw senf::SystemException(errno);
fd(rv);
}
};
BOOST_CHECK(fh.writeable());
BOOST_CHECK_NO_THROW(fh.close());
- BOOST_CHECK_THROW(fh.close(),satcom::lib::SystemException);
+ BOOST_CHECK_THROW(fh.close(),senf::SystemException);
BOOST_CHECK_NO_THROW(fh.terminate());
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "FramingPolicy.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
struct StreamFramingPolicy : public FramingPolicyBase
{};
struct DatagramFramingPolicy : public FramingPolicyBase
{};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "FramingPolicy.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::lib::GenericAddressingPolicy_Base::do_local(FileHandle handle,
+prefix_ void senf::GenericAddressingPolicy_Base::do_local(FileHandle handle,
struct sockaddr * addr,
unsigned len)
{
throw SystemException(errno);
}
-prefix_ void satcom::lib::GenericAddressingPolicy_Base::do_peer(FileHandle handle,
+prefix_ void senf::GenericAddressingPolicy_Base::do_peer(FileHandle handle,
struct sockaddr * addr,
unsigned len)
{
throw SystemException(errno);
}
-prefix_ void satcom::lib::GenericAddressingPolicy_Base::do_bind(FileHandle handle,
+prefix_ void senf::GenericAddressingPolicy_Base::do_bind(FileHandle handle,
struct sockaddr const * addr,
unsigned len)
{
throw SystemException(errno);
}
-prefix_ void satcom::lib::GenericAddressingPolicy_Base::do_connect(FileHandle handle,
+prefix_ void senf::GenericAddressingPolicy_Base::do_connect(FileHandle handle,
struct sockaddr const * addr,
unsigned len)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::GenericAddressingPolicy<Address>
+// senf::GenericAddressingPolicy<Address>
template <class Address>
template <class Policy>
-prefix_ void satcom::lib::GenericAddressingPolicy<Address>::
+prefix_ void senf::GenericAddressingPolicy<Address>::
peer(SocketHandle<Policy> handle, Address & addr,
typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type *)
{
template <class Address>
template <class Policy>
-prefix_ void satcom::lib::GenericAddressingPolicy<Address>::
+prefix_ void senf::GenericAddressingPolicy<Address>::
connect(SocketHandle<Policy> handle, Address const & addr,
typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type *)
{
}
template <class Address>
-prefix_ void satcom::lib::GenericAddressingPolicy<Address>::local(FileHandle handle,
+prefix_ void senf::GenericAddressingPolicy<Address>::local(FileHandle handle,
Address & addr)
{
addr.clear();
}
template <class Address>
-prefix_ void satcom::lib::GenericAddressingPolicy<Address>::bind(FileHandle handle,
+prefix_ void senf::GenericAddressingPolicy<Address>::bind(FileHandle handle,
Address const & addr)
{
do_bind(handle,addr.sockaddr_p(),addr.sockaddr_len());
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "GenericAddressingPolicy.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
struct GenericAddressingPolicy_Base
{
static void bind(FileHandle handle, Address const & addr);
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "GenericAddressingPolicy.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ satcom::lib::GenericSockAddr::GenericSockAddr()
+prefix_ senf::GenericSockAddr::GenericSockAddr()
{}
-prefix_ struct sockaddr * satcom::lib::GenericSockAddr::sockaddr_p()
+prefix_ struct sockaddr * senf::GenericSockAddr::sockaddr_p()
{
return reinterpret_cast<sockaddr *>(&addr_);
}
-prefix_ struct sockaddr const * satcom::lib::GenericSockAddr::sockaddr_p()
+prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p()
const
{
return reinterpret_cast<sockaddr const *>(&addr_);
}
-prefix_ unsigned satcom::lib::GenericSockAddr::sockaddr_len()
+prefix_ unsigned senf::GenericSockAddr::sockaddr_len()
const
{
return sizeof(addr_);
//#include "GenericSockAddr.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
class GenericSockAddr
{
struct ::sockaddr_storage addr_;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "GenericSockAddr.cci"
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ satcom::lib::INet4Address::INet4Address(std::string host, unsigned port)
+prefix_ senf::INet4Address::INet4Address(std::string host, unsigned port)
{
clear();
// TODO: gethostbyname einbauen
addr_.sin_port = htons(port);
}
-prefix_ std::string satcom::lib::INet4Address::str()
+prefix_ std::string senf::INet4Address::str()
const
{
std::stringstream s;
return s.str();
}
-prefix_ void satcom::lib::INet4Address::clear()
+prefix_ void senf::INet4Address::clear()
{
::memset(&addr_,0,sizeof(addr_));
addr_.sin_family = AF_INET;
}
-prefix_ void satcom::lib::INet4Address::assignString(std::string address)
+prefix_ void senf::INet4Address::assignString(std::string address)
{
clear();
// TODO: gethostbyname einbauen
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ satcom::lib::INet4Address::INet4Address()
+prefix_ senf::INet4Address::INet4Address()
{
clear();
}
-prefix_ satcom::lib::INet4Address::INet4Address(char const * address)
+prefix_ senf::INet4Address::INet4Address(char const * address)
{
assignString(address);
}
-prefix_ satcom::lib::INet4Address::INet4Address(std::string address)
+prefix_ senf::INet4Address::INet4Address(std::string address)
{
assignString(address);
}
-prefix_ bool satcom::lib::INet4Address::operator==(INet4Address const & other)
+prefix_ bool senf::INet4Address::operator==(INet4Address const & other)
const
{
return addr_.sin_port == other.addr_.sin_port &&
addr_.sin_addr.s_addr == other.addr_.sin_addr.s_addr;
}
-prefix_ std::string satcom::lib::INet4Address::host()
+prefix_ std::string senf::INet4Address::host()
const
{
// FIXME: thread safety?
return std::string(::inet_ntoa(addr_.sin_addr));
}
-prefix_ unsigned satcom::lib::INet4Address::port()
+prefix_ unsigned senf::INet4Address::port()
const
{
return ntohs(addr_.sin_port);
}
-prefix_ struct sockaddr * satcom::lib::INet4Address::sockaddr_p()
+prefix_ struct sockaddr * senf::INet4Address::sockaddr_p()
{
return reinterpret_cast<struct sockaddr *>(&addr_);
}
-prefix_ struct sockaddr const * satcom::lib::INet4Address::sockaddr_p()
+prefix_ struct sockaddr const * senf::INet4Address::sockaddr_p()
const
{
return reinterpret_cast<struct sockaddr const *>(&addr_);
}
-prefix_ unsigned satcom::lib::INet4Address::sockaddr_len()
+prefix_ unsigned senf::INet4Address::sockaddr_len()
const
{
return sizeof(addr_);
}
-prefix_ std::ostream & satcom::lib::operator<<(std::ostream & os, INet4Address const & addr)
+prefix_ std::ostream & senf::operator<<(std::ostream & os, INet4Address const & addr)
{
os << addr.str();
return os;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "INetAddressing.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
// TODO: Implement real INet4Address datatype and
// rename this one to INet4SockAddress ...
struct InvalidINetAddressException : public std::exception
{ char const * what() const throw() { return "invalid inet address"; } };
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "INetAddressing.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
BOOST_AUTO_UNIT_TEST(inet4Address)
{
- using satcom::lib::INet4Address;
- using satcom::lib::InvalidINetAddressException;
+ using senf::INet4Address;
+ using senf::InvalidINetAddressException;
{
INet4Address addr;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cc.p////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::INet4Protocol
+// senf::INet4Protocol
-prefix_ void satcom::lib::IPv4Protocol::connect(INet4Address const & address)
+prefix_ void senf::IPv4Protocol::connect(INet4Address const & address)
const
{
if (::connect(body().fd(),address.sockaddr_p(), address.sockaddr_len()) < 0)
throw SystemException(errno);
}
-prefix_ void satcom::lib::IPv4Protocol::bind(INet4Address const & address)
+prefix_ void senf::IPv4Protocol::bind(INet4Address const & address)
const
{
if (::bind(body().fd(),address.sockaddr_p(), address.sockaddr_len()) < 0)
throw SystemException(errno);
}
-prefix_ bool satcom::lib::IPv4Protocol::mcLoop()
+prefix_ bool senf::IPv4Protocol::mcLoop()
const
{
int value;
return value;
}
-prefix_ void satcom::lib::IPv4Protocol::mcLoop(bool value)
+prefix_ void senf::IPv4Protocol::mcLoop(bool value)
const
{
int ivalue (value);
throw SystemException(errno);
}
-prefix_ void satcom::lib::IPv4Protocol::mcAddMembership(INet4Address const & mcAddr)
+prefix_ void senf::IPv4Protocol::mcAddMembership(INet4Address const & mcAddr)
const
{
struct ip_mreqn mreqn;
throw SystemException(errno);
}
-prefix_ void satcom::lib::IPv4Protocol::mcAddMembership(INet4Address const & mcAddr,
+prefix_ void senf::IPv4Protocol::mcAddMembership(INet4Address const & mcAddr,
INet4Address const & localAddr)
const
{
throw SystemException(errno);
}
-prefix_ void satcom::lib::IPv4Protocol::mcDropMembership(INet4Address const & mcAddr)
+prefix_ void senf::IPv4Protocol::mcDropMembership(INet4Address const & mcAddr)
const
{
struct ip_mreqn mreqn;
throw SystemException(errno);
}
-prefix_ void satcom::lib::IPv4Protocol::mcDropMembership(INet4Address const & mcAddr,
+prefix_ void senf::IPv4Protocol::mcDropMembership(INet4Address const & mcAddr,
INet4Address const & localAddr)
const
{
throw SystemException(errno);
}
-prefix_ void satcom::lib::IPv4Protocol::mcIface(std::string iface)
+prefix_ void senf::IPv4Protocol::mcIface(std::string iface)
const
{
struct ip_mreqn mreqn;
throw SystemException(errno);
}
-prefix_ unsigned satcom::lib::IPv4Protocol::mcTTL()
+prefix_ unsigned senf::IPv4Protocol::mcTTL()
const
{
int value;
return value;
}
-prefix_ void satcom::lib::IPv4Protocol::mcTTL(unsigned value)
+prefix_ void senf::IPv4Protocol::mcTTL(unsigned value)
const
{
if (::setsockopt(body().fd(),SOL_IP,IP_MULTICAST_TTL,&value,sizeof(value)) < 0)
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "INetProtocol.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
class IPv4Protocol
: public virtual SocketProtocol
: public virtual SocketProtocol
{};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "INetProtocol.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ unsigned char satcom::lib::detail::hexnibble(char c)
+prefix_ unsigned char senf::detail::hexnibble(char c)
{
if (c>='0' && c<='9')
return c - '0';
throw InvalidLLSocketAddressException();
}
-prefix_ std::string satcom::lib::LLSocketAddress::interface()
+prefix_ std::string senf::LLSocketAddress::interface()
const
{
if (addr_.sll_ifindex == 0)
/*
-prefix_ void satcom::lib::LLSocketAddress::address(std::string address)
+prefix_ void senf::LLSocketAddress::address(std::string address)
{
typedef boost::split_iterator<std::string::iterator> StringSplitIterator;
StringSplitIterator i = boost::make_split_iterator(address, boost::token_finder(boost::is_any_of("-: ")));
}
*/
-prefix_ void satcom::lib::LLSocketAddress::interface(std::string interface)
+prefix_ void senf::LLSocketAddress::interface(std::string interface)
{
if (! interface.empty()) {
addr_.sll_ifindex = if_nametoindex(interface.c_str());
}
-prefix_ satcom::lib::detail::LLAddressFromStringRange
-satcom::lib::llAddress(std::string address)
+prefix_ senf::detail::LLAddressFromStringRange
+senf::llAddress(std::string address)
{
detail::StringSplitIterator i =
boost::make_split_iterator(address, boost::token_finder(boost::is_any_of("-: ")));
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ satcom::lib::LLSocketAddress::LLSocketAddress()
+prefix_ senf::LLSocketAddress::LLSocketAddress()
{
clear();
}
-prefix_ satcom::lib::LLSocketAddress::LLSocketAddress(unsigned protocol, std::string interface)
+prefix_ senf::LLSocketAddress::LLSocketAddress(unsigned protocol, std::string interface)
{
clear();
this->protocol(protocol);
this->interface(interface);
}
-prefix_ satcom::lib::LLSocketAddress::LLSocketAddress(std::string interface)
+prefix_ senf::LLSocketAddress::LLSocketAddress(std::string interface)
{
clear();
this->interface(interface);
}
-prefix_ void satcom::lib::LLSocketAddress::clear()
+prefix_ void senf::LLSocketAddress::clear()
{
::memset(&addr_,0,sizeof(addr_));
addr_.sll_family = AF_PACKET;
}
-prefix_ unsigned satcom::lib::LLSocketAddress::protocol()
+prefix_ unsigned senf::LLSocketAddress::protocol()
const
{
return ntohs(addr_.sll_protocol);
}
-prefix_ unsigned satcom::lib::LLSocketAddress::arptype()
+prefix_ unsigned senf::LLSocketAddress::arptype()
const
{
// TODO: Check, wether this is returned in network or host byte
return ntohs(addr_.sll_hatype);
}
-prefix_ unsigned satcom::lib::LLSocketAddress::pkttype()
+prefix_ unsigned senf::LLSocketAddress::pkttype()
const
{
// TODO: Check, wether this is returned in network or host byte
return ntohs(addr_.sll_pkttype);
}
-prefix_ satcom::lib::LLSocketAddress::LLAddress satcom::lib::LLSocketAddress::address()
+prefix_ senf::LLSocketAddress::LLAddress senf::LLSocketAddress::address()
const
{
return LLAddress(&addr_.sll_addr[0], &addr_.sll_addr[addr_.sll_halen]);
}
-prefix_ void satcom::lib::LLSocketAddress::protocol(unsigned protocol)
+prefix_ void senf::LLSocketAddress::protocol(unsigned protocol)
{
addr_.sll_protocol = htons(protocol);
}
-prefix_ struct sockaddr * satcom::lib::LLSocketAddress::sockaddr_p()
+prefix_ struct sockaddr * senf::LLSocketAddress::sockaddr_p()
{
return reinterpret_cast<struct sockaddr *>(&addr_);
}
-prefix_ struct sockaddr const * satcom::lib::LLSocketAddress::sockaddr_p()
+prefix_ struct sockaddr const * senf::LLSocketAddress::sockaddr_p()
const
{
return reinterpret_cast<struct sockaddr const *>(&addr_);
}
-prefix_ unsigned satcom::lib::LLSocketAddress::sockaddr_len()
+prefix_ unsigned senf::LLSocketAddress::sockaddr_len()
const
{
return sizeof(addr_);
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ct.p////////////////////////////////////////
template <class ForwardRange>
-prefix_ void satcom::lib::LLSocketAddress::address(ForwardRange const & address)
+prefix_ void senf::LLSocketAddress::address(ForwardRange const & address)
{
if (boost::size(address) > sizeof(addr_.sll_addr))
throw InvalidLLSocketAddressException();
template <class ForwardRange>
prefix_ std::string
-satcom::lib::llAddress(ForwardRange const & address,
+senf::llAddress(ForwardRange const & address,
typename boost::enable_if< boost::is_class<ForwardRange> >::type *)
{
if (boost::empty(address))
}
template <class ForwardRange>
-prefix_ unsigned char satcom::lib::detail::HexConverter::operator()(ForwardRange const & v)
+prefix_ unsigned char senf::detail::HexConverter::operator()(ForwardRange const & v)
const
{
if (boost::size(v) != 2)
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class ForwardRange>
-prefix_ satcom::lib::LLSocketAddress::
+prefix_ senf::LLSocketAddress::
LLSocketAddress(ForwardRange const & address, std::string interface,
typename boost::enable_if_c<! boost::is_integral<ForwardRange>::value >::type *)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#include "LLAddressing.ih"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
class LLSocketAddress
{
struct InvalidLLSocketAddressException : public std::exception
{ char const * what() const throw() { return "invalid ll address"; } };
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "LLAddressing.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ih.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
namespace detail {
struct HexConverter {
unsigned char hexnibble(char c);
-}}}
+}}
///////////////////////////////ih.e////////////////////////////////////////
#endif
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
BOOST_AUTO_UNIT_TEST(llAddress)
{
{
- satcom::lib::LLSocketAddress a;
+ senf::LLSocketAddress a;
BOOST_CHECK_EQUAL( a.protocol(), 0u );
BOOST_CHECK_EQUAL( a.interface(), "" );
BOOST_CHECK_EQUAL( a.pkttype(), 0u );
BOOST_CHECK_EQUAL( a.address(), "" );
- a.address(satcom::lib::llAddress("05-10-1A-2f-25-30"));
- BOOST_CHECK_EQUAL( satcom::lib::llAddress(a.address()), "05-10-1a-2f-25-30" );
+ a.address(senf::llAddress("05-10-1A-2f-25-30"));
+ BOOST_CHECK_EQUAL( senf::llAddress(a.address()), "05-10-1a-2f-25-30" );
a.interface("lo");
BOOST_CHECK_EQUAL( a.interface(), "lo" );
a.protocol(123);
}
{
- satcom::lib::LLSocketAddress a (
- satcom::lib::llAddress("11-12-13-14-15-16"), "lo");
+ senf::LLSocketAddress a (
+ senf::llAddress("11-12-13-14-15-16"), "lo");
BOOST_CHECK_EQUAL( a.protocol(), 0u );
BOOST_CHECK_EQUAL( a.interface(), "lo" );
BOOST_CHECK_EQUAL( a.arptype(), 0u );
BOOST_CHECK_EQUAL( a.pkttype(), 0u );
- BOOST_CHECK_EQUAL( satcom::lib::llAddress(a.address()), "11-12-13-14-15-16" );
+ BOOST_CHECK_EQUAL( senf::llAddress(a.address()), "11-12-13-14-15-16" );
}
{
- satcom::lib::LLSocketAddress a (123, "lo");
+ senf::LLSocketAddress a (123, "lo");
BOOST_CHECK_EQUAL( a.protocol(), 123u );
BOOST_CHECK_EQUAL( a.interface(), "lo" );
BOOST_CHECK_EQUAL( a.arptype(), 0u );
BOOST_CHECK_EQUAL( a.pkttype(), 0u );
- BOOST_CHECK_EQUAL( satcom::lib::llAddress(a.address()), "" );
+ BOOST_CHECK_EQUAL( senf::llAddress(a.address()), "" );
}
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::lib::PacketProtocol::init_client(SocketType type, int protocol)
+prefix_ void senf::PacketProtocol::init_client(SocketType type, int protocol)
const
{
int socktype = SOCK_RAW;
body().fd(sock);
}
-prefix_ std::auto_ptr<satcom::lib::SocketProtocol> satcom::lib::PacketProtocol::clone()
+prefix_ std::auto_ptr<senf::SocketProtocol> senf::PacketProtocol::clone()
const
{
return std::auto_ptr<SocketProtocol>(new PacketProtocol());
}
-prefix_ unsigned satcom::lib::PacketProtocol::available()
+prefix_ unsigned senf::PacketProtocol::available()
const
{
if (! body().readable())
return l;
}
-prefix_ bool satcom::lib::PacketProtocol::eof()
+prefix_ bool senf::PacketProtocol::eof()
const
{
return false;
}
-prefix_ void satcom::lib::PacketProtocol::promisc(std::string interface, PromiscMode mode)
+prefix_ void senf::PacketProtocol::promisc(std::string interface, PromiscMode mode)
const
{
// The interface is really stupid: as far as i understand, it is possible to
throw SystemException(errno);
}
-prefix_ void satcom::lib::PacketProtocol::do_mc_i(std::string interface,
+prefix_ void senf::PacketProtocol::do_mc_i(std::string interface,
detail::LLAddressCopier const & copier, bool add)
const
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
template <class ForwardRange>
prefix_ unsigned
-satcom::lib::detail::Range_LLAddressCopier<ForwardRange>::operator()(unsigned char * target)
+senf::detail::Range_LLAddressCopier<ForwardRange>::operator()(unsigned char * target)
const
{
std::size_t len (0);
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class ForwardRange>
-prefix_ void satcom::lib::PacketProtocol::mcAdd(std::string interface,
+prefix_ void senf::PacketProtocol::mcAdd(std::string interface,
ForwardRange const & address)
const
{
}
template <class ForwardRange>
-prefix_ void satcom::lib::PacketProtocol::mcDrop(std::string interface,
+prefix_ void senf::PacketProtocol::mcDrop(std::string interface,
ForwardRange const & address)
const
{
}
template <class ForwardRange>
-prefix_ satcom::lib::detail::Range_LLAddressCopier<ForwardRange>::
+prefix_ senf::detail::Range_LLAddressCopier<ForwardRange>::
Range_LLAddressCopier(ForwardRange const & range)
: range_ (range)
{}
template <class ForwardRange>
-prefix_ void satcom::lib::PacketProtocol::do_mc(std::string interface,
+prefix_ void senf::PacketProtocol::do_mc(std::string interface,
ForwardRange const & address, bool add)
const
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#include "PacketSocketHandle.ih"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
typedef MakeSocketPolicy<
LLAddressingPolicy,
typedef ProtocolClientSocketHandle<PacketProtocol> PacketSocketHandle;
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "PacketSocketHandle.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ih.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
namespace detail {
struct LLAddressCopier
ForwardRange const & range_;
};
-}}}
+}}
///////////////////////////////ih.e////////////////////////////////////////
#endif
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
{
// We have a Problem here .. packet sockets are only allowed for root
if (getuid() != 0) {
- BOOST_WARN_MESSAGE(false, "Cannot test satcom::lib::PacketSocketHandle as non-root user");
+ BOOST_WARN_MESSAGE(false, "Cannot test senf::PacketSocketHandle as non-root user");
return;
}
{
- satcom::lib::PacketSocketHandle sock;
+ senf::PacketSocketHandle sock;
- BOOST_CHECK_NO_THROW( sock.bind(satcom::lib::LLSocketAddress("lo")) );
- satcom::lib::LLSocketAddress a;
+ BOOST_CHECK_NO_THROW( sock.bind(senf::LLSocketAddress("lo")) );
+ senf::LLSocketAddress a;
BOOST_CHECK_NO_THROW( sock.local(a) );
BOOST_CHECK_EQUAL( a.interface(), "lo" );
// BUG: There are some failures here ... need to investigate
/*
BOOST_CHECK_NO_THROW( sock.protocol().promisc(
- "lo",satcom::lib::PacketProtocol::Promiscuous) );
+ "lo",senf::PacketProtocol::Promiscuous) );
BOOST_CHECK_NO_THROW( sock.protocol().promisc(
- "lo",satcom::lib::PacketProtocol::AllMulticast) );
+ "lo",senf::PacketProtocol::AllMulticast) );
BOOST_CHECK_NO_THROW( sock.protocol().promisc(
- "lo",satcom::lib::PacketProtocol::None) );
+ "lo",senf::PacketProtocol::None) );
*/
BOOST_CHECK_NO_THROW( sock.protocol().mcAdd(
- "lo",satcom::lib::llAddress("01-02-03-04-05-06")) );
+ "lo",senf::llAddress("01-02-03-04-05-06")) );
BOOST_CHECK_NO_THROW( sock.protocol().mcDrop(
- "lo",satcom::lib::llAddress("01-02-03-04-05-06")) );
+ "lo",senf::llAddress("01-02-03-04-05-06")) );
BOOST_CHECK_NO_THROW( sock.protocol().available() );
BOOST_CHECK( ! sock.eof() );
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class SocketProtocol>
-prefix_ satcom::lib::ProtocolClientSocketHandle<SocketProtocol>::ProtocolClientSocketHandle()
+prefix_ senf::ProtocolClientSocketHandle<SocketProtocol>::ProtocolClientSocketHandle()
: ClientSocketHandle<typename SocketProtocol::Policy>(
- std::auto_ptr<satcom::lib::SocketProtocol>(new SocketProtocol()))
+ std::auto_ptr<senf::SocketProtocol>(new SocketProtocol()))
{
this->protocol().init_client();
}
#include BOOST_PP_ITERATE()
template <class SocketProtocol>
-prefix_ satcom::lib::ProtocolClientSocketHandle<SocketProtocol>::
+prefix_ senf::ProtocolClientSocketHandle<SocketProtocol>::
ProtocolClientSocketHandle(FileHandle other, bool isChecked)
: ClientSocketHandle<typename Protocol::Policy>(other, isChecked)
{}
template <class SocketProtocol>
prefix_ SocketProtocol const &
-satcom::lib::ProtocolClientSocketHandle<SocketProtocol>::protocol()
+senf::ProtocolClientSocketHandle<SocketProtocol>::protocol()
{
BOOST_ASSERT( dynamic_cast<SocketProtocol const *>(&this->body().protocol()) );
- // Need dynamic_cast here, since satcom::lib::SocketProtocol is a
+ // Need dynamic_cast here, since senf::SocketProtocol is a
// virtual base
return dynamic_cast<SocketProtocol const &>(this->body().protocol());
}
template <class SocketProtocol>
-prefix_ satcom::lib::ProtocolClientSocketHandle<SocketProtocol>
-satcom::lib::ProtocolClientSocketHandle<SocketProtocol>::cast_static(FileHandle handle)
+prefix_ senf::ProtocolClientSocketHandle<SocketProtocol>
+senf::ProtocolClientSocketHandle<SocketProtocol>::cast_static(FileHandle handle)
{
return ProtocolClientSocketHandle(handle,true);
}
template <class SocketProtocol>
-prefix_ satcom::lib::ProtocolClientSocketHandle<SocketProtocol>
-satcom::lib::ProtocolClientSocketHandle<SocketProtocol>::cast_dynamic(FileHandle handle)
+prefix_ senf::ProtocolClientSocketHandle<SocketProtocol>
+senf::ProtocolClientSocketHandle<SocketProtocol>::cast_dynamic(FileHandle handle)
{
ClientSocketHandle<typename SocketProtocol::Policy> h(
ClientSocketHandle<typename SocketProtocol::Policy>::cast_dynamic(handle));
template <class SocketProtocol>
prefix_ void
-satcom::lib::ProtocolClientSocketHandle<SocketProtocol>::state(SocketStateMap & map,
+senf::ProtocolClientSocketHandle<SocketProtocol>::state(SocketStateMap & map,
unsigned lod)
{
map["handle"] = prettyName(typeid(*this));
template <class SocketProtocol>
prefix_ std::string
-satcom::lib::ProtocolClientSocketHandle<SocketProtocol>::dumpState(unsigned lod)
+senf::ProtocolClientSocketHandle<SocketProtocol>::dumpState(unsigned lod)
{
SocketStateMap map;
state(map,lod);
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#include "ProtocolClientSocketHandle.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
template <class Protocol> class ProtocolServerSocketHandle;
friend class ProtocolServerSocketHandle<Protocol>;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "ProtocolClientSocketHandle.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//////
#if BOOST_PP_ITERATION_FLAGS()==1
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::ProtocolClientSocketHandle<SocketProtocol>::
+// senf::ProtocolClientSocketHandle<SocketProtocol>::
// ProtocolClientSocketHandle (constructor) declaration
template < mpp_PCSH_TemplateParameters() >
//////
#elif BOOST_PP_ITERATION_FLAGS()==2
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::ProtocolClientSocketHandle<SocketProtocol>::
+// senf::ProtocolClientSocketHandle<SocketProtocol>::
// ProtocolClientSocketHandle (constructor) implementation
template <class SocketProtocol>
template < mpp_PCSH_TemplateParameters() >
-prefix_ satcom::lib::ProtocolClientSocketHandle<SocketProtocol>::
+prefix_ senf::ProtocolClientSocketHandle<SocketProtocol>::
ProtocolClientSocketHandle( mpp_PCSH_MethodParameters() )
: ClientSocketHandle<typename SocketProtocol::Policy>(
- std::auto_ptr<satcom::lib::SocketProtocol>(new SocketProtocol()))
+ std::auto_ptr<senf::SocketProtocol>(new SocketProtocol()))
{
this->protocol().init_client( mpp_PCSH_CallParameters() );
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cc.p////////////////////////////////////////
namespace {
- struct MyProtocol : public satcom::lib::test::SomeProtocol
+ struct MyProtocol : public senf::test::SomeProtocol
{
- using satcom::lib::test::SomeProtocol::init_client;
+ using senf::test::SomeProtocol::init_client;
void init_client(char const *,unsigned) const {}
};
}
BOOST_AUTO_UNIT_TEST(protocolClientSocketHandle)
{
- typedef satcom::lib::ProtocolClientSocketHandle<MyProtocol> MySocketHandle;
+ typedef senf::ProtocolClientSocketHandle<MyProtocol> MySocketHandle;
{
- typedef satcom::lib::MakeSocketPolicy<
- satcom::lib::test::SomeFramingPolicy,
- satcom::lib::test::SomeReadPolicy,
- satcom::lib::test::SomeWritePolicy
+ typedef senf::MakeSocketPolicy<
+ senf::test::SomeFramingPolicy,
+ senf::test::SomeReadPolicy,
+ senf::test::SomeWritePolicy
>::policy OtherSocketPolicy;
- typedef satcom::lib::SocketHandle<OtherSocketPolicy> OtherSocketHandle;
+ typedef senf::SocketHandle<OtherSocketPolicy> OtherSocketHandle;
MySocketHandle h;
h.protocol();
OtherSocketHandle osh (h);
- h = satcom::lib::static_socket_cast<MySocketHandle>(osh);
+ h = senf::static_socket_cast<MySocketHandle>(osh);
}
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class SocketProtocol>
-prefix_ satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::ProtocolServerSocketHandle()
+prefix_ senf::ProtocolServerSocketHandle<SocketProtocol>::ProtocolServerSocketHandle()
: ServerSocketHandle<typename SocketProtocol::Policy>(
- std::auto_ptr<satcom::lib::SocketProtocol>(new SocketProtocol()))
+ std::auto_ptr<senf::SocketProtocol>(new SocketProtocol()))
{}
#define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 9, "Socket/ProtocolServerSocketHandle.mpp", 2))
template <class SocketProtocol>
prefix_ SocketProtocol const &
-satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::protocol()
+senf::ProtocolServerSocketHandle<SocketProtocol>::protocol()
{
BOOST_ASSERT( dynamic_cast<SocketProtocol const *>(&this->body().protocol()) );
- // Need dynamic_cast here, since satcom::lib::SocketProtocol is a
+ // Need dynamic_cast here, since senf::SocketProtocol is a
// virtual base
return dynamic_cast<SocketProtocol const &>(this->body().protocol());
}
template <class SocketProtocol>
-prefix_ satcom::lib::ProtocolClientSocketHandle<SocketProtocol>
-satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::accept()
+prefix_ senf::ProtocolClientSocketHandle<SocketProtocol>
+senf::ProtocolServerSocketHandle<SocketProtocol>::accept()
{
return ProtocolClientSocketHandle<SocketProtocol>(
FileHandle(this->ServerSocketHandle<typename SocketProtocol::Policy>::accept()),true);
}
template <class SocketProtocol>
-prefix_ satcom::lib::ProtocolServerSocketHandle<SocketProtocol>
-satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::cast_static(FileHandle handle)
+prefix_ senf::ProtocolServerSocketHandle<SocketProtocol>
+senf::ProtocolServerSocketHandle<SocketProtocol>::cast_static(FileHandle handle)
{
return ProtocolServerSocketHandle(handle,true);
}
template <class SocketProtocol>
-prefix_ satcom::lib::ProtocolServerSocketHandle<SocketProtocol>
-satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::cast_dynamic(FileHandle handle)
+prefix_ senf::ProtocolServerSocketHandle<SocketProtocol>
+senf::ProtocolServerSocketHandle<SocketProtocol>::cast_dynamic(FileHandle handle)
{
ServerSocketHandle<typename SocketProtocol::Policy> h(
ServerSocketHandle<typename SocketProtocol::Policy>::cast_dynamic(handle));
template <class SocketProtocol>
prefix_ void
-satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::state(SocketStateMap & map,
+senf::ProtocolServerSocketHandle<SocketProtocol>::state(SocketStateMap & map,
unsigned lod)
{
map["handle"] = prettyName(typeid(*this));
template <class SocketProtocol>
prefix_ std::string
-satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::dumpState(unsigned lod)
+senf::ProtocolServerSocketHandle<SocketProtocol>::dumpState(unsigned lod)
{
SocketStateMap map;
state(map,lod);
}
template <class SocketProtocol>
-prefix_ satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::
+prefix_ senf::ProtocolServerSocketHandle<SocketProtocol>::
ProtocolServerSocketHandle(FileHandle other, bool isChecked)
: ServerSocketHandle<typename SocketProtocol::Policy>(other,isChecked)
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#include "ProtocolServerSocketHandle.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
template <class Protocol> class ProtocolClientSocketHandle;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "ProtocolServerSocketHandle.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//////
#if BOOST_PP_ITERATION_FLAGS()==1
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::
+// senf::ProtocolServerSocketHandle<SocketProtocol>::
// ProtocolServerSocketHandle (constructor) declaration
template < mpp_PSSH_TemplateParameters() >
//////
#elif BOOST_PP_ITERATION_FLAGS()==2
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::
+// senf::ProtocolServerSocketHandle<SocketProtocol>::
// ProtocolServerSocketHandle (constructor) implementation
template <class SocketProtocol>
template < mpp_PSSH_TemplateParameters() >
-prefix_ satcom::lib::ProtocolServerSocketHandle<SocketProtocol>::
+prefix_ senf::ProtocolServerSocketHandle<SocketProtocol>::
ProtocolServerSocketHandle( mpp_PSSH_MethodParameters() )
: ServerSocketHandle<typename SocketProtocol::Policy>(
- std::auto_ptr<satcom::lib::SocketProtocol>(new SocketProtocol()))
+ std::auto_ptr<senf::SocketProtocol>(new SocketProtocol()))
{
this->protocol().init_server( mpp_PSSH_CallParameters() );
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
namespace {
- struct MyProtocol : public satcom::lib::test::SomeProtocol
+ struct MyProtocol : public senf::test::SomeProtocol
{
- using satcom::lib::test::SomeProtocol::init_server;
+ using senf::test::SomeProtocol::init_server;
void init_server(char const *,unsigned) const {}
};
}
BOOST_AUTO_UNIT_TEST(protocolServerSocketHandle)
{
- typedef satcom::lib::ProtocolServerSocketHandle<MyProtocol> MySocketHandle;
+ typedef senf::ProtocolServerSocketHandle<MyProtocol> MySocketHandle;
{
- typedef satcom::lib::MakeSocketPolicy<
- satcom::lib::test::SomeFramingPolicy,
- satcom::lib::test::SomeReadPolicy,
- satcom::lib::test::SomeWritePolicy
+ typedef senf::MakeSocketPolicy<
+ senf::test::SomeFramingPolicy,
+ senf::test::SomeReadPolicy,
+ senf::test::SomeWritePolicy
>::policy OtherSocketPolicy;
- typedef satcom::lib::SocketHandle<OtherSocketPolicy> OtherSocketHandle;
+ typedef senf::SocketHandle<OtherSocketPolicy> OtherSocketHandle;
MySocketHandle h;
h.protocol();
OtherSocketHandle osh (h);
- h = satcom::lib::static_socket_cast<MySocketHandle>(osh);
+ h = senf::static_socket_cast<MySocketHandle>(osh);
MySocketHandle::ClientSocketHandle client = h.accept();
BOOST_CHECK_EQUAL( client.fd(), -1 );
BOOST_CHECK_EQUAL( h.dumpState(),
- "handle: satcom::lib::ProtocolServerSocketHandle<(anonymous namespace)::MyProtocol>\n"
+ "handle: senf::ProtocolServerSocketHandle<(anonymous namespace)::MyProtocol>\n"
"file.handle: -1\n"
"file.refcount: 2\n"
- "socket.policy: satcom::lib::SocketPolicy<satcom::lib::test::SomeAddressingPolicy, satcom::lib::test::SomeFramingPolicy, satcom::lib::test::SomeCommunicationPolicy, satcom::lib::test::SomeReadPolicy, satcom::lib::test::SomeWritePolicy, satcom::lib::test::SomeBufferingPolicy>\n"
+ "socket.policy: senf::SocketPolicy<senf::test::SomeAddressingPolicy, senf::test::SomeFramingPolicy, senf::test::SomeCommunicationPolicy, senf::test::SomeReadPolicy, senf::test::SomeWritePolicy, senf::test::SomeBufferingPolicy>\n"
"socket.protocol: (anonymous namespace)::MyProtocol\n"
"socket.server: true\n" );
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ unsigned satcom::lib::ReadablePolicy::read(FileHandle handle, char * buffer,
+prefix_ unsigned senf::ReadablePolicy::read(FileHandle handle, char * buffer,
unsigned size)
{
int rv = -1;
return rv;
}
-prefix_ unsigned satcom::lib::ReadablePolicy::do_readfrom(FileHandle handle, char * buffer,
+prefix_ unsigned senf::ReadablePolicy::do_readfrom(FileHandle handle, char * buffer,
unsigned size,
struct ::sockaddr * addr, socklen_t len)
{
return rv;
}
-prefix_ unsigned satcom::lib::WriteablePolicy::do_write(FileHandle handle, char const * buffer,
+prefix_ unsigned senf::WriteablePolicy::do_write(FileHandle handle, char const * buffer,
unsigned size)
{
int rv = -1;
return rv;
}
-prefix_ unsigned satcom::lib::WriteablePolicy::do_writeto(FileHandle handle,
+prefix_ unsigned senf::WriteablePolicy::do_writeto(FileHandle handle,
char const * buffer, unsigned size,
struct sockaddr * addr, socklen_t len)
{
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class Policy>
-prefix_ unsigned satcom::lib::ReadablePolicy::
+prefix_ unsigned senf::ReadablePolicy::
readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
typename Policy::AddressingPolicy::Address & address,
typename IfCommunicationPolicyIs<Policy,UnconnectedCommunicationPolicy>::type *)
}
template <class Policy>
-prefix_ unsigned satcom::lib::WriteablePolicy::
+prefix_ unsigned senf::WriteablePolicy::
write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size,
typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type *)
{
}
template <class Policy>
-prefix_ unsigned satcom::lib::WriteablePolicy::
+prefix_ unsigned senf::WriteablePolicy::
writeto(ClientSocketHandle<Policy> handle,
typename boost::call_traits<typename Policy::AddressingPolicy::Address>::param_type addr,
char const * buffer, unsigned size,
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
struct sockaddr;
-namespace satcom {
-namespace lib {
+namespace senf {
+
struct ReadablePolicy : public ReadPolicyBase
{
struct NotWriteablePolicy : public WritePolicyBase
{};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
template <class SocketPolicy>
template <class OtherPolicy>
-prefix_ satcom::lib::ServerSocketHandle<SocketPolicy>::
+prefix_ senf::ServerSocketHandle<SocketPolicy>::
ServerSocketHandle(ServerSocketHandle<OtherPolicy> other,
typename SocketHandle<SocketPolicy>::template IsCompatible<OtherPolicy>::type *)
: SocketHandle<SocketPolicy>(other,true)
{}
template <class SocketPolicy>
-prefix_ satcom::lib::ServerSocketHandle<SocketPolicy>::
+prefix_ senf::ServerSocketHandle<SocketPolicy>::
ServerSocketHandle(std::auto_ptr<SocketProtocol> protocol)
: SocketHandle<SocketPolicy>(protocol,true)
{}
template <class SocketPolicy>
template <class OtherPolicy>
-prefix_ typename satcom::lib::SocketHandle<SocketPolicy>::template IsCompatible<OtherPolicy>::type const &
-satcom::lib::ServerSocketHandle<SocketPolicy>::operator=(ServerSocketHandle<OtherPolicy> other)
+prefix_ typename senf::SocketHandle<SocketPolicy>::template IsCompatible<OtherPolicy>::type const &
+senf::ServerSocketHandle<SocketPolicy>::operator=(ServerSocketHandle<OtherPolicy> other)
{
assign(other);
return *this;
// Server socket interface
template <class Policy>
-prefix_ void satcom::lib::ServerSocketHandle<Policy>::bind(AddressParam addr)
+prefix_ void senf::ServerSocketHandle<Policy>::bind(AddressParam addr)
{
Policy::AddressingPolicy::bind(*this,addr);
}
template <class Policy>
-prefix_ void satcom::lib::ServerSocketHandle<Policy>::listen(unsigned backlog)
+prefix_ void senf::ServerSocketHandle<Policy>::listen(unsigned backlog)
{
Policy::CommunicationPolicy::listen(*this,backlog);
}
template <class Policy>
-prefix_ typename satcom::lib::ServerSocketHandle<Policy>::Address
-satcom::lib::ServerSocketHandle<Policy>::local()
+prefix_ typename senf::ServerSocketHandle<Policy>::Address
+senf::ServerSocketHandle<Policy>::local()
{
typename Policy::AddressingPolicy::Address addr;
this->local(addr);
}
template <class Policy>
-prefix_ void satcom::lib::ServerSocketHandle<Policy>::local(Address & addr)
+prefix_ void senf::ServerSocketHandle<Policy>::local(Address & addr)
{
Policy::AddressingPolicy::local(*this,addr);
}
template <class Policy>
-prefix_ typename satcom::lib::ServerSocketHandle<Policy>::ClientSocketHandle
-satcom::lib::ServerSocketHandle<Policy>::accept()
+prefix_ typename senf::ServerSocketHandle<Policy>::ClientSocketHandle
+senf::ServerSocketHandle<Policy>::accept()
{
Address address;
return acceptfrom(address);
}
template <class Policy>
-prefix_ std::pair<typename satcom::lib::ServerSocketHandle<Policy>::ClientSocketHandle,
- typename satcom::lib::ServerSocketHandle<Policy>::Address>
-satcom::lib::ServerSocketHandle<Policy>::acceptfrom()
+prefix_ std::pair<typename senf::ServerSocketHandle<Policy>::ClientSocketHandle,
+ typename senf::ServerSocketHandle<Policy>::Address>
+senf::ServerSocketHandle<Policy>::acceptfrom()
{
Address address;
}
template <class Policy>
-prefix_ typename satcom::lib::ServerSocketHandle<Policy>::ClientSocketHandle
-satcom::lib::ServerSocketHandle<Policy>::acceptfrom(Address & addr)
+prefix_ typename senf::ServerSocketHandle<Policy>::ClientSocketHandle
+senf::ServerSocketHandle<Policy>::acceptfrom(Address & addr)
{
return ClientSocketHandle(this->protocol().clone(),
Policy::CommunicationPolicy::accept(*this,addr));
///////////////////////////////////////////////////////////////////////////
template <class Policy>
-prefix_ satcom::lib::ServerSocketHandle<Policy>::ServerSocketHandle(FileHandle other,
+prefix_ senf::ServerSocketHandle<Policy>::ServerSocketHandle(FileHandle other,
bool isChecked)
: SocketHandle<Policy>(other, isChecked)
{}
template <class Policy>
-prefix_ satcom::lib::ServerSocketHandle<Policy>
-satcom::lib::ServerSocketHandle<Policy>::cast_static(FileHandle handle)
+prefix_ senf::ServerSocketHandle<Policy>
+senf::ServerSocketHandle<Policy>::cast_static(FileHandle handle)
{
return ServerSocketHandle(handle,true);
}
template <class Policy>
-prefix_ satcom::lib::ServerSocketHandle<Policy>
-satcom::lib::ServerSocketHandle<Policy>::cast_dynamic(FileHandle handle)
+prefix_ senf::ServerSocketHandle<Policy>
+senf::ServerSocketHandle<Policy>::cast_dynamic(FileHandle handle)
{
SocketHandle<Policy> h (SocketHandle<Policy>::cast_dynamic(handle));
if (! static_cast<SocketBody&>(FileHandle::body(handle)).isServer())
}
template <class Policy>
-prefix_ void satcom::lib::ServerSocketHandle<Policy>::state(SocketStateMap & map, unsigned lod)
+prefix_ void senf::ServerSocketHandle<Policy>::state(SocketStateMap & map, unsigned lod)
{
map["handle"] = prettyName(typeid(*this));
this->body().state(map,lod);
}
template <class Policy>
-prefix_ std::string satcom::lib::ServerSocketHandle<Policy>::dumpState(unsigned lod)
+prefix_ std::string senf::ServerSocketHandle<Policy>::dumpState(unsigned lod)
{
SocketStateMap map;
state(map,lod);
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "ServerSocketHandle.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
template <class Policy> class ClientSocketHandle;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "ServerSocketHandle.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
namespace {
- namespace sl = satcom::lib;
+ namespace sl = senf;
class MySocketHandle
: public sl::ServerSocketHandle<sl::test::SomeProtocol::Policy>
typedef sl::ServerSocketHandle<sl::MakeSocketPolicy<
OtherSocketPolicy,
- satcom::lib::NoAddressingPolicy
+ senf::NoAddressingPolicy
>::policy> SomeOtherSocketHandle;
typedef sl::ClientSocketHandle<OtherSocketPolicy> OtherClientHandle;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::lib::SocketBody::v_close()
+prefix_ void senf::SocketBody::v_close()
{
if (::shutdown(fd(),SHUT_RDWR) < 0)
throw SystemException(errno);
throw SystemException(errno);
}
-prefix_ void satcom::lib::SocketBody::v_terminate()
+prefix_ void senf::SocketBody::v_terminate()
{
struct linger ling;
ling.l_onoff = 0;
::close(fd());
}
-prefix_ bool satcom::lib::SocketBody::v_eof()
+prefix_ bool senf::SocketBody::v_eof()
const
{
return protocol().eof();
}
-prefix_ void satcom::lib::SocketBody::state(SocketStateMap & map, unsigned lod)
+prefix_ void senf::SocketBody::state(SocketStateMap & map, unsigned lod)
{
map["file.handle"] = fd();
map["file.refcount"] = refcount();
}
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::detail::StateMapOrdering
+// senf::detail::StateMapOrdering
namespace {
bool contains(std::string::iterator b, std::string::iterator e, char c)
}
}
-prefix_ bool satcom::lib::detail::StateMapOrdering::operator()(std::string a1, std::string a2)
+prefix_ bool senf::detail::StateMapOrdering::operator()(std::string a1, std::string a2)
const
{
std::string::iterator i1 (a1.begin());
return *i1 < *i2;
}
-prefix_ std::string satcom::lib::detail::dumpState(SocketStateMap const & map)
+prefix_ std::string senf::detail::dumpState(SocketStateMap const & map)
{
std::stringstream s;
SocketStateMap::const_iterator i (map.begin());
}
template <class Policy>
-prefix_ std::ostream & satcom::lib::operator<<(std::ostream & os, SocketHandle<Policy> handle)
+prefix_ std::ostream & senf::operator<<(std::ostream & os, SocketHandle<Policy> handle)
{
os << handle.dumpState();
return os;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ satcom::lib::SocketBody::SocketBody(std::auto_ptr<SocketProtocol> protocol,
+prefix_ senf::SocketBody::SocketBody(std::auto_ptr<SocketProtocol> protocol,
bool isServer)
: protocol_(protocol), isServer_(isServer)
{
protocol_->body_ = this;
}
-prefix_ satcom::lib::SocketBody::SocketBody(std::auto_ptr<SocketProtocol> protocol,
+prefix_ senf::SocketBody::SocketBody(std::auto_ptr<SocketProtocol> protocol,
bool isServer, int fd)
: FileBody(fd), protocol_(protocol), isServer_(isServer)
{
protocol_->body_ = this;
}
-prefix_ satcom::lib::SocketProtocol const & satcom::lib::SocketBody::protocol()
+prefix_ senf::SocketProtocol const & senf::SocketBody::protocol()
const
{
return *protocol_;
}
-prefix_ bool satcom::lib::SocketBody::isServer()
+prefix_ bool senf::SocketBody::isServer()
{
return isServer_;
}
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::detail::ConvertibleString
+// senf::detail::ConvertibleString
-prefix_ satcom::lib::detail::ConvertibleString::ConvertibleString()
+prefix_ senf::detail::ConvertibleString::ConvertibleString()
{}
-prefix_ satcom::lib::detail::ConvertibleString::ConvertibleString(bool v)
+prefix_ senf::detail::ConvertibleString::ConvertibleString(bool v)
: std::string(v ? "true" : "false")
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ct.p////////////////////////////////////////
template <class T>
-prefix_ satcom::lib::detail::ConvertibleString &
-satcom::lib::detail::ConvertibleString::operator+=(ConvertibleString const & other)
+prefix_ senf::detail::ConvertibleString &
+senf::detail::ConvertibleString::operator+=(ConvertibleString const & other)
{
if (!empty())
this->std::string::operator+=(", ");
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
template <class SocketPolicy>
template <class OtherPolicy>
-prefix_ satcom::lib::SocketHandle<SocketPolicy>::SocketHandle(SocketHandle<OtherPolicy> other,
+prefix_ senf::SocketHandle<SocketPolicy>::SocketHandle(SocketHandle<OtherPolicy> other,
typename IsCompatible<OtherPolicy>::type *)
: FileHandle(other)
{}
template <class SocketPolicy>
template <class OtherPolicy>
-prefix_ typename satcom::lib::SocketHandle<SocketPolicy>::template IsCompatible<OtherPolicy>::type const &
-satcom::lib::SocketHandle<SocketPolicy>::operator=(SocketHandle<OtherPolicy> other)
+prefix_ typename senf::SocketHandle<SocketPolicy>::template IsCompatible<OtherPolicy>::type const &
+senf::SocketHandle<SocketPolicy>::operator=(SocketHandle<OtherPolicy> other)
{
assign(other);
return *this;
template <class SocketPolicy>
prefix_
-satcom::lib::SocketHandle<SocketPolicy>::SocketHandle(std::auto_ptr<SocketProtocol> protocol,
+senf::SocketHandle<SocketPolicy>::SocketHandle(std::auto_ptr<SocketProtocol> protocol,
bool isServer)
: FileHandle(std::auto_ptr<FileBody>(new SocketBody(protocol,isServer)))
{}
template <class SocketPolicy>
-prefix_ satcom::lib::SocketHandle<SocketPolicy>::SocketHandle(FileHandle other, bool isChecked)
+prefix_ senf::SocketHandle<SocketPolicy>::SocketHandle(FileHandle other, bool isChecked)
: FileHandle(other)
{
BOOST_ASSERT( isChecked );
}
template <class SocketPolicy>
-prefix_ satcom::lib::SocketBody & satcom::lib::SocketHandle<SocketPolicy>::body()
+prefix_ senf::SocketBody & senf::SocketHandle<SocketPolicy>::body()
{
BOOST_ASSERT( dynamic_cast<SocketBody *>(&FileHandle::body()) );
return static_cast<SocketBody &>(FileHandle::body());
}
template <class SocketPolicy>
-prefix_ satcom::lib::SocketBody const & satcom::lib::SocketHandle<SocketPolicy>::body()
+prefix_ senf::SocketBody const & senf::SocketHandle<SocketPolicy>::body()
const
{
BOOST_ASSERT( dynamic_cast<SocketBody const *>(&FileHandle::body()) );
}
template <class SocketPolicy>
-prefix_ satcom::lib::SocketProtocol const & satcom::lib::SocketHandle<SocketPolicy>::protocol()
+prefix_ senf::SocketProtocol const & senf::SocketHandle<SocketPolicy>::protocol()
const
{
return body().protocol();
}
template <class SocketPolicy>
-prefix_ void satcom::lib::SocketHandle<SocketPolicy>::assign(FileHandle other)
+prefix_ void senf::SocketHandle<SocketPolicy>::assign(FileHandle other)
{
FileHandle::operator=(other);
}
template <class SocketPolicy>
-prefix_ satcom::lib::SocketHandle<SocketPolicy>
-satcom::lib::SocketHandle<SocketPolicy>::cast_static(FileHandle handle)
+prefix_ senf::SocketHandle<SocketPolicy>
+senf::SocketHandle<SocketPolicy>::cast_static(FileHandle handle)
{
return SocketHandle(handle,true);
}
template <class SocketPolicy>
-prefix_ satcom::lib::SocketHandle<SocketPolicy>
-satcom::lib::SocketHandle<SocketPolicy>::cast_dynamic(FileHandle handle)
+prefix_ senf::SocketHandle<SocketPolicy>
+senf::SocketHandle<SocketPolicy>::cast_dynamic(FileHandle handle)
{
// throws bad_cast if the body is not a SocketBody
SocketBody & body (dynamic_cast<SocketBody&>(FileHandle::body(handle)));
}
template <class Target, class Source>
-prefix_ Target satcom::lib::static_socket_cast(Source handle)
+prefix_ Target senf::static_socket_cast(Source handle)
{
BOOST_STATIC_ASSERT((
boost::is_convertible<Source*,FileHandle*>::value &&
}
template <class Target, class Source>
-prefix_ Target satcom::lib::dynamic_socket_cast(Source handle)
+prefix_ Target senf::dynamic_socket_cast(Source handle)
{
BOOST_STATIC_ASSERT((
boost::is_convertible<Source*,FileHandle*>::value &&
}
template <class Target, class Source>
-prefix_ bool satcom::lib::check_socket_cast(Source handle)
+prefix_ bool senf::check_socket_cast(Source handle)
{
BOOST_STATIC_ASSERT((
boost::is_convertible<Source*,FileHandle*>::value &&
}
template <class SocketPolicy>
-prefix_ void satcom::lib::SocketHandle<SocketPolicy>::state(SocketStateMap & map, unsigned lod)
+prefix_ void senf::SocketHandle<SocketPolicy>::state(SocketStateMap & map, unsigned lod)
{
map["handle"] = prettyName(typeid(*this));
body().state(map,lod);
}
template <class SocketPolicy>
-prefix_ std::string satcom::lib::SocketHandle<SocketPolicy>::dumpState(unsigned lod)
+prefix_ std::string senf::SocketHandle<SocketPolicy>::dumpState(unsigned lod)
{
SocketStateMap map;
state(map,lod);
}
///////////////////////////////////////////////////////////////////////////
-// satcom::lib::detail::ConvertibleString
+// senf::detail::ConvertibleString
template <class T>
-prefix_ satcom::lib::detail::ConvertibleString::ConvertibleString(T const & other)
+prefix_ senf::detail::ConvertibleString::ConvertibleString(T const & other)
: std::string(boost::lexical_cast<std::string>(other))
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////hh.p////////////////////////////////////////
#include "SocketHandle.ih"
-namespace satcom {
-namespace lib {
+namespace senf {
+
/** \brief
*/
template <class Target, class Source>
bool check_socket_cast(Source handle);
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "SocketHandle.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ih.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
class SocketProtocol;
bool isServer_;
};
-}}
+}
///////////////////////////////ih.e////////////////////////////////////////
#endif
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cc.p////////////////////////////////////////
namespace {
- namespace sl = satcom::lib;
+ namespace sl = senf;
class MySocketHandle
: public sl::SocketHandle<sl::test::SomeProtocol::Policy>
};
class FDHandle
- : public satcom::lib::FileHandle
+ : public senf::FileHandle
{
public:
FDHandle()
- : satcom::lib::FileHandle(std::auto_ptr<satcom::lib::FileBody>(
- new satcom::lib::FileBody())) {}
+ : senf::FileHandle(std::auto_ptr<senf::FileBody>(
+ new senf::FileBody())) {}
};
}
osh = myh;
typedef sl::SocketHandle<sl::test::SomeProtocol::Policy> SomeSocketHandle;
- SomeSocketHandle ssh = satcom::lib::static_socket_cast<SomeSocketHandle>(osh);
+ SomeSocketHandle ssh = senf::static_socket_cast<SomeSocketHandle>(osh);
- BOOST_CHECK_NO_THROW( satcom::lib::dynamic_socket_cast<SomeSocketHandle>(osh) );
+ BOOST_CHECK_NO_THROW( senf::dynamic_socket_cast<SomeSocketHandle>(osh) );
typedef sl::SocketHandle< sl::MakeSocketPolicy<
OtherSocketPolicy,
- satcom::lib::NoAddressingPolicy
+ senf::NoAddressingPolicy
>::policy> SomeOtherSocketHandle;
- BOOST_CHECK_THROW( satcom::lib::dynamic_socket_cast<SomeOtherSocketHandle>(osh),
+ BOOST_CHECK_THROW( senf::dynamic_socket_cast<SomeOtherSocketHandle>(osh),
std::bad_cast );
- BOOST_CHECK_THROW( satcom::lib::dynamic_socket_cast<SomeSocketHandle>(
- satcom::lib::FileHandle(FDHandle())),
+ BOOST_CHECK_THROW( senf::dynamic_socket_cast<SomeSocketHandle>(
+ senf::FileHandle(FDHandle())),
std::bad_cast );
BOOST_CHECK_EQUAL( myh.dumpState(),
- "handle: satcom::lib::SocketHandle<satcom::lib::SocketPolicy<satcom::lib::test::SomeAddressingPolicy, satcom::lib::test::SomeFramingPolicy, satcom::lib::test::SomeCommunicationPolicy, satcom::lib::test::SomeReadPolicy, satcom::lib::test::SomeWritePolicy, satcom::lib::test::SomeBufferingPolicy> >\n"
+ "handle: senf::SocketHandle<senf::SocketPolicy<senf::test::SomeAddressingPolicy, senf::test::SomeFramingPolicy, senf::test::SomeCommunicationPolicy, senf::test::SomeReadPolicy, senf::test::SomeWritePolicy, senf::test::SomeBufferingPolicy> >\n"
"file.handle: -1\n"
"file.refcount: 3\n"
- "socket.policy: satcom::lib::SocketPolicy<satcom::lib::test::SomeAddressingPolicy, satcom::lib::test::SomeFramingPolicy, satcom::lib::test::SomeCommunicationPolicy, satcom::lib::test::SomeReadPolicy, satcom::lib::test::SomeWritePolicy, satcom::lib::test::SomeBufferingPolicy>\n"
- "socket.protocol: satcom::lib::test::SomeProtocol\n"
+ "socket.policy: senf::SocketPolicy<senf::test::SomeAddressingPolicy, senf::test::SomeFramingPolicy, senf::test::SomeCommunicationPolicy, senf::test::SomeReadPolicy, senf::test::SomeWritePolicy, senf::test::SomeBufferingPolicy>\n"
+ "socket.protocol: senf::test::SomeProtocol\n"
"socket.server: false\n" );
}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define SP_TemplateParams(x1,x2,n,SomePolicy) BOOST_PP_COMMA_IF(n) BOOST_PP_CAT(SomePolicy,_)
template < BOOST_PP_SEQ_FOR_EACH_I( SP_TemplateArgs, , SATLIB_SOCKET_POLICIES ) >
-prefix_ void satcom::lib::SocketPolicy< BOOST_PP_SEQ_FOR_EACH_I( SP_TemplateParams, , SATLIB_SOCKET_POLICIES ) >::
+prefix_ void senf::SocketPolicy< BOOST_PP_SEQ_FOR_EACH_I( SP_TemplateParams, , SATLIB_SOCKET_POLICIES ) >::
checkBaseOf(SocketPolicyBase const & other)
{
# define SP_CheckPolicy(x1,x2,SomePolicy) (void) dynamic_cast<SomePolicy const &>(other.BOOST_PP_CAT(the,SomePolicy)());
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "SocketPolicy.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
// This may be adapted to change the supported policies (however,
// ClientSocketHandle and ServerSocketHandle will probably have to
// template SocketPolicy< ..policies.. >
// template MakeSocketPolicy< ..args.. >
// template SocketPolicyIsBaseOf< Base, Derived >
-}}
+}
//////////////////////////////hh.e////////////////////////////////////////
#include "SocketPolicy.ih"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////ih.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
# define SATLIB_SOCKET_POLICIES_N BOOST_PP_SEQ_SIZE( SATLIB_SOCKET_POLICIES )
} // namespace impl
- template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( SATLIB_SOCKET_POLICIES_N, class T, satcom::lib::impl::nil ) >
+ template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( SATLIB_SOCKET_POLICIES_N, class T, senf::impl::nil ) >
class MakeSocketPolicy
: public boost::mpl::if_< boost::is_convertible< T0*, SocketPolicyBase* >,
impl::MakeSocketPolicy_impl< T0, boost::mpl::vector< BOOST_PP_ENUM_SHIFTED_PARAMS( SATLIB_SOCKET_POLICIES_N, T ) > >,
# undef SP_DefineConditions
-}}
+}
///////////////////////////////ih.e////////////////////////////////////////
#endif
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace satcom::lib;
+using namespace senf;
namespace {
struct INetAddressingPolicy : public AddressingPolicyBase {};
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "SocketPolicy.test.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
namespace test {
- struct SomeAddressingPolicy : public satcom::lib::AddressingPolicyBase
+ struct SomeAddressingPolicy : public senf::AddressingPolicyBase
{
typedef unsigned Address;
{}
};
- struct SomeFramingPolicy : public satcom::lib::FramingPolicyBase
+ struct SomeFramingPolicy : public senf::FramingPolicyBase
{};
- struct SomeCommunicationPolicy : public satcom::lib::CommunicationPolicyBase
+ struct SomeCommunicationPolicy : public senf::CommunicationPolicyBase
{
static int accept(FileHandle handle, unsigned & addr)
{ addr = 3; return -1; }
};
- struct SomeReadPolicy : public satcom::lib::ReadPolicyBase
+ struct SomeReadPolicy : public senf::ReadPolicyBase
{
static unsigned const TEST_SIZE = 9;
}
};
- struct SomeWritePolicy : public satcom::lib::WritePolicyBase
+ struct SomeWritePolicy : public senf::WritePolicyBase
{
static unsigned write(FileHandle handle, char const * buffer, unsigned size)
{
}
};
- struct SomeBufferingPolicy : public satcom::lib::BufferingPolicyBase
+ struct SomeBufferingPolicy : public senf::BufferingPolicyBase
{
static unsigned rcvbuf(FileHandle handle)
{ return 0; }
{ return 0; }
};
- typedef satcom::lib::MakeSocketPolicy<
+ typedef senf::MakeSocketPolicy<
SomeAddressingPolicy,
SomeFramingPolicy,
SomeCommunicationPolicy,
SomeBufferingPolicy
>::policy SomeSocketPolicy;
-}}}
+}}
///////////////////////////////hh.e////////////////////////////////////////
//#include "SocketPolicy.test.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::lib::SocketProtocol::state(SocketStateMap & map, unsigned lod)
+prefix_ void senf::SocketProtocol::state(SocketStateMap & map, unsigned lod)
const
{}
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ satcom::lib::SocketProtocol::SocketProtocol()
+prefix_ senf::SocketProtocol::SocketProtocol()
: body_(0)
{}
-prefix_ satcom::lib::SocketProtocol::~SocketProtocol()
+prefix_ senf::SocketProtocol::~SocketProtocol()
{}
-prefix_ satcom::lib::SocketBody & satcom::lib::SocketProtocol::body()
+prefix_ senf::SocketBody & senf::SocketProtocol::body()
const
{
BOOST_ASSERT( body_ );
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////cti.p///////////////////////////////////////
template <class SocketPolicy>
-prefix_ satcom::lib::ConcreteSocketProtocol<SocketPolicy>::~ConcreteSocketProtocol()
+prefix_ senf::ConcreteSocketProtocol<SocketPolicy>::~ConcreteSocketProtocol()
{}
template <class SocketPolicy>
-prefix_ typename satcom::lib::ConcreteSocketProtocol<SocketPolicy>::Policy const &
-satcom::lib::ConcreteSocketProtocol<SocketPolicy>::policy()
+prefix_ typename senf::ConcreteSocketProtocol<SocketPolicy>::Policy const &
+senf::ConcreteSocketProtocol<SocketPolicy>::policy()
const
{
return policy_;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "SocketProtocol.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
class SocketPolicyBase;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "SocketProtocol.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
BOOST_AUTO_UNIT_TEST(socketProtocol)
{
- satcom::lib::test::SomeProtocol protocol;
+ senf::test::SomeProtocol protocol;
// This would fail an assertion ...
// BOOST_CHECK( protocol.body() == 0 );
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "SocketProtocol.test.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
namespace test {
class SomeProtocol
{ return false; }
};
-}}}
+}}
///////////////////////////////hh.e////////////////////////////////////////
//#include "SocketProtocol.test.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ bool satcom::lib::TCPProtocol::nodelay()
+prefix_ bool senf::TCPProtocol::nodelay()
const
{
int value;
return value;
}
-prefix_ void satcom::lib::TCPProtocol::nodelay(bool value)
+prefix_ void senf::TCPProtocol::nodelay(bool value)
const
{
int ivalue (value);
throw SystemException(errno);
}
-prefix_ unsigned satcom::lib::TCPProtocol::siocinq()
+prefix_ unsigned senf::TCPProtocol::siocinq()
const
{
int n;
return n;
}
-prefix_ unsigned satcom::lib::TCPProtocol::siocoutq()
+prefix_ unsigned senf::TCPProtocol::siocoutq()
const
{
int n;
return n;
}
-prefix_ unsigned satcom::lib::TCPProtocol::available()
+prefix_ unsigned senf::TCPProtocol::available()
const
{
return siocinq();
}
-prefix_ bool satcom::lib::TCPProtocol::eof()
+prefix_ bool senf::TCPProtocol::eof()
const
{
return body().readable() && available()==0;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "TCPProtocol.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
class TCPProtocol
: public virtual SocketProtocol
bool eof() const;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "TCPProtocol.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::lib::TCPv4SocketProtocol::init_client()
+prefix_ void senf::TCPv4SocketProtocol::init_client()
const
{
int sock = ::socket(PF_INET,SOCK_STREAM,0);
}
prefix_ void
-satcom::lib::TCPv4SocketProtocol::init_client(INet4Address const & address)
+senf::TCPv4SocketProtocol::init_client(INet4Address const & address)
const
{
init_client();
connect(address);
}
-prefix_ void satcom::lib::TCPv4SocketProtocol::init_server()
+prefix_ void senf::TCPv4SocketProtocol::init_server()
const
{
int sock = ::socket(PF_INET,SOCK_STREAM,0);
body().fd(sock);
}
-prefix_ void satcom::lib::TCPv4SocketProtocol::init_server(INet4Address const & address,
+prefix_ void senf::TCPv4SocketProtocol::init_server(INet4Address const & address,
unsigned backlog)
const
{
throw SystemException(errno);
}
-prefix_ std::auto_ptr<satcom::lib::SocketProtocol> satcom::lib::TCPv4SocketProtocol::clone()
+prefix_ std::auto_ptr<senf::SocketProtocol> senf::TCPv4SocketProtocol::clone()
const
{
return std::auto_ptr<SocketProtocol>(new TCPv4SocketProtocol());
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "TCPSocketHandle.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
typedef MakeSocketPolicy<
INet4AddressingPolicy,
typedef ProtocolClientSocketHandle<TCPv6SocketProtocol> TCPv6ClientSocketHandle;
typedef ProtocolServerSocketHandle<TCPv6SocketProtocol> TCPv6ServerSocketHandle;
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "TCPSocketHandle.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
BOOST_AUTO_UNIT_TEST(tcpv4ClientSocketHandle)
{
{
- satcom::lib::TCPv4ClientSocketHandle sock;
+ senf::TCPv4ClientSocketHandle sock;
- BOOST_CHECK_THROW( sock.connect(satcom::lib::INet4Address("127.0.0.1:12345")), satcom::lib::SystemException );
- BOOST_CHECK_THROW( sock.protocol().connect("127.0.0.1:12345"), satcom::lib::SystemException );
+ BOOST_CHECK_THROW( sock.connect(senf::INet4Address("127.0.0.1:12345")), senf::SystemException );
+ BOOST_CHECK_THROW( sock.protocol().connect("127.0.0.1:12345"), senf::SystemException );
}
{
start(server);
- satcom::lib::TCPv4ClientSocketHandle sock;
+ senf::TCPv4ClientSocketHandle sock;
BOOST_CHECK_NO_THROW( sock.bind("127.0.0.1:23456") );
BOOST_CHECK_NO_THROW( sock.connect("127.0.0.1:12345") );
BOOST_CHECK( sock.peer() == "127.0.0.1:12345" );
}
{
- satcom::lib::TCPv4ClientSocketHandle sock;
+ senf::TCPv4ClientSocketHandle sock;
// Since this is a TCP socket, most of the calls will fail or
// are at least not sensible ...
// I'll have to move those to a UDPSocket test ... they should
// realy only be in the UDP Protocol implementation
BOOST_CHECK_NO_THROW( sock.protocol().mcTTL() );
- BOOST_CHECK_THROW( sock.protocol().mcTTL(1), satcom::lib::SystemException );
+ BOOST_CHECK_THROW( sock.protocol().mcTTL(1), senf::SystemException );
BOOST_CHECK_NO_THROW( sock.protocol().mcLoop() );
BOOST_CHECK_NO_THROW( sock.protocol().mcLoop(false) );
BOOST_CHECK_NO_THROW( sock.protocol().mcAddMembership("224.0.0.1:0") );
BOOST_CHECK_NO_THROW( sock.protocol().mcAddMembership("224.0.0.1:0","127.0.0.1:0") );
BOOST_CHECK_NO_THROW( sock.protocol().mcDropMembership("224.0.0.1:0","127.0.0.1:0") );
BOOST_CHECK_NO_THROW( sock.protocol().mcDropMembership("224.0.0.1:0") );
- BOOST_CHECK_THROW( sock.protocol().mcIface("lo"), satcom::lib::SystemException );
+ BOOST_CHECK_THROW( sock.protocol().mcIface("lo"), senf::SystemException );
// The following setsockopts are hard to REALLY test ...
BOOST_CHECK_NO_THROW( sock.protocol().nodelay(true) );
{
{
BOOST_CHECKPOINT("Opening server socket");
- satcom::lib::TCPv4ServerSocketHandle server ("127.0.0.1:12346");
+ senf::TCPv4ServerSocketHandle server ("127.0.0.1:12346");
BOOST_CHECKPOINT("Starting client");
start(client);
BOOST_CHECKPOINT("Accepting connection");
- satcom::lib::TCPv4ClientSocketHandle client = server.accept();
+ senf::TCPv4ClientSocketHandle client = server.accept();
BOOST_CHECK_NO_THROW(client.write("QUIT"));
BOOST_CHECKPOINT("Stopping client");
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::lib::daemonize()
+prefix_ void senf::daemonize()
{
int pid = fork();
if (pid < 0)
- throw satcom::lib::SystemException("fork",errno);
+ throw senf::SystemException("fork",errno);
if (pid > 0)
::_exit(0);
if (::setsid() < 0)
- throw satcom::lib::SystemException("setsid",errno);
+ throw senf::SystemException("setsid",errno);
}
-prefix_ void satcom::lib::redirect_stdio(std::string const & path)
+prefix_ void senf::redirect_stdio(std::string const & path)
{
int fd = ::open(path.c_str(),O_RDWR);
- if (fd < 0) throw satcom::lib::SystemException("open",errno);
- if (dup2(fd,0) < 0) throw satcom::lib::SystemException("dup2",errno);
- if (dup2(fd,1) < 0) throw satcom::lib::SystemException("dup2",errno);
- if (dup2(fd,2) < 0) throw satcom::lib::SystemException("dup2",errno);
- if (::close(fd) < 0) throw satcom::lib::SystemException("close",errno);
+ if (fd < 0) throw senf::SystemException("open",errno);
+ if (dup2(fd,0) < 0) throw senf::SystemException("dup2",errno);
+ if (dup2(fd,1) < 0) throw senf::SystemException("dup2",errno);
+ if (dup2(fd,2) < 0) throw senf::SystemException("dup2",errno);
+ if (::close(fd) < 0) throw senf::SystemException("close",errno);
}
///////////////////////////////cc.e////////////////////////////////////////
//#include "DaemonTools.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
void daemonize();
void redirect_stdio(std::string const & path = "/dev/null");
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "DaemonTools.cci"
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void satcom::lib::SystemException::init()
+prefix_ void senf::SystemException::init()
{
std::stringstream s;
if (where)
buffer_ = s.str();
}
-prefix_ char const * satcom::lib::SystemException::what()
+prefix_ char const * senf::SystemException::what()
const throw()
{
return buffer_.c_str();
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "Exception.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
struct SystemException : public std::exception
{
std::string buffer_;
};
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "Exception.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ satcom::lib::MicroTime satcom::lib::now()
+prefix_ senf::MicroTime senf::now()
{
struct timeval tv;
if (gettimeofday(&tv,0) < 0)
//#include "MicroTime.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
typedef boost::uint64_t MicroTime;
MicroTime now();
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "MicroTime.cci"
BOOST_AUTO_UNIT_TEST(microTime)
{
- BOOST_CHECK_NO_THROW( satcom::lib::now() );
+ BOOST_CHECK_NO_THROW( senf::now() );
}
///////////////////////////////cc.e////////////////////////////////////////
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ void satcom::lib::SafeBoolBase::this_type_does_not_support_comparisons()
+prefix_ void senf::SafeBoolBase::this_type_does_not_support_comparisons()
const
{}
-prefix_ satcom::lib::SafeBoolBase::SafeBoolBase()
+prefix_ senf::SafeBoolBase::SafeBoolBase()
{}
-prefix_ satcom::lib::SafeBoolBase::SafeBoolBase(const SafeBoolBase&)
+prefix_ senf::SafeBoolBase::SafeBoolBase(const SafeBoolBase&)
{}
-prefix_ satcom::lib::SafeBoolBase& satcom::lib::SafeBoolBase::operator=(const SafeBoolBase&)
+prefix_ senf::SafeBoolBase& senf::SafeBoolBase::operator=(const SafeBoolBase&)
{
return *this;
}
-prefix_ satcom::lib::SafeBoolBase::~SafeBoolBase()
+prefix_ senf::SafeBoolBase::~SafeBoolBase()
{}
///////////////////////////////cci.e///////////////////////////////////////
///////////////////////////////cti.p///////////////////////////////////////
template <typename T>
-prefix_ satcom::lib::SafeBool<T>::operator bool_type()
+prefix_ senf::SafeBool<T>::operator bool_type()
const
{
return (static_cast<const T*>(this))->boolean_test()
}
template <typename T>
-prefix_ bool satcom::lib::SafeBool<T>::operator!()
+prefix_ bool senf::SafeBool<T>::operator!()
const
{
return ! (static_cast<const T*>(this))->boolean_test();
}
template <typename T>
-prefix_ satcom::lib::SafeBool<T>::~SafeBool()
+prefix_ senf::SafeBool<T>::~SafeBool()
{}
template <typename T, typename U>
-prefix_ void satcom::lib::operator==(const SafeBool<T>& lhs, const SafeBool<U>& rhs)
+prefix_ void senf::operator==(const SafeBool<T>& lhs, const SafeBool<U>& rhs)
{
lhs.this_type_does_not_support_comparisons();
}
template <typename T, typename U>
-prefix_ void satcom::lib::operator!=(const SafeBool<T>& lhs, const SafeBool<U>& rhs)
+prefix_ void senf::operator!=(const SafeBool<T>& lhs, const SafeBool<U>& rhs)
{
lhs.this_type_does_not_support_comparisons();
}
//#include "SafeBool.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
// This is a direct copy of a safe bool solution by Bjorn Karlsson
// from http://www.artima.com/cppsource/safebool.html
template <typename T,typename U>
void operator!=(const SafeBool<T>& lhs,const SafeBool<U>& rhs);
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "SafeBool.cci"
// interface isn't even explicitly exportet from libiberty. However, it is
// *EXTREMELY* helpful for debugging ...
-prefix_ std::string satcom::lib::prettyName(std::type_info const & type)
+prefix_ std::string senf::prettyName(std::type_info const & type)
{
char const * mangled = type.name();
char * demangled = ::cplus_demangle(mangled,DMGL_TYPES|DMGL_AUTO);
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "TypeInfo.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
std::string prettyName(std::type_info const & type);
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "TypeInfo.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
TestType ob;
test::Base const & baseOb(ob);
- BOOST_CHECK_EQUAL( satcom::lib::prettyName(typeid(int)), "int");
- BOOST_CHECK_EQUAL( satcom::lib::prettyName(typeid(baseOb)), "test::Foo<test::Foo<test::Blub, 1>, 10>" );
+ BOOST_CHECK_EQUAL( senf::prettyName(typeid(int)), "int");
+ BOOST_CHECK_EQUAL( senf::prettyName(typeid(baseOb)), "test::Foo<test::Foo<test::Blub, 1>, 10>" );
}
///////////////////////////////cc.e////////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
-// NEVER INCLUDE DIRECTLY !! INCLUDE satcom/membind.hh
+// NEVER INCLUDE DIRECTLY !! INCLUDE senf/membind.hh
#if !BOOST_PP_IS_ITERATING
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ satcom::lib::intrusive_refcount::refcount_t satcom::lib::intrusive_refcount::refcount()
+prefix_ senf::intrusive_refcount::refcount_t senf::intrusive_refcount::refcount()
{
return refcount_;
}
-prefix_ bool satcom::lib::intrusive_refcount::is_shared()
+prefix_ bool senf::intrusive_refcount::is_shared()
{
return refcount()>1;
}
-prefix_ satcom::lib::intrusive_refcount::intrusive_refcount()
+prefix_ senf::intrusive_refcount::intrusive_refcount()
: refcount_(0)
{}
-prefix_ satcom::lib::intrusive_refcount::~intrusive_refcount()
+prefix_ senf::intrusive_refcount::~intrusive_refcount()
{}
-prefix_ void satcom::lib::intrusive_refcount::add_ref()
+prefix_ void senf::intrusive_refcount::add_ref()
{
++refcount_;
}
-prefix_ bool satcom::lib::intrusive_refcount::release()
+prefix_ bool senf::intrusive_refcount::release()
{
BOOST_ASSERT(refcount_>0);
return --refcount_ == 0;
}
-prefix_ void satcom::lib::intrusive_ptr_add_ref(intrusive_refcount* p)
+prefix_ void senf::intrusive_ptr_add_ref(intrusive_refcount* p)
{
p->add_ref();
}
-prefix_ void satcom::lib::intrusive_ptr_release(intrusive_refcount* p)
+prefix_ void senf::intrusive_ptr_release(intrusive_refcount* p)
{
if (p->release())
delete p;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
//#include "intrusive_refcount.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
/** \brief
*/
refcount_t refcount_;
- friend void satcom::lib::intrusive_ptr_add_ref(intrusive_refcount* p);
- friend void satcom::lib::intrusive_ptr_release(intrusive_refcount* p);
+ friend void senf::intrusive_ptr_add_ref(intrusive_refcount* p);
+ friend void senf::intrusive_ptr_release(intrusive_refcount* p);
};
void intrusive_ptr_add_ref(intrusive_refcount* p);
void intrusive_ptr_release(intrusive_refcount* p);
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
#include "intrusive_refcount.cci"
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
namespace {
struct Tester
- : public satcom::lib::intrusive_refcount
+ : public senf::intrusive_refcount
{
typedef boost::intrusive_ptr<Tester> ptr;
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
///////////////////////////////hh.p////////////////////////////////////////
-namespace satcom {
-namespace lib {
+namespace senf {
+
#define scOBTYPE T *
#include "Utils/impl/membind.hh"
#include "Utils/impl/membind.hh"
#undef scOBTYPE
-}}
+}
///////////////////////////////hh.e////////////////////////////////////////
//#include "membind.cci"
BOOST_AUTO_UNIT_TEST(membind)
{
Test instance;
- boost::function<char const * ()> f1 (satcom::lib::membind(&Test::meth1,instance));
- boost::function<std::string (int,int)> f2 (satcom::lib::membind(&Test::meth2,instance));
+ boost::function<char const * ()> f1 (senf::membind(&Test::meth1,instance));
+ boost::function<std::string (int,int)> f2 (senf::membind(&Test::meth2,instance));
BOOST_CHECK_EQUAL( f1(), "meth1()" );
BOOST_CHECK_EQUAL( f2(1,2), "meth2(1,2)" );
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End:
RECURSIVE = NO
EXCLUDE = doc
EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS = *.test.cc *~ .*
+EXCLUDE_PATTERNS = *.test.cc .*
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
<li class="libPackets"><a href="../../Packets/doc/html/index.html">libPackets</a></li>
<li class="libScheduler"><a href="../../Scheduler/doc/html/index.html">libScheduler</a></li>
<li class="libUtils"><a href="../../Utils/doc/html/index.html">libUtils</a></li>
- <li class="SENFSCons"><a href="../../satscons/doc/html/index.html">SENFSCons</a></li>
+ <li class="SENFSCons"><a href="../../senfscons/doc/html/index.html">SENFSCons</a></li>
</ul>
</div>
<li class="libPackets"><a href="../../../Packets/doc/html/index.html">libPackets</a></li>
<li class="libScheduler"><a href="../../../Scheduler/doc/html/index.html">libScheduler</a></li>
<li class="libUtils"><a href="../../../Utils/doc/html/index.html">libUtils</a></li>
- <li class="SENFSCons"><a href="../../../satscons/doc/html/index.html">SENFSCons</a></li>
+ <li class="SENFSCons"><a href="../../../senfscons/doc/html/index.html">SENFSCons</a></li>
</ul>
</div>
import sys, glob
-sys.path.append('satscons')
+sys.path.append('senfscons')
import SatSCons
###########################################################################