From: g0dil Date: Wed, 20 Dec 2006 10:30:06 +0000 (+0000) Subject: Renamed namespaces satcom::lib and satcom::pkf to senf X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=ac6a813d9d99f7add4e13aff7a4bcd314d5604a6;p=senf.git Renamed namespaces satcom::lib and satcom::pkf to senf Renaned directory satscons to senfscons git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@167 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Mainpage.dox b/Mainpage.dox index 74b5475..51f2515 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -167,7 +167,7 @@ \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 @@ -185,7 +185,7 @@ environment. Included are a number of templates to help bootstrapping a new project or component. - \see SENFSCons + \see SENFSCons reference */ @@ -225,7 +225,7 @@ 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. @@ -234,7 +234,7 @@ module, the file will look like
-        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
@@ -250,7 +250,7 @@ \section new_conf Configuring SENFSCons To set up the build environment, copy the - satscons/SConstruct.template to Satscons in the + senfscons/SConstruct.template to Satscons 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 @@ -258,7 +258,7 @@ 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 - satscons/SConfig.template to SConfig in the + senfscons/SConfig.template to SConfig 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 @@ -290,7 +290,7 @@
       $ scons -u [target]
- \see SENFSCons reference \n + \see SENFSCons reference \n SCons documentation \n Subversion online book \n Subversion Homepage diff --git a/Packets/DataPacket.cc b/Packets/DataPacket.cc index 91e80cf..f526f95 100644 --- a/Packets/DataPacket.cc +++ b/Packets/DataPacket.cc @@ -30,14 +30,14 @@ #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" @@ -50,5 +50,5 @@ prefix_ void satcom::pkf::DataPacket::v_dump(std::ostream & os) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/DataPacket.cti b/Packets/DataPacket.cti index f16bbb3..62b76f0 100644 --- a/Packets/DataPacket.cti +++ b/Packets/DataPacket.cti @@ -30,7 +30,7 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::pkf::DataPacket::DataPacket(Arg const & arg) +prefix_ senf::DataPacket::DataPacket(Arg const & arg) : Packet(arg) {} @@ -40,5 +40,5 @@ prefix_ satcom::pkf::DataPacket::DataPacket(Arg const & arg) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/DataPacket.hh b/Packets/DataPacket.hh index 480f3cd..4e1e618 100644 --- a/Packets/DataPacket.hh +++ b/Packets/DataPacket.hh @@ -28,8 +28,8 @@ ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + /** \brief Non-interpreted Packet @@ -64,7 +64,7 @@ namespace pkf { }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "DataPacket.cci" @@ -75,5 +75,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/EthernetPacket.cc b/Packets/EthernetPacket.cc index f0e468e..60c122e 100644 --- a/Packets/EthernetPacket.cc +++ b/Packets/EthernetPacket.cc @@ -33,12 +33,11 @@ ///////////////////////////////cc.p//////////////////////////////////////// namespace { - namespace pkf = satcom::pkf; - pkf::PacketRegistry::RegistrationProxy + senf::PacketRegistry::RegistrationProxy 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 @@ -48,7 +47,7 @@ prefix_ void satcom::pkf::EthernetPacket::v_nextInterpreter() 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) @@ -60,7 +59,7 @@ namespace { } -prefix_ void satcom::pkf::EthernetPacket::v_dump(std::ostream & os) +prefix_ void senf::EthernetPacket::v_dump(std::ostream & os) const { if (type() <= 1500) @@ -80,10 +79,10 @@ prefix_ void satcom::pkf::EthernetPacket::v_dump(std::ostream & os) << 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 @@ -91,10 +90,10 @@ prefix_ void satcom::pkf::EthVLanPacket::v_nextInterpreter() 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" @@ -110,5 +109,5 @@ prefix_ void satcom::pkf::EthVLanPacket::v_dump(std::ostream & os) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/EthernetPacket.cti b/Packets/EthernetPacket.cti index 132e2de..43bcfaa 100644 --- a/Packets/EthernetPacket.cti +++ b/Packets/EthernetPacket.cti @@ -30,12 +30,12 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::pkf::EthernetPacket::EthernetPacket(Arg const & arg) +prefix_ senf::EthernetPacket::EthernetPacket(Arg const & arg) : Packet(arg) {} template -prefix_ satcom::pkf::EthVLanPacket::EthVLanPacket(Arg const & arg) +prefix_ senf::EthVLanPacket::EthVLanPacket(Arg const & arg) : Packet(arg) {} @@ -45,5 +45,5 @@ prefix_ satcom::pkf::EthVLanPacket::EthVLanPacket(Arg const & arg) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/EthernetPacket.hh b/Packets/EthernetPacket.hh index ae4fdb2..53d1dca 100644 --- a/Packets/EthernetPacket.hh +++ b/Packets/EthernetPacket.hh @@ -32,8 +32,8 @@ //#include "EthernetPacket.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + template struct Parse_Ethernet : public ParserBase @@ -136,7 +136,7 @@ namespace pkf { friend class Packet; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// @@ -148,5 +148,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/EthernetPacket.test.cc b/Packets/EthernetPacket.test.cc index 72e16d5..ad8e1e2 100644 --- a/Packets/EthernetPacket.test.cc +++ b/Packets/EthernetPacket.test.cc @@ -34,7 +34,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::pkf; +using namespace senf; BOOST_AUTO_UNIT_TEST(ethernetPacket_parser) { @@ -91,5 +91,5 @@ BOOST_AUTO_UNIT_TEST(ethernetPacket_chain) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/FUTURE b/Packets/FUTURE index 36f879a..65d4484 100644 --- a/Packets/FUTURE +++ b/Packets/FUTURE @@ -14,15 +14,15 @@ next free typeid integer. This can then efficiently be returned by the static retrieval function: template - 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; @@ -36,7 +36,7 @@ static retrieval function: 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::id(). +senf::vtable::impl::TypeRegistry::id(). The above is bogus ... we don't register the extensible types, we register the extensions which are arbitrary types. diff --git a/Packets/GenericPacket.ct b/Packets/GenericPacket.ct index 842fa56..0a9768c 100644 --- a/Packets/GenericPacket.ct +++ b/Packets/GenericPacket.ct @@ -30,18 +30,18 @@ ///////////////////////////////ct.p//////////////////////////////////////// template -prefix_ void satcom::pkf::GenericPacket::v_nextInterpreter() +prefix_ void senf::GenericPacket::v_nextInterpreter() const { this->registerInterpreter(this->end_header(), this->begin_trailer()); } template -prefix_ void satcom::pkf::GenericPacket::v_finalize() +prefix_ void senf::GenericPacket::v_finalize() {} template -prefix_ void satcom::pkf::GenericPacket::v_dump(std::ostream & os) +prefix_ void senf::GenericPacket::v_dump(std::ostream & os) const { // TODO: implement v_dump() @@ -53,5 +53,5 @@ prefix_ void satcom::pkf::GenericPacket::v_dump(std::ostream & o // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/GenericPacket.cti b/Packets/GenericPacket.cti index 92c9e59..618d0d2 100644 --- a/Packets/GenericPacket.cti +++ b/Packets/GenericPacket.cti @@ -31,59 +31,59 @@ template template -prefix_ satcom::pkf::GenericPacket::GenericPacket(Arg const & arg) +prefix_ senf::GenericPacket::GenericPacket(Arg const & arg) : Packet(arg) {} template -prefix_ void satcom::pkf::GenericPacket::init() +prefix_ void senf::GenericPacket::init() { insert(begin(),HEADER,0); insert(end(),TRAILER,0); } template -prefix_ typename satcom::pkf::GenericPacket::iterator -satcom::pkf::GenericPacket::begin_header() +prefix_ typename senf::GenericPacket::iterator +senf::GenericPacket::begin_header() const { return this->begin(); } template -prefix_ typename satcom::pkf::GenericPacket::iterator -satcom::pkf::GenericPacket::end_header() +prefix_ typename senf::GenericPacket::iterator +senf::GenericPacket::end_header() const { return this->begin() + HEADER; } template -prefix_ typename satcom::pkf::GenericPacket::size_type -satcom::pkf::GenericPacket::header_len() +prefix_ typename senf::GenericPacket::size_type +senf::GenericPacket::header_len() { return HEADER; } template -prefix_ typename satcom::pkf::GenericPacket::iterator -satcom::pkf::GenericPacket::begin_trailer() +prefix_ typename senf::GenericPacket::iterator +senf::GenericPacket::begin_trailer() const { return this->end() - TRAILER; } template -prefix_ typename satcom::pkf::GenericPacket::iterator -satcom::pkf::GenericPacket::end_trailer() +prefix_ typename senf::GenericPacket::iterator +senf::GenericPacket::end_trailer() const { return this->end(); } template -prefix_ typename satcom::pkf::GenericPacket::size_type -satcom::pkf::GenericPacket::trailer_len() +prefix_ typename senf::GenericPacket::size_type +senf::GenericPacket::trailer_len() { return TRAILER; } @@ -94,5 +94,5 @@ satcom::pkf::GenericPacket::trailer_len() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/GenericPacket.hh b/Packets/GenericPacket.hh index c8cd5d8..9af56fe 100644 --- a/Packets/GenericPacket.hh +++ b/Packets/GenericPacket.hh @@ -28,8 +28,8 @@ ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + /** \brief General packet comprised of header, trailer and payload @@ -76,7 +76,7 @@ namespace pkf { friend class Packet; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "GenericPacket.cci" @@ -87,5 +87,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/IpV4Packet.cc b/Packets/IpV4Packet.cc index 095a2f9..fd04025 100644 --- a/Packets/IpV4Packet.cc +++ b/Packets/IpV4Packet.cc @@ -35,21 +35,20 @@ ///////////////////////////////cc.p//////////////////////////////////////// namespace { - namespace pkf = satcom::pkf; - pkf::PacketRegistry::RegistrationProxy + senf::PacketRegistry::RegistrationProxy 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; @@ -79,5 +78,5 @@ prefix_ void satcom::pkf::IpV4Packet::v_dump(std::ostream & os) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/IpV4Packet.cti b/Packets/IpV4Packet.cti index 9a8c96f..423be2f 100644 --- a/Packets/IpV4Packet.cti +++ b/Packets/IpV4Packet.cti @@ -30,7 +30,7 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::pkf::IpV4Packet::IpV4Packet(Arg const & arg) +prefix_ senf::IpV4Packet::IpV4Packet(Arg const & arg) : Packet(arg) {} @@ -42,5 +42,5 @@ prefix_ satcom::pkf::IpV4Packet::IpV4Packet(Arg const & arg) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/IpV4Packet.hh b/Packets/IpV4Packet.hh index 0f9e296..0d12628 100644 --- a/Packets/IpV4Packet.hh +++ b/Packets/IpV4Packet.hh @@ -32,8 +32,8 @@ //#include "IpV4Packet.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + template struct Parse_IpV4 : public ParserBase @@ -103,7 +103,7 @@ namespace pkf { friend class Packet; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// @@ -115,5 +115,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/IpV4Packet.test.cc b/Packets/IpV4Packet.test.cc index fd93c5a..afc47a2 100644 --- a/Packets/IpV4Packet.test.cc +++ b/Packets/IpV4Packet.test.cc @@ -34,7 +34,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::pkf; +using namespace senf; BOOST_AUTO_UNIT_TEST(ipV4Packet_parser) { @@ -106,5 +106,5 @@ BOOST_AUTO_UNIT_TEST(ipV4Packet_packet) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/Mainpage.dox b/Packets/Mainpage.dox new file mode 100644 index 0000000..2b25b40 --- /dev/null +++ b/Packets/Mainpage.dox @@ -0,0 +1,83 @@ +/** \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. + */ + + +// Local Variables: +// mode: c++ +// mode: flyspell +// mode: auto-fill +// ispell-local-dictionary: "american" +// End: diff --git a/Packets/Packet.cc b/Packets/Packet.cc index c94f036..ef5752f 100644 --- a/Packets/Packet.cc +++ b/Packets/Packet.cc @@ -63,7 +63,7 @@ // 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)) @@ -72,8 +72,8 @@ prefix_ void satcom::pkf::impl::ListPacketDeleter::operator()(Packet * 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 ); @@ -87,8 +87,8 @@ satcom::pkf::impl::PacketImpl::appendInterpreter(Packet * p) 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 ); @@ -96,7 +96,7 @@ satcom::pkf::impl::PacketImpl::prependInterpreter(Packet * p) SATCOM_PKF_REFC_MSG("] PacketImpl::prependInterpreter (" << this << "): refcount_ = " << refcount_ << "\n"); p->impl_ = this; this->interpreters_.push_front( - boost::shared_ptr(p, pkf::impl::ListPacketDeleter())); + boost::shared_ptr(p, impl::ListPacketDeleter())); p->self_ = this->interpreters_.begin(); return p->self_; @@ -104,7 +104,7 @@ satcom::pkf::impl::PacketImpl::prependInterpreter(Packet * p) // 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 @@ -125,9 +125,9 @@ prefix_ bool satcom::pkf::impl::PacketImpl::releaseInterpreter(Packet * p) } 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; @@ -135,7 +135,7 @@ namespace { } 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) @@ -159,14 +159,14 @@ satcom::pkf::impl::PacketImpl::updateIterators(Packet::size_type index, } } -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()) @@ -180,7 +180,7 @@ prefix_ void satcom::pkf::impl::PacketImpl::packet_release(Packet * p) /////////////////////////////////////////////////////////////////////////// // 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_); @@ -201,7 +201,7 @@ prefix_ satcom::pkf::Packet::ptr satcom::pkf::Packet::next() 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(); @@ -215,7 +215,7 @@ prefix_ satcom::pkf::Packet::ptr satcom::pkf::Packet::last() 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_ ); @@ -224,7 +224,7 @@ prefix_ void satcom::pkf::Packet::i_registerInterpreter(Packet * p) 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, @@ -234,14 +234,14 @@ prefix_ void satcom::pkf::Packet::i_replaceInterpreter(Packet * p) 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_); @@ -249,7 +249,7 @@ prefix_ void satcom::pkf::Packet::insert(iterator pos, byte v, Whence whence) 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_ ); @@ -257,7 +257,7 @@ prefix_ void satcom::pkf::Packet::insert(iterator pos, size_type n, byte v, When 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_ ); @@ -265,7 +265,7 @@ prefix_ void satcom::pkf::Packet::erase(iterator pos) 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); @@ -276,7 +276,7 @@ prefix_ void satcom::pkf::Packet::erase(iterator first, iterator last) 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); @@ -291,5 +291,5 @@ prefix_ void satcom::pkf::Packet::dump(std::ostream & os) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/Packet.cci b/Packets/Packet.cci index c3262ea..5a299df 100644 --- a/Packets/Packet.cci +++ b/Packets/Packet.cci @@ -29,19 +29,19 @@ #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"); @@ -49,13 +49,13 @@ prefix_ satcom::pkf::impl::PacketImpl::~PacketImpl() // 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_; @@ -63,25 +63,25 @@ prefix_ bool satcom::pkf::impl::PacketImpl::release() 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; @@ -90,22 +90,22 @@ prefix_ std::ostream & satcom::pkf::operator<<(std::ostream & os, Packet const & // 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; @@ -114,25 +114,25 @@ prefix_ void satcom::pkf::impl::intrusive_ptr_release(PacketImpl * 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()) @@ -143,7 +143,7 @@ prefix_ satcom::pkf::Packet::ptr satcom::pkf::Packet::prev() 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 @@ -152,7 +152,7 @@ prefix_ satcom::pkf::Packet::ptr satcom::pkf::Packet::head() 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 @@ -162,14 +162,14 @@ prefix_ satcom::pkf::Packet::~Packet() 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_; @@ -177,7 +177,7 @@ prefix_ bool satcom::pkf::Packet::release() 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; @@ -191,5 +191,5 @@ prefix_ bool satcom::pkf::Packet::unlink() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/Packet.ct b/Packets/Packet.ct index edc6518..ecb2fde 100644 --- a/Packets/Packet.ct +++ b/Packets/Packet.ct @@ -32,8 +32,8 @@ ///////////////////////////////ct.p//////////////////////////////////////// template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr -satcom::pkf::Packet::create(InputIterator b, InputIterator e) +prefix_ typename senf::Packet::ptr_t::ptr +senf::Packet::create(InputIterator b, InputIterator e) { boost::intrusive_ptr impl (new impl::PacketImpl(b,e),false); if (!check(impl->data_.begin(),impl->data_.end())) @@ -43,7 +43,7 @@ satcom::pkf::Packet::create(InputIterator b, InputIterator e) } template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packet::create() +prefix_ typename senf::Packet::ptr_t::ptr senf::Packet::create() { boost::intrusive_ptr impl ( new impl::PacketImpl(min_bytes(),0)); @@ -53,8 +53,8 @@ prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packe } template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr -satcom::pkf::Packet::create(Packet::ptr payload) +prefix_ typename senf::Packet::ptr_t::ptr +senf::Packet::create(Packet::ptr payload) { // TODO: should I instead of using head() throw away all // interpreters before payload? ... probably yes ... @@ -65,7 +65,7 @@ satcom::pkf::Packet::create(Packet::ptr payload) } template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packet::reinterpret() +prefix_ typename senf::Packet::ptr_t::ptr senf::Packet::reinterpret() { // THIS INVALIDATES this !!!!!!! if (!check(begin(),end())) @@ -75,8 +75,8 @@ prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packe } template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr -satcom::pkf::Packet::registerInterpreter(raw_container::iterator begin, +prefix_ typename senf::Packet::ptr_t::ptr +senf::Packet::registerInterpreter(raw_container::iterator begin, raw_container::iterator end) const { @@ -94,7 +94,7 @@ satcom::pkf::Packet::registerInterpreter(raw_container::iterator begin, #include BOOST_PP_ITERATE() template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packet::find_next() +prefix_ typename senf::Packet::ptr_t::ptr senf::Packet::find_next() const { ptr p (next()); @@ -104,7 +104,7 @@ prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packe } template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packet::find_prev() +prefix_ typename senf::Packet::ptr_t::ptr senf::Packet::find_prev() const { ptr p (prev()); @@ -114,7 +114,7 @@ prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packe } template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packet::get_next() +prefix_ typename senf::Packet::ptr_t::ptr senf::Packet::get_next() const { typename ptr_t::ptr p (find_next()); @@ -123,7 +123,7 @@ prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packe } template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packet::get_prev() +prefix_ typename senf::Packet::ptr_t::ptr senf::Packet::get_prev() const { typename ptr_t::ptr p (find_prev()); @@ -132,7 +132,7 @@ prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packe } template -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()); @@ -148,5 +148,5 @@ prefix_ void satcom::pkf::Packet::insert(iterator pos, InputIterator f, InputIte // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/Packet.cti b/Packets/Packet.cti index 364bd17..79c32fa 100644 --- a/Packets/Packet.cti +++ b/Packets/Packet.cti @@ -30,14 +30,14 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ bool satcom::pkf::Packet::is() +prefix_ bool senf::Packet::is() const { return dynamic_cast(this); } template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packet::as() +prefix_ typename senf::Packet::ptr_t::ptr senf::Packet::as() { return typename ptr_t::ptr(dynamic_cast(this),true); } @@ -45,7 +45,7 @@ prefix_ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packe // This constructor appends a new interreter to the interpreter chain // of an existing Packet template -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) { @@ -57,7 +57,7 @@ prefix_ satcom::pkf::Packet::Packet(Operation const & arg) } template -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") @@ -69,5 +69,5 @@ prefix_ satcom::pkf::impl::PacketImpl::PacketImpl(InputIterator begin, InputIter // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/Packet.hh b/Packets/Packet.hh index 14345e3..2511c8a 100644 --- a/Packets/Packet.hh +++ b/Packets/Packet.hh @@ -37,83 +37,6 @@ // 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 */ @@ -133,8 +56,7 @@ #include "Packet.mpp" // ////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { namespace impl { template class PkReg_EntryImpl; } namespace impl { class PacketImpl; } @@ -145,7 +67,7 @@ namespace pkf { 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 @@ -195,7 +117,7 @@ namespace pkf { \code class ExamplePacket - : public satcom::pkf::Packet + : public senf::Packet { public: typedef ptr_t::ptr ptr; @@ -210,7 +132,7 @@ namespace pkf { private: template ExamplePacket(Arg arg [, other args ... ]) - : satcom::pkf::Packet(arg) + : senf::Packet(arg) {} virtual void v_nextInterpreter() const @@ -225,14 +147,14 @@ namespace pkf { // 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 @@ -246,8 +168,8 @@ namespace pkf { \code class ExamplePacket - : public satcom::pkf::Packet, - public Parse_Example { @@ -257,17 +179,17 @@ namespace pkf { private: template 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 @@ -276,14 +198,14 @@ namespace pkf { }; class ExamplePacket - : public satcom::pkf::Packet, - public Parse_Example, - public satcom::pkf::PacketRegistryMixin { - using satcom::pkf::Packet::registerInterpreter; - using satcom::pkf::PacketRegsitryMixin::registerInterpreter; + using senf::Packet::registerInterpreter; + using senf::PacketRegsitryMixin::registerInterpreter; private: virtual void v_nextInterpreter() const { @@ -296,7 +218,7 @@ namespace pkf { \endcode For further details on the packet registry, see - satcom::pkf::PacketRegistry. + senf::PacketRegistry. \section packet_impl Implementation details @@ -307,7 +229,7 @@ namespace pkf { 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 @@ -358,7 +280,7 @@ namespace pkf { typedef std::vector raw_container; typedef boost::shared_ptr interpreter_list_ptr; - typedef std::list interpreter_list; + typedef std::list interpreter_list; typedef unsigned refcount_t; ///@} @@ -593,7 +515,7 @@ namespace pkf { 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. */ @@ -689,7 +611,7 @@ namespace pkf { struct TruncatedPacketException : public std::exception { virtual char const * what() const throw() { return "truncated packet"; } }; -}} +} // ////////////////////////////hh.e//////////////////////////////////////// #include "Packet.cci" @@ -702,5 +624,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/Packet.ih b/Packets/Packet.ih index 1520385..550145c 100644 --- a/Packets/Packet.ih +++ b/Packets/Packet.ih @@ -34,8 +34,8 @@ #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 @@ -91,10 +91,10 @@ namespace impl { // 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; @@ -109,7 +109,7 @@ struct satcom::pkf::Packet::PacketOp_register { p->i_registerInterpreter(self); } }; -struct satcom::pkf::Packet::PacketOp_replace +struct senf::Packet::PacketOp_replace { Packet * p; @@ -121,7 +121,7 @@ struct satcom::pkf::Packet::PacketOp_replace { p->i_replaceInterpreter(self); } }; -struct satcom::pkf::Packet::PacketOp_set +struct senf::Packet::PacketOp_set { impl::PacketImpl * i; @@ -139,5 +139,5 @@ struct satcom::pkf::Packet::PacketOp_set // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/Packet.mpp b/Packets/Packet.mpp index 3d47d96..36809a4 100644 --- a/Packets/Packet.mpp +++ b/Packets/Packet.mpp @@ -49,8 +49,8 @@ typename ptr_t::ptr reinterpret( BOOST_PP_ENUM( BOOST_PP_ITERATION( // Packet::reinterpret implementation template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr -satcom::pkf::Packet::reinterpret( BOOST_PP_ENUM( BOOST_PP_ITERATION(), pkARG, ) ) +prefix_ typename senf::Packet::ptr_t::ptr +senf::Packet::reinterpret( BOOST_PP_ENUM( BOOST_PP_ITERATION(), pkARG, ) ) { if (!OtherPacket::check(begin(),end())) throw TruncatedPacketException(); @@ -75,8 +75,8 @@ typename ptr_t::ptr registerInterpreter( // Packet::registerIterpreter implementation template -prefix_ typename satcom::pkf::Packet::ptr_t::ptr -satcom::pkf::Packet::registerInterpreter(raw_container::iterator begin, +prefix_ typename senf::Packet::ptr_t::ptr +senf::Packet::registerInterpreter(raw_container::iterator begin, raw_container::iterator end, BOOST_PP_ENUM( BOOST_PP_ITERATION(), pkARG, ) ) const @@ -98,7 +98,7 @@ satcom::pkf::Packet::registerInterpreter(raw_container::iterator begin, template < class OtherPacket, class InputIterator, BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A) > -static typename satcom::pkf::Packet::ptr_t::ptr create( +static typename senf::Packet::ptr_t::ptr create( InputIterator b, InputIterator e, BOOST_PP_ENUM( BOOST_PP_ITERATION(), pkARG, ) ); @@ -108,7 +108,7 @@ static typename satcom::pkf::Packet::ptr_t::ptr create( template < class OtherPacket, class InputIterator, BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A) > -typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packet::create( +typename senf::Packet::ptr_t::ptr senf::Packet::create( InputIterator b, InputIterator e, BOOST_PP_ENUM( BOOST_PP_ITERATION(), pkARG, ) ) { @@ -130,5 +130,5 @@ typename satcom::pkf::Packet::ptr_t::ptr satcom::pkf::Packet::creat // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/Packet.test.cc b/Packets/Packet.test.cc index d41e8a0..5c0319a 100644 --- a/Packets/Packet.test.cc +++ b/Packets/Packet.test.cc @@ -36,7 +36,7 @@ #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. @@ -243,5 +243,5 @@ BOOST_AUTO_UNIT_TEST(Packet_new) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/PacketRegistry.cc b/Packets/PacketRegistry.cc index 631d763..ec0352b 100644 --- a/Packets/PacketRegistry.cc +++ b/Packets/PacketRegistry.cc @@ -30,8 +30,8 @@ #define prefix_ ///////////////////////////////PacketRegistry..p//////////////////////////////////////// -satcom::pkf::impl::PkReg_EntryImpl - satcom::pkf::impl::pkreg_dataEntry; +senf::impl::PkReg_EntryImpl + senf::impl::pkreg_dataEntry; ///////////////////////////////PacketRegistry..e//////////////////////////////////////// #undef prefix_ @@ -39,5 +39,5 @@ satcom::pkf::impl::PkReg_EntryImpl // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/PacketRegistry.ct b/Packets/PacketRegistry.ct index e40f3ac..ce424fa 100644 --- a/Packets/PacketRegistry.ct +++ b/Packets/PacketRegistry.ct @@ -33,19 +33,19 @@ template template -prefix_ void satcom::pkf::impl::PacketRegistryImpl::registerPacket(key_t key) +prefix_ void senf::impl::PacketRegistryImpl::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()))).second ); // If this assertion fails, the same Packet was registered with two different keys BOOST_ASSERT( reverseRegistry_.insert( - std::make_pair(satcom::lib::typeIdValue(), key)).second ); + std::make_pair(senf::typeIdValue(), key)).second ); } template -prefix_ typename satcom::pkf::impl::PacketRegistryImpl::key_t -satcom::pkf::impl::PacketRegistryImpl::key(satcom::lib::TypeIdValue const & type) +prefix_ typename senf::impl::PacketRegistryImpl::key_t +senf::impl::PacketRegistryImpl::key(senf::TypeIdValue const & type) { typename ReversePacketMap::iterator i (reverseRegistry_.find(type)); if (i==reverseRegistry_.end()) @@ -55,7 +55,7 @@ satcom::pkf::impl::PacketRegistryImpl::key(satcom::lib::TypeIdValue con template prefix_ void -satcom::pkf::impl::PkReg_EntryImpl::registerInterpreter(Packet const * p, +senf::impl::PkReg_EntryImpl::registerInterpreter(Packet const * p, Packet::iterator b, Packet::iterator e) { @@ -63,15 +63,15 @@ satcom::pkf::impl::PkReg_EntryImpl::registerInterpreter(Packet cons } template -prefix_ satcom::pkf::Packet::ptr -satcom::pkf::impl::PkReg_EntryImpl::reinterpret(Packet * p) +prefix_ senf::Packet::ptr +senf::impl::PkReg_EntryImpl::reinterpret(Packet * p) { return p->template reinterpret(); } template -prefix_ typename satcom::pkf::impl::PacketRegistryImpl::Entry * -satcom::pkf::impl::PacketRegistryImpl::lookup(key_t key) +prefix_ typename senf::impl::PacketRegistryImpl::Entry * +senf::impl::PacketRegistryImpl::lookup(key_t key) { typename PacketMap::iterator i (registry_.find(key)); if (i==registry_.end()) @@ -81,8 +81,8 @@ satcom::pkf::impl::PacketRegistryImpl::lookup(key_t key) template template -prefix_ satcom::pkf::Packet::ptr -satcom::pkf::PacketRegistry::create(typename Tag::key_t key, InputIterator b, +prefix_ senf::Packet::ptr +senf::PacketRegistry::create(typename Tag::key_t key, InputIterator b, InputIterator e) { Packet::ptr p (Packet::create(b,e)); @@ -90,8 +90,8 @@ satcom::pkf::PacketRegistry::create(typename Tag::key_t key, InputIterator } template -prefix_ typename satcom::pkf::PacketRegistry::Registry & -satcom::pkf::PacketRegistry::registry() +prefix_ typename senf::PacketRegistry::Registry & +senf::PacketRegistry::registry() { static Registry registry; return registry; @@ -103,5 +103,5 @@ satcom::pkf::PacketRegistry::registry() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/PacketRegistry.cti b/Packets/PacketRegistry.cti index 8c86ad8..a09c249 100644 --- a/Packets/PacketRegistry.cti +++ b/Packets/PacketRegistry.cti @@ -32,14 +32,14 @@ template template -prefix_ void satcom::pkf::PacketRegistry::registerPacket(typename Tag::key_t key) +prefix_ void senf::PacketRegistry::registerPacket(typename Tag::key_t key) { registry().registerPacket(key); } template template -prefix_ satcom::pkf::PacketRegistry::RegistrationProxy:: +prefix_ senf::PacketRegistry::RegistrationProxy:: RegistrationProxy(typename Tag::key_t key) { PacketRegistry::template registerPacket(key); @@ -47,15 +47,15 @@ RegistrationProxy(typename Tag::key_t key) template template -prefix_ typename Tag::key_t satcom::pkf::PacketRegistry::key() +prefix_ typename Tag::key_t senf::PacketRegistry::key() { - return registry().key(satcom::lib::typeIdValue()); + return registry().key(senf::typeIdValue()); } template template prefix_ void -satcom::pkf::impl::PacketRegistryImpl::registerInterpreter(Packet * p, +senf::impl::PacketRegistryImpl::registerInterpreter(Packet * p, Packet::iterator b, Packet::iterator e) { @@ -64,7 +64,7 @@ satcom::pkf::impl::PacketRegistryImpl::registerInterpreter(Packet * p, template prefix_ void -satcom::pkf::PacketRegistryMixin::registerInterpreter(typename Tag::key_t key, +senf::PacketRegistryMixin::registerInterpreter(typename Tag::key_t key, Packet::iterator b, Packet::iterator e) const @@ -79,5 +79,5 @@ satcom::pkf::PacketRegistryMixin::registerInterpreter(typename Tag: // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/PacketRegistry.hh b/Packets/PacketRegistry.hh index 94f93b1..96370a1 100644 --- a/Packets/PacketRegistry.hh +++ b/Packets/PacketRegistry.hh @@ -34,8 +34,8 @@ //#include "PacketRegistry.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + namespace impl { template class PacketRegistryImpl; } @@ -152,7 +152,7 @@ namespace pkf { 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 @@ -191,7 +191,7 @@ namespace pkf { struct PacketTypeNotRegistered : public std::exception { virtual char const * what() const throw() { return "packet type not registered"; } }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "PacketRegistry.cci" @@ -202,5 +202,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/PacketRegistry.ih b/Packets/PacketRegistry.ih index f014506..80fd037 100644 --- a/Packets/PacketRegistry.ih +++ b/Packets/PacketRegistry.ih @@ -30,8 +30,8 @@ ///////////////////////////////ih.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + namespace impl { struct PkReg_Entry { @@ -77,7 +77,7 @@ namespace impl { template 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); @@ -89,7 +89,7 @@ namespace impl { typedef boost::shared_ptr Entry_ptr; typedef std::map PacketMap; - typedef std::map ReversePacketMap; + typedef std::map ReversePacketMap; PacketMap registry_; ReversePacketMap reverseRegistry_; @@ -97,7 +97,7 @@ namespace impl { extern PkReg_EntryImpl pkreg_dataEntry; -}}} +}} ///////////////////////////////ih.e//////////////////////////////////////// #endif @@ -105,5 +105,5 @@ namespace impl { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/PacketRegistry.test.cc b/Packets/PacketRegistry.test.cc index 4d235c7..f33b60a 100644 --- a/Packets/PacketRegistry.test.cc +++ b/Packets/PacketRegistry.test.cc @@ -39,7 +39,7 @@ namespace { - using namespace satcom::pkf; + using namespace senf; struct BaseTag { typedef unsigned key_t; @@ -167,5 +167,5 @@ BOOST_AUTO_UNIT_TEST(packetRegistry_test) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseArray.cti b/Packets/ParseArray.cti index c932dd8..c6f46ca 100644 --- a/Packets/ParseArray.cti +++ b/Packets/ParseArray.cti @@ -37,31 +37,31 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::pkf::Parse_Array::Parse_Array() +prefix_ senf::Parse_Array::Parse_Array() {} template prefix_ -satcom::pkf::Parse_Array::Parse_Array(Iterator const & i) +senf::Parse_Array::Parse_Array(Iterator const & i) : ParserBase(i) {} template -prefix_ unsigned satcom::pkf::Parse_Array::bytes() +prefix_ unsigned senf::Parse_Array::bytes() { return elements*Parser::bytes(); } template prefix_ bool -satcom::pkf::Parse_Array::check(Iterator const & e) +senf::Parse_Array::check(Iterator const & e) const { return e-this->i() >= bytes(); } template -prefix_ void satcom::pkf::Parse_Array::init() +prefix_ void senf::Parse_Array::init() const { iterator e=end(); @@ -71,47 +71,47 @@ prefix_ void satcom::pkf::Parse_Array::init() /////////////////////////////////////////////////////////////////////////// template -prefix_ typename satcom::pkf::Parse_Array::size_type -satcom::pkf::Parse_Array::size() +prefix_ typename senf::Parse_Array::size_type +senf::Parse_Array::size() { return elements; } template -prefix_ typename satcom::pkf::Parse_Array::iterator -satcom::pkf::Parse_Array::begin() +prefix_ typename senf::Parse_Array::iterator +senf::Parse_Array::begin() const { return iterator(this->i()); } template -prefix_ typename satcom::pkf::Parse_Array::iterator -satcom::pkf::Parse_Array::end() +prefix_ typename senf::Parse_Array::iterator +senf::Parse_Array::end() const { return iterator(this->i()+bytes()); } template -prefix_ typename satcom::pkf::Parse_Array::range_type -satcom::pkf::Parse_Array::range() +prefix_ typename senf::Parse_Array::range_type +senf::Parse_Array::range() const { return std::make_pair(begin(),end()); } template -prefix_ typename satcom::pkf::Parse_Array::iterator -satcom::pkf::Parse_Array::value() +prefix_ typename senf::Parse_Array::iterator +senf::Parse_Array::value() const { return begin(); } template -prefix_ typename satcom::pkf::Parse_Array::value_type -satcom::pkf::Parse_Array::operator[](difference_type i) +prefix_ typename senf::Parse_Array::value_type +senf::Parse_Array::operator[](difference_type i) const { return begin()[i]; @@ -119,8 +119,8 @@ satcom::pkf::Parse_Array::operator[](differenc template template -prefix_ satcom::pkf::Parse_Array const & -satcom::pkf::Parse_Array::operator=(InputIterator const & i) +prefix_ senf::Parse_Array const & +senf::Parse_Array::operator=(InputIterator const & i) { copy_n(i,size(),begin()); } @@ -128,40 +128,40 @@ satcom::pkf::Parse_Array::operator=(InputItera /////////////////////////////////////////////////////////////////////////// template -prefix_ Iterator satcom::pkf::impl::Parse_Array_iterator::raw() +prefix_ Iterator senf::impl::Parse_Array_iterator::raw() const { return i_; } template -prefix_ Parser satcom::pkf::impl::Parse_Array_iterator::operator[](int i) +prefix_ Parser senf::impl::Parse_Array_iterator::operator[](int i) const { return (*this+i).dereference(); } template -prefix_ satcom::pkf::impl::Parse_Array_iterator::Parse_Array_iterator() +prefix_ senf::impl::Parse_Array_iterator::Parse_Array_iterator() : i_() {} template -prefix_ satcom::pkf::impl::Parse_Array_iterator:: +prefix_ senf::impl::Parse_Array_iterator:: Parse_Array_iterator(Iterator const & i) : i_(i) {} template prefix_ Parser -satcom::pkf::impl::Parse_Array_iterator::dereference() +senf::impl::Parse_Array_iterator::dereference() const { return Parser(i_); } template -prefix_ bool satcom::pkf::impl::Parse_Array_iterator:: +prefix_ bool senf::impl::Parse_Array_iterator:: equal(Parse_Array_iterator const & other) const { @@ -169,7 +169,7 @@ equal(Parse_Array_iterator const & other) } template -prefix_ int satcom::pkf::impl::Parse_Array_iterator:: +prefix_ int senf::impl::Parse_Array_iterator:: distance_to(Parse_Array_iterator const & other) const { @@ -177,20 +177,20 @@ distance_to(Parse_Array_iterator const & other) } template -prefix_ void satcom::pkf::impl::Parse_Array_iterator::increment() +prefix_ void senf::impl::Parse_Array_iterator::increment() { i_ += Parser::bytes(); } template -prefix_ void satcom::pkf::impl::Parse_Array_iterator::decrement() +prefix_ void senf::impl::Parse_Array_iterator::decrement() { i_ -= Parser::bytes(); } template prefix_ void -satcom::pkf::impl::Parse_Array_iterator::advance(int n) +senf::impl::Parse_Array_iterator::advance(int n) { i_ += n*Parser::bytes(); } @@ -202,5 +202,5 @@ satcom::pkf::impl::Parse_Array_iterator::advance(int n) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseArray.hh b/Packets/ParseArray.hh index f4a0d41..267cb7b 100644 --- a/Packets/ParseArray.hh +++ b/Packets/ParseArray.hh @@ -30,8 +30,8 @@ //#include "ParseArray.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + namespace impl { template class Parse_Array_iterator; } @@ -76,7 +76,7 @@ namespace pkf { Parse_Array const & operator= (InputIterator const & i); }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "ParseArray.cci" @@ -87,5 +87,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseArray.ih b/Packets/ParseArray.ih index 85e850f..3ced579 100644 --- a/Packets/ParseArray.ih +++ b/Packets/ParseArray.ih @@ -29,7 +29,7 @@ ///////////////////////////////ih.p//////////////////////////////////////// template -class satcom::pkf::impl::Parse_Array_iterator +class senf::impl::Parse_Array_iterator : public boost::iterator_facade< Parse_Array_iterator, Parser, boost::random_access_traversal_tag, @@ -65,5 +65,5 @@ private: // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseArray.test.cc b/Packets/ParseArray.test.cc index 59a9898..0f9d9e7 100644 --- a/Packets/ParseArray.test.cc +++ b/Packets/ParseArray.test.cc @@ -35,7 +35,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::pkf; +using namespace senf; BOOST_AUTO_UNIT_TEST(parseArray_test) { @@ -63,5 +63,5 @@ BOOST_AUTO_UNIT_TEST(parseArray_test) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseInt.hh b/Packets/ParseInt.hh index 1207eaf..ba13aaf 100644 --- a/Packets/ParseInt.hh +++ b/Packets/ParseInt.hh @@ -33,8 +33,8 @@ ///////////////////////////////hh.p//////////////////////////////////////// #include "ParseInt.ih" -namespace satcom { -namespace pkf { +namespace senf { + template struct Parse_Int8 @@ -305,7 +305,7 @@ namespace pkf { Parse_Flag const & operator= (value_type other) { value(other); return *this; } }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "ParseInt.cci" @@ -316,5 +316,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseInt.ih b/Packets/ParseInt.ih index fd58b04..48b5c9b 100644 --- a/Packets/ParseInt.ih +++ b/Packets/ParseInt.ih @@ -27,8 +27,8 @@ ///////////////////////////////ih.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + namespace impl { /////////////////////////////////////////////////////////////////////////// @@ -212,7 +212,7 @@ namespace impl { : public parse_bitfield_i {}; -}}} +}} ///////////////////////////////ih.e//////////////////////////////////////// #endif @@ -220,5 +220,5 @@ namespace impl { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseInt.test.cc b/Packets/ParseInt.test.cc index 7325359..7965a01 100644 --- a/Packets/ParseInt.test.cc +++ b/Packets/ParseInt.test.cc @@ -35,7 +35,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::pkf; +using namespace senf; BOOST_AUTO_UNIT_TEST(parseInt_fixedSizes) { @@ -237,5 +237,5 @@ BOOST_AUTO_UNIT_TEST(parseInt_inherited) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseListS.ct b/Packets/ParseListS.ct index 7e65fa9..297f2c4 100644 --- a/Packets/ParseListS.ct +++ b/Packets/ParseListS.ct @@ -31,7 +31,7 @@ ///////////////////////////////ct.p//////////////////////////////////////// template -prefix_ unsigned satcom::pkf::Parse_ListS::bytes() +prefix_ unsigned senf::Parse_ListS::bytes() const { iterator i (begin()); @@ -46,7 +46,7 @@ prefix_ unsigned satcom::pkf::Parse_ListS::byt template prefix_ bool -satcom::pkf::Parse_ListS::check(Iterator const & e) +senf::Parse_ListS::check(Iterator const & e) const { byte_iterator i (this->i()); @@ -61,7 +61,7 @@ satcom::pkf::Parse_ListS::check(Iterator const } template -prefix_ void satcom::pkf::Parse_ListS::init() +prefix_ void senf::Parse_ListS::init() const { iterator i (begin()); @@ -74,12 +74,12 @@ prefix_ void satcom::pkf::Parse_ListS::init() } /////////////////////////////////////////////////////////////////////////// -// satcom::pkf::Parse_ListS_wrapper +// senf::Parse_ListS_wrapper template template prefix_ void -satcom::pkf::Parse_ListS_wrapper::insert(iterator pos, +senf::Parse_ListS_wrapper::insert(iterator pos, Value const & t) { // FIXME: What, if pos == end() / default constructed iterator ? @@ -91,7 +91,7 @@ satcom::pkf::Parse_ListS_wrapper::insert(iterator pos template template prefix_ void -satcom::pkf::Parse_ListS_wrapper::insert(iterator pos, size_type n, +senf::Parse_ListS_wrapper::insert(iterator pos, size_type n, Value const & t) { size_type ix (pos.raw()-container_.begin()); @@ -104,7 +104,7 @@ satcom::pkf::Parse_ListS_wrapper::insert(iterator pos template template prefix_ void -satcom::pkf::Parse_ListS_wrapper::insert(iterator pos, +senf::Parse_ListS_wrapper::insert(iterator pos, InputIterator f, InputIterator l) { @@ -117,5 +117,5 @@ satcom::pkf::Parse_ListS_wrapper::insert(iterator pos // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseListS.cti b/Packets/ParseListS.cti index db91757..3a8a3e0 100644 --- a/Packets/ParseListS.cti +++ b/Packets/ParseListS.cti @@ -31,74 +31,74 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::pkf::Parse_ListS::Parse_ListS() +prefix_ senf::Parse_ListS::Parse_ListS() {} template prefix_ -satcom::pkf::Parse_ListS::Parse_ListS(Iterator const & i) +senf::Parse_ListS::Parse_ListS(Iterator const & i) : ParserBase(i) {} template -prefix_ typename satcom::pkf::Parse_ListS::size_type -satcom::pkf::Parse_ListS::size() +prefix_ typename senf::Parse_ListS::size_type +senf::Parse_ListS::size() const { return std::distance(begin(),end()); } template -prefix_ bool satcom::pkf::Parse_ListS::empty() +prefix_ bool senf::Parse_ListS::empty() const { return begin()==end(); } template -prefix_ typename satcom::pkf::Parse_ListS::iterator -satcom::pkf::Parse_ListS::begin() +prefix_ typename senf::Parse_ListS::iterator +senf::Parse_ListS::begin() const { return iterator(this->i()); } template -prefix_ typename satcom::pkf::Parse_ListS::iterator -satcom::pkf::Parse_ListS::end() +prefix_ typename senf::Parse_ListS::iterator +senf::Parse_ListS::end() const { return iterator(); } template -prefix_ typename satcom::pkf::Parse_ListS::range_type -satcom::pkf::Parse_ListS::range() +prefix_ typename senf::Parse_ListS::range_type +senf::Parse_ListS::range() const { return std::make_pair(begin(),end()); } template -prefix_ typename satcom::pkf::Parse_ListS::range_type -satcom::pkf::Parse_ListS::value() +prefix_ typename senf::Parse_ListS::range_type +senf::Parse_ListS::value() const { return range(); } /////////////////////////////////////////////////////////////////////////// -// satcom::pkf::impl::Parse_ListS_iterator +// senf::impl::Parse_ListS_iterator template prefix_ -satcom::pkf::impl::Parse_ListS_iterator::Parse_ListS_iterator() +senf::impl::Parse_ListS_iterator::Parse_ListS_iterator() : i_(), atEnd_(true) {} template prefix_ -satcom::pkf::impl::Parse_ListS_iterator:: +senf::impl::Parse_ListS_iterator:: Parse_ListS_iterator(Iterator const & i) : i_(i), atEnd_(false) { @@ -106,7 +106,7 @@ Parse_ListS_iterator(Iterator const & i) } template -prefix_ Iterator satcom::pkf::impl::Parse_ListS_iterator::raw() +prefix_ Iterator senf::impl::Parse_ListS_iterator::raw() const { return i_; @@ -114,14 +114,14 @@ prefix_ Iterator satcom::pkf::impl::Parse_ListS_iterator prefix_ Parser -satcom::pkf::impl::Parse_ListS_iterator::dereference() +senf::impl::Parse_ListS_iterator::dereference() const { return Parser(i_); } template -prefix_ bool satcom::pkf::impl::Parse_ListS_iterator:: +prefix_ bool senf::impl::Parse_ListS_iterator:: equal(Parse_ListS_iterator const & other) const { @@ -135,7 +135,7 @@ equal(Parse_ListS_iterator const & other) } template -prefix_ void satcom::pkf::impl::Parse_ListS_iterator::increment() +prefix_ void senf::impl::Parse_ListS_iterator::increment() { BOOST_ASSERT( !atEnd_ ); i_ += dereference().bytes(); @@ -143,49 +143,49 @@ prefix_ void satcom::pkf::impl::Parse_ListS_iterator:: } /////////////////////////////////////////////////////////////////////////// -// satcom::pkf::Parse_ListS_wrapper +// senf::Parse_ListS_wrapper template template -prefix_ satcom::pkf::Parse_ListS_wrapper:: +prefix_ senf::Parse_ListS_wrapper:: Parse_ListS_wrapper(Parse_ListS const & list, Container & container) : i_(list.i()-container.begin()), container_(container) {} template -prefix_ typename satcom::pkf::Parse_ListS_wrapper::size_type -satcom::pkf::Parse_ListS_wrapper::size() +prefix_ typename senf::Parse_ListS_wrapper::size_type +senf::Parse_ListS_wrapper::size() const { return std::distance(begin(),end()); } template -prefix_ bool satcom::pkf::Parse_ListS_wrapper::empty() +prefix_ bool senf::Parse_ListS_wrapper::empty() const { return begin()==end(); } template -prefix_ typename satcom::pkf::Parse_ListS_wrapper::iterator -satcom::pkf::Parse_ListS_wrapper::begin() +prefix_ typename senf::Parse_ListS_wrapper::iterator +senf::Parse_ListS_wrapper::begin() const { return iterator(container_.begin()+i_); } template -prefix_ typename satcom::pkf::Parse_ListS_wrapper::iterator -satcom::pkf::Parse_ListS_wrapper::end() +prefix_ typename senf::Parse_ListS_wrapper::iterator +senf::Parse_ListS_wrapper::end() const { return iterator(); } template -prefix_ typename satcom::pkf::Parse_ListS_wrapper::range_type -satcom::pkf::Parse_ListS_wrapper::range() +prefix_ typename senf::Parse_ListS_wrapper::range_type +senf::Parse_ListS_wrapper::range() const { return std::make_pair(begin(),end()); @@ -197,5 +197,5 @@ satcom::pkf::Parse_ListS_wrapper::range() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseListS.hh b/Packets/ParseListS.hh index 2c75016..a480be6 100644 --- a/Packets/ParseListS.hh +++ b/Packets/ParseListS.hh @@ -32,8 +32,8 @@ //#include "ParseListS.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + template class Parse_ListS_wrapper; namespace impl { @@ -150,7 +150,7 @@ namespace pkf { Container & container_; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "ParseListS.cci" @@ -161,5 +161,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseListS.ih b/Packets/ParseListS.ih index 6dbeb24..0cd75b4 100644 --- a/Packets/ParseListS.ih +++ b/Packets/ParseListS.ih @@ -28,8 +28,8 @@ ///////////////////////////////ih.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + namespace impl { template @@ -56,7 +56,7 @@ namespace impl { bool atEnd_; }; -}}} +}} ///////////////////////////////ih.e//////////////////////////////////////// @@ -65,5 +65,5 @@ namespace impl { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseListS.test.cc b/Packets/ParseListS.test.cc index 464b336..973be31 100644 --- a/Packets/ParseListS.test.cc +++ b/Packets/ParseListS.test.cc @@ -37,7 +37,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::pkf; +using namespace senf; namespace { template @@ -170,5 +170,5 @@ BOOST_AUTO_UNIT_TEST(parse_ListS_wrapper) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseVec.ct b/Packets/ParseVec.ct index a34f1c9..51ad0be 100644 --- a/Packets/ParseVec.ct +++ b/Packets/ParseVec.ct @@ -32,7 +32,7 @@ template template prefix_ void -satcom::pkf::Parse_Vector_wrapper::insert(iterator pos, +senf::Parse_Vector_wrapper::insert(iterator pos, Value const & t) { size_type ix(pos.raw()-container_.begin()); @@ -43,7 +43,7 @@ satcom::pkf::Parse_Vector_wrapper::insert(iterator template template prefix_ void -satcom::pkf::Parse_Vector_wrapper::insert(iterator pos, +senf::Parse_Vector_wrapper::insert(iterator pos, size_type n, Value const & t) { @@ -57,7 +57,7 @@ satcom::pkf::Parse_Vector_wrapper::insert(iterator template template prefix_ void -satcom::pkf::Parse_Vector_wrapper::insert(iterator pos, +senf::Parse_Vector_wrapper::insert(iterator pos, InputIterator f, InputIterator l) { @@ -77,5 +77,5 @@ satcom::pkf::Parse_Vector_wrapper::insert(iterator // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseVec.cti b/Packets/ParseVec.cti index 86f282f..8631fab 100644 --- a/Packets/ParseVec.cti +++ b/Packets/ParseVec.cti @@ -30,19 +30,19 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::pkf::Parse_Vector:: +prefix_ senf::Parse_Vector:: Parse_Vector(SizeParser const & size) : size_(size) {} template -prefix_ satcom::pkf::Parse_Vector:: +prefix_ senf::Parse_Vector:: Parse_Vector(size_parser const & size, Iterator const & i) : ParserBase(i), size_(size) {} template -prefix_ unsigned satcom::pkf::Parse_Vector::bytes() +prefix_ unsigned senf::Parse_Vector::bytes() const { return Parser::bytes()*size(); @@ -50,14 +50,14 @@ prefix_ unsigned satcom::pkf::Parse_Vector:: template prefix_ void -satcom::pkf::Parse_Vector::check(Iterator const & e) +senf::Parse_Vector::check(Iterator const & e) const { return e-this->i() >= bytes(); } template -prefix_ void satcom::pkf::Parse_Vector::init() +prefix_ void senf::Parse_Vector::init() const { iterator e (end()); @@ -67,15 +67,15 @@ prefix_ void satcom::pkf::Parse_Vector::init /////////////////////////////////////////////////////////////////////////// template -prefix_ typename satcom::pkf::Parse_Vector::size_type -satcom::pkf::Parse_Vector::size() +prefix_ typename senf::Parse_Vector::size_type +senf::Parse_Vector::size() const { return size_.value(); } template -prefix_ bool satcom::pkf::Parse_Vector::empty() +prefix_ bool senf::Parse_Vector::empty() const { return size()==0; @@ -83,8 +83,8 @@ prefix_ bool satcom::pkf::Parse_Vector::empt template prefix_ -typename satcom::pkf::Parse_Vector::iterator -satcom::pkf::Parse_Vector::begin() +typename senf::Parse_Vector::iterator +senf::Parse_Vector::begin() const { return iterator(this->i()); @@ -92,8 +92,8 @@ satcom::pkf::Parse_Vector::begin() template prefix_ -typename satcom::pkf::Parse_Vector::iterator -satcom::pkf::Parse_Vector::end() +typename senf::Parse_Vector::iterator +senf::Parse_Vector::end() const { return iterator(this->i()+bytes()); @@ -101,8 +101,8 @@ satcom::pkf::Parse_Vector::end() template prefix_ -typename satcom::pkf::Parse_Vector::range_type -satcom::pkf::Parse_Vector::range() +typename senf::Parse_Vector::range_type +senf::Parse_Vector::range() const { return std::make_pair(begin(),end()); @@ -110,8 +110,8 @@ satcom::pkf::Parse_Vector::range() template prefix_ -typename satcom::pkf::Parse_Vector::range_type -satcom::pkf::Parse_Vector::value() +typename senf::Parse_Vector::range_type +senf::Parse_Vector::value() const { return range(); @@ -119,73 +119,73 @@ satcom::pkf::Parse_Vector::value() template prefix_ -typename satcom::pkf::Parse_Vector::value_type -satcom::pkf::Parse_Vector::operator[](difference_type i) +typename senf::Parse_Vector::value_type +senf::Parse_Vector::operator[](difference_type i) const { return begin()[i]; } /////////////////////////////////////////////////////////////////////////// -// satcom::pkf::Parse_Vector_wrapper +// senf::Parse_Vector_wrapper template template -prefix_ satcom::pkf::Parse_Vector_wrapper:: +prefix_ senf::Parse_Vector_wrapper:: Parse_Vector_wrapper(Parse_Vector const & vector, Container & container) : i_(vector.i()-container.begin()), size_i_(vector.size_.i()-container.begin()), container_(container) {} template -prefix_ typename satcom::pkf::Parse_Vector_wrapper::size_type -satcom::pkf::Parse_Vector_wrapper::size() +prefix_ typename senf::Parse_Vector_wrapper::size_type +senf::Parse_Vector_wrapper::size() const { return SizeParser(container_.begin()+size_i_).value(); } template -prefix_ bool satcom::pkf::Parse_Vector_wrapper::empty() +prefix_ bool senf::Parse_Vector_wrapper::empty() const { return size() == 0; } template -prefix_ typename satcom::pkf::Parse_Vector_wrapper::iterator -satcom::pkf::Parse_Vector_wrapper::begin() +prefix_ typename senf::Parse_Vector_wrapper::iterator +senf::Parse_Vector_wrapper::begin() const { return iterator(container_.begin() + i_); } template -prefix_ typename satcom::pkf::Parse_Vector_wrapper::iterator -satcom::pkf::Parse_Vector_wrapper::end() +prefix_ typename senf::Parse_Vector_wrapper::iterator +senf::Parse_Vector_wrapper::end() const { return iterator(container_.begin() + i_ + Parser::bytes()*size()); } template -prefix_ typename satcom::pkf::Parse_Vector_wrapper::range_type -satcom::pkf::Parse_Vector_wrapper::range() +prefix_ typename senf::Parse_Vector_wrapper::range_type +senf::Parse_Vector_wrapper::range() const { return std::make_pair(begin(), end()); } template -prefix_ typename satcom::pkf::Parse_Vector_wrapper::value_type -satcom::pkf::Parse_Vector_wrapper::operator[](difference_type i) +prefix_ typename senf::Parse_Vector_wrapper::value_type +senf::Parse_Vector_wrapper::operator[](difference_type i) const { return begin()[i]; } template -prefix_ void satcom::pkf::Parse_Vector_wrapper::shift(iterator pos, +prefix_ void senf::Parse_Vector_wrapper::shift(iterator pos, size_type n) { container_.insert(pos.raw(),n*Parser::bytes(),0); @@ -193,7 +193,7 @@ prefix_ void satcom::pkf::Parse_Vector_wrapper::shi } template -prefix_ void satcom::pkf::Parse_Vector_wrapper::erase(iterator pos, +prefix_ void senf::Parse_Vector_wrapper::erase(iterator pos, size_type n) { container_.erase(pos.raw(),pos.raw()+n*Parser::bytes()); @@ -201,14 +201,14 @@ prefix_ void satcom::pkf::Parse_Vector_wrapper::era } template -prefix_ void satcom::pkf::Parse_Vector_wrapper::erase(iterator f, +prefix_ void senf::Parse_Vector_wrapper::erase(iterator f, iterator l) { erase(f,l-f); } template -prefix_ void satcom::pkf::Parse_Vector_wrapper::clear() +prefix_ void senf::Parse_Vector_wrapper::clear() { container_.erase(container_.begin()+i_,container_.begin()+i_+size()*Parser::bytes()); SizeParser(container_.begin()+size_i_) = 0; @@ -220,5 +220,5 @@ prefix_ void satcom::pkf::Parse_Vector_wrapper::cle // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseVec.hh b/Packets/ParseVec.hh index 3b2dc38..a4b3033 100644 --- a/Packets/ParseVec.hh +++ b/Packets/ParseVec.hh @@ -33,8 +33,8 @@ //#include "ParseVec.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + template class Parse_Vector_wrapper; @@ -160,7 +160,7 @@ namespace pkf { Container & container_; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "ParseVec.cci" @@ -171,5 +171,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParseVec.test.cc b/Packets/ParseVec.test.cc index 4743c2a..139dfdb 100644 --- a/Packets/ParseVec.test.cc +++ b/Packets/ParseVec.test.cc @@ -36,7 +36,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::pkf; +using namespace senf; BOOST_AUTO_UNIT_TEST(parseVec_test) { @@ -149,5 +149,5 @@ BOOST_AUTO_UNIT_TEST(parserTraits_test) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParserBase.cti b/Packets/ParserBase.cti index 084c625..4a2b252 100644 --- a/Packets/ParserBase.cti +++ b/Packets/ParserBase.cti @@ -30,58 +30,58 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ Iterator satcom::pkf::ParserBase::i() +prefix_ Iterator senf::ParserBase::i() const { return static_cast(this)->begin(); } template -prefix_ satcom::pkf::ParserBase::ParserBase(Iterator const & i) +prefix_ senf::ParserBase::ParserBase(Iterator const & i) : i_(i) {} template -prefix_ Iterator satcom::pkf::ParserBase::i() +prefix_ Iterator senf::ParserBase::i() const { return i_; } template -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::fixed_size>::check(b,e); } template -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 -prefix_ bool satcom::pkf::check(Iterator const & b, Iterator const & e) +prefix_ bool senf::check(Iterator const & b, Iterator const & e) { return impl::check(b,e,static_cast(0)); } template -prefix_ unsigned satcom::pkf::impl::min_bytes(impl::ParserBase *) +prefix_ unsigned senf::impl::min_bytes(impl::ParserBase *) { return impl::ParserMinBytes::fixed_size>::bytes(); } template -prefix_ unsigned satcom::pkf::impl::min_bytes(void *) +prefix_ unsigned senf::impl::min_bytes(void *) { return 0; } template -prefix_ unsigned satcom::pkf::min_bytes() +prefix_ unsigned senf::min_bytes() { return impl::min_bytes(static_cast(0)); } @@ -92,5 +92,5 @@ prefix_ unsigned satcom::pkf::min_bytes() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParserBase.hh b/Packets/ParserBase.hh index cb2ecce..c414ab5 100644 --- a/Packets/ParserBase.hh +++ b/Packets/ParserBase.hh @@ -35,8 +35,8 @@ #include "ParserBase.ih" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + namespace impl { struct ParserBase; } @@ -81,7 +81,7 @@ namespace pkf { \code template struct Parser_Example - : protected satcom::pkf::ParserBase + : protected senf::ParserBase { // fixed interface of all parser classes @@ -294,7 +294,7 @@ namespace pkf { template unsigned min_bytes(); -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "ParserBase.cci" @@ -305,5 +305,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParserBase.ih b/Packets/ParserBase.ih index 924189a..38698b9 100644 --- a/Packets/ParserBase.ih +++ b/Packets/ParserBase.ih @@ -27,8 +27,8 @@ ///////////////////////////////ih.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + namespace impl { struct ParserBase {}; @@ -87,7 +87,7 @@ namespace impl { static unsigned bytes() { return Parser::bytes(); } }; -}}} +}} ///////////////////////////////ih.e//////////////////////////////////////// #endif @@ -95,5 +95,5 @@ namespace impl { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/ParserBase.test.cc b/Packets/ParserBase.test.cc index b1a8983..f0e410a 100644 --- a/Packets/ParserBase.test.cc +++ b/Packets/ParserBase.test.cc @@ -36,8 +36,6 @@ #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) @@ -47,15 +45,15 @@ BOOST_AUTO_UNIT_TEST(parserBase_inherited) namespace { - template - struct Parse_Test : public pkf::ParserBase + template + struct Parse_Test : public senf::ParserBase { - template + template struct rebind { typedef Parse_Test parser; }; typedef Iterator byte_iterator; Parse_Test() {} - Parse_Test(Iterator const & i) : pkf::ParserBase(i) {} + Parse_Test(Iterator const & i) : senf::ParserBase(i) {} static unsigned bytes() { return 14; } @@ -63,15 +61,15 @@ namespace { }; - template - struct Parse_Test2 : public pkf::ParserBase + template + struct Parse_Test2 : public senf::ParserBase { - template + template struct rebind { typedef Parse_Test parser; }; typedef Iterator byte_iterator; Parse_Test2() {} - Parse_Test2(Iterator const & i) : pkf::ParserBase(i) {} + Parse_Test2(Iterator const & i) : senf::ParserBase(i) {} unsigned bytes() const { return 14; } static unsigned check(Iterator a, Iterator b) @@ -86,16 +84,16 @@ namespace { 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 >(), 14u ); - BOOST_CHECK( pkf::check< Parse_Test >(0,14) ); - BOOST_CHECK( ! pkf::check< Parse_Test >(2,15) ); + BOOST_CHECK_EQUAL( senf::min_bytes< Parse_Test >(), 14u ); + BOOST_CHECK( senf::check< Parse_Test >(0,14) ); + BOOST_CHECK( ! senf::check< Parse_Test >(2,15) ); - BOOST_CHECK_EQUAL( pkf::min_bytes< Parse_Test2 >(), 10u ); - BOOST_CHECK( pkf::check< Parse_Test2 >(2,13) ); - BOOST_CHECK( pkf::check< Parse_Test2 >(2,12) ); + BOOST_CHECK_EQUAL( senf::min_bytes< Parse_Test2 >(), 10u ); + BOOST_CHECK( senf::check< Parse_Test2 >(2,13) ); + BOOST_CHECK( senf::check< Parse_Test2 >(2,12) ); } ///////////////////////////////cc.e//////////////////////////////////////// @@ -104,5 +102,5 @@ BOOST_AUTO_UNIT_TEST(parserBase_construction) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/RTCPPacket.cc b/Packets/RTCPPacket.cc index f50b44d..54daf93 100644 --- a/Packets/RTCPPacket.cc +++ b/Packets/RTCPPacket.cc @@ -31,13 +31,13 @@ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ void satcom::pkf::RTCPPacket::v_nextInterpreter() +prefix_ void senf::RTCPPacket::v_nextInterpreter() const { registerInterpreter(begin()+bytes(),end()); } -prefix_ void satcom::pkf::RTCPPacket::v_finalize() +prefix_ void senf::RTCPPacket::v_finalize() {} @@ -47,5 +47,5 @@ prefix_ void satcom::pkf::RTCPPacket::v_finalize() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/RTCPPacket.cti b/Packets/RTCPPacket.cti index a652af0..9086b3d 100644 --- a/Packets/RTCPPacket.cti +++ b/Packets/RTCPPacket.cti @@ -30,7 +30,7 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::pkf::RTCPPacket::RTCPPacket(Arg const & arg) +prefix_ senf::RTCPPacket::RTCPPacket(Arg const & arg) : Packet(arg) {} @@ -40,5 +40,5 @@ prefix_ satcom::pkf::RTCPPacket::RTCPPacket(Arg const & arg) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/RTCPPacket.hh b/Packets/RTCPPacket.hh index 2518110..2fcc837 100644 --- a/Packets/RTCPPacket.hh +++ b/Packets/RTCPPacket.hh @@ -34,8 +34,8 @@ //#include "RTCPPacket.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + template struct Parse_RTCP_RR; template struct Parse_RTCP_SR; @@ -299,7 +299,7 @@ namespace pkf { friend class Packet; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// @@ -311,5 +311,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/RTCPPacket.test.cc b/Packets/RTCPPacket.test.cc index 86e0d0a..3e168f6 100644 --- a/Packets/RTCPPacket.test.cc +++ b/Packets/RTCPPacket.test.cc @@ -34,7 +34,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::pkf; +using namespace senf; BOOST_AUTO_UNIT_TEST(rtcpPacket_parser) { @@ -335,5 +335,5 @@ BOOST_AUTO_UNIT_TEST(rtcpPacket_packet) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/RTPPacket.cc b/Packets/RTPPacket.cc index 593610a..e3e6153 100644 --- a/Packets/RTPPacket.cc +++ b/Packets/RTPPacket.cc @@ -31,7 +31,7 @@ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ void satcom::pkf::RTPPacket::v_nextInterpreter() +prefix_ void senf::RTPPacket::v_nextInterpreter() const { @@ -47,10 +47,10 @@ prefix_ void satcom::pkf::RTPPacket::v_nextInterpreter() } } -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" @@ -66,7 +66,7 @@ prefix_ void satcom::pkf::RTPPacket::v_dump(std::ostream & os) << " csrc list : \n"; } -prefix_ void satcom::pkf::RTPExtensionBasePacket::v_nextInterpreter() +prefix_ void senf::RTPExtensionBasePacket::v_nextInterpreter() const { @@ -85,14 +85,14 @@ prefix_ void satcom::pkf::RTPExtensionBasePacket::v_nextInterpreter() registerInterpreter(get_prev()->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//////////////////////////////////////// @@ -101,5 +101,5 @@ prefix_ void satcom::pkf::RTPUnknownExtensionPacket::v_finalize() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/RTPPacket.cti b/Packets/RTPPacket.cti index 18633be..8e750ee 100644 --- a/Packets/RTPPacket.cti +++ b/Packets/RTPPacket.cti @@ -30,18 +30,18 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::pkf::RTPPacket::RTPPacket(Arg const & arg) +prefix_ senf::RTPPacket::RTPPacket(Arg const & arg) : Packet(arg) {} template -prefix_ satcom::pkf::RTPExtensionBasePacket:: +prefix_ senf::RTPExtensionBasePacket:: RTPExtensionBasePacket(Arg const & arg) : Packet(arg) {} template -prefix_ satcom::pkf::RTPUnknownExtensionPacket:: +prefix_ senf::RTPUnknownExtensionPacket:: RTPUnknownExtensionPacket(Arg const & arg) : RTPExtensionBasePacket(arg) {} @@ -52,5 +52,5 @@ RTPUnknownExtensionPacket(Arg const & arg) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/RTPPacket.hh b/Packets/RTPPacket.hh index 9f4a6c7..3fe3c3e 100644 --- a/Packets/RTPPacket.hh +++ b/Packets/RTPPacket.hh @@ -33,8 +33,8 @@ //#include "RTPPacket.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + template struct Parse_RTP : public ParserBase @@ -208,7 +208,7 @@ namespace pkf { friend class Packet; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// @@ -220,5 +220,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/RTPPacket.test.cc b/Packets/RTPPacket.test.cc index ff3a58d..29a882e 100644 --- a/Packets/RTPPacket.test.cc +++ b/Packets/RTPPacket.test.cc @@ -38,7 +38,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::pkf; +using namespace senf; BOOST_AUTO_UNIT_TEST(rtpPacket_parser) { @@ -242,5 +242,5 @@ BOOST_AUTO_UNIT_TEST(eth_rtpPacket_packet) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/UDPPacket.cc b/Packets/UDPPacket.cc index 7f44028..e4a48b6 100644 --- a/Packets/UDPPacket.cc +++ b/Packets/UDPPacket.cc @@ -32,21 +32,20 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// namespace { - namespace pkf = satcom::pkf; - pkf::PacketRegistry::RegistrationProxy + senf::PacketRegistry::RegistrationProxy registerUDPPacket(17); } -prefix_ void satcom::pkf::UDPPacket::v_nextInterpreter() +prefix_ void senf::UDPPacket::v_nextInterpreter() const { registerInterpreter(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" @@ -62,5 +61,5 @@ prefix_ void satcom::pkf::UDPPacket::v_dump(std::ostream & os) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/UDPPacket.cti b/Packets/UDPPacket.cti index b49e530..21e332e 100644 --- a/Packets/UDPPacket.cti +++ b/Packets/UDPPacket.cti @@ -30,7 +30,7 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::pkf::UDPPacket::UDPPacket(Arg const & arg) +prefix_ senf::UDPPacket::UDPPacket(Arg const & arg) : Packet(arg) {} @@ -42,5 +42,5 @@ prefix_ satcom::pkf::UDPPacket::UDPPacket(Arg const & arg) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/UDPPacket.hh b/Packets/UDPPacket.hh index 75cdf79..54cea7f 100644 --- a/Packets/UDPPacket.hh +++ b/Packets/UDPPacket.hh @@ -32,8 +32,8 @@ //#include "UDPPacket.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { +namespace senf { + template struct Parse_UDP : public ParserBase @@ -80,7 +80,7 @@ namespace pkf { friend class Packet; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// @@ -92,5 +92,5 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/UDPPacket.test.cc b/Packets/UDPPacket.test.cc index afcb77d..6441912 100644 --- a/Packets/UDPPacket.test.cc +++ b/Packets/UDPPacket.test.cc @@ -34,7 +34,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::pkf; +using namespace senf; BOOST_AUTO_UNIT_TEST(udpPacket_parser) { @@ -77,5 +77,5 @@ BOOST_AUTO_UNIT_TEST(udpPacket_packet) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/docstub.hh b/Packets/docstub.hh index 3607b8f..3ed13bf 100644 --- a/Packets/docstub.hh +++ b/Packets/docstub.hh @@ -55,5 +55,5 @@ namespace std { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/typeidvalue.cci b/Packets/typeidvalue.cci index 26d8c4f..b27eab3 100644 --- a/Packets/typeidvalue.cci +++ b/Packets/typeidvalue.cci @@ -29,41 +29,41 @@ #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// -prefix_ satcom::lib::TypeIdValue::TypeIdValue() +prefix_ senf::TypeIdValue::TypeIdValue() : value_(new ValueImpl()) {} -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(); } @@ -74,5 +74,5 @@ prefix_ satcom::lib::TypeIdValue const satcom::lib::typeIdValue() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/typeidvalue.cti b/Packets/typeidvalue.cti index 9c78ae1..3dc3419 100644 --- a/Packets/typeidvalue.cti +++ b/Packets/typeidvalue.cti @@ -30,25 +30,25 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::lib::TypeIdValue::TypeIdValue(Type *) +prefix_ senf::TypeIdValue::TypeIdValue(Type *) : value_(new ValueImpl()) {} template -prefix_ std::type_info const & satcom::lib::TypeIdValue::ValueImpl::id() +prefix_ std::type_info const & senf::TypeIdValue::ValueImpl::id() { return typeid(Type); } template -prefix_ satcom::lib::TypeIdValue::Value * -satcom::lib::TypeIdValue::ValueImpl::clone() +prefix_ senf::TypeIdValue::Value * +senf::TypeIdValue::ValueImpl::clone() { return new ValueImpl(); } template -prefix_ satcom::lib::TypeIdValue const satcom::lib::typeIdValue() +prefix_ senf::TypeIdValue const senf::typeIdValue() { return TypeIdValue(static_cast(0)); } @@ -59,5 +59,5 @@ prefix_ satcom::lib::TypeIdValue const satcom::lib::typeIdValue() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Packets/typeidvalue.hh b/Packets/typeidvalue.hh index bb03dbe..632fe13 100644 --- a/Packets/typeidvalue.hh +++ b/Packets/typeidvalue.hh @@ -32,8 +32,8 @@ //#include "typeidvalue.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + /** \brief Wrapper to use types as key's in a map */ @@ -89,7 +89,7 @@ namespace lib { template TypeIdValue const typeIdValue(); -}} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "typeidvalue.cci" @@ -100,5 +100,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/SConstruct b/SConstruct index 0dd5710..2745e81 100644 --- a/SConstruct +++ b/SConstruct @@ -1,7 +1,7 @@ # -*- python -*- import sys, glob -sys.path.append('satscons') +sys.path.append('senfscons') import SatSCons ########################################################################### diff --git a/Scheduler/ReadHelper.cci b/Scheduler/ReadHelper.cci index 81d7e6a..3d1a0aa 100644 --- a/Scheduler/ReadHelper.cci +++ b/Scheduler/ReadHelper.cci @@ -9,11 +9,11 @@ #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); } diff --git a/Scheduler/ReadHelper.ct b/Scheduler/ReadHelper.ct index 16d2850..6a5d0b7 100644 --- a/Scheduler/ReadHelper.ct +++ b/Scheduler/ReadHelper.ct @@ -16,7 +16,7 @@ ///////////////////////////////ct.p//////////////////////////////////////// template -prefix_ satcom::lib::ReadHelper::ReadHelper(Handle handle, std::string::size_type maxSize, +prefix_ senf::ReadHelper::ReadHelper(Handle handle, std::string::size_type maxSize, InternalPredicate * predicate, Callback cb) : handle_(handle), maxSize_(maxSize), predicate_(predicate), callback_(cb), errno_(0), complete_(false) @@ -25,23 +25,23 @@ prefix_ satcom::lib::ReadHelper::ReadHelper(Handle handle, std::string:: // 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 -prefix_ void satcom::lib::ReadHelper::revoke() +prefix_ void senf::ReadHelper::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 prefix_ void -satcom::lib::ReadHelper::dispatchProcess(ptr helper, Handle handle, - satcom::lib::Scheduler::EventId event) +senf::ReadHelper::dispatchProcess(ptr helper, Handle handle, + senf::Scheduler::EventId event) { // since we have a 'ptr' argument, the instance cannot be deleted // before this method returns @@ -49,11 +49,11 @@ satcom::lib::ReadHelper::dispatchProcess(ptr helper, Handle handle, } template -prefix_ void satcom::lib::ReadHelper::process(Handle handle, - satcom::lib::Scheduler::EventId event) +prefix_ void senf::ReadHelper::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); @@ -67,14 +67,14 @@ prefix_ void satcom::lib::ReadHelper::process(Handle handle, done(); } } - catch (satcom::lib::SystemException const & ex) { + catch (senf::SystemException const & ex) { errno_ = ex.err; done(); } } template -prefix_ void satcom::lib::ReadHelper::done() +prefix_ void senf::ReadHelper::done() { revoke(); callback_(ptr(this)); @@ -83,7 +83,7 @@ prefix_ void satcom::lib::ReadHelper::done() template template prefix_ std::string::size_type -satcom::lib::ReadHelper::InternalPredicate::Dispatcher:: +senf::ReadHelper::InternalPredicate::Dispatcher:: operator()(std::string const & data) { return predicate(data); diff --git a/Scheduler/ReadHelper.cti b/Scheduler/ReadHelper.cti index 75613d2..2e9a533 100644 --- a/Scheduler/ReadHelper.cti +++ b/Scheduler/ReadHelper.cti @@ -13,8 +13,8 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ typename satcom::lib::ReadHelper::ptr -satcom::lib::ReadHelper::dispatch(Handle handle, std::string::size_type maxSize, +prefix_ typename senf::ReadHelper::ptr +senf::ReadHelper::dispatch(Handle handle, std::string::size_type maxSize, Callback callback) { return ptr(new ReadHelper(handle, maxSize, 0, callback)); @@ -22,8 +22,8 @@ satcom::lib::ReadHelper::dispatch(Handle handle, std::string::size_type template template -prefix_ typename satcom::lib::ReadHelper::ptr -satcom::lib::ReadHelper::dispatch(Handle handle, std::string::size_type maxSize, +prefix_ typename senf::ReadHelper::ptr +senf::ReadHelper::dispatch(Handle handle, std::string::size_type maxSize, Predicate predicate, Callback callback) { return ptr(new ReadHelper(handle, maxSize, @@ -32,49 +32,49 @@ satcom::lib::ReadHelper::dispatch(Handle handle, std::string::size_type } template -prefix_ Handle satcom::lib::ReadHelper::handle() +prefix_ Handle senf::ReadHelper::handle() const { return handle_; } template -prefix_ unsigned satcom::lib::ReadHelper::maxSize() +prefix_ unsigned senf::ReadHelper::maxSize() const { return maxSize_; } template -prefix_ std::string const & satcom::lib::ReadHelper::data() +prefix_ std::string const & senf::ReadHelper::data() const { return data_; } template -prefix_ std::string const & satcom::lib::ReadHelper::tail() +prefix_ std::string const & senf::ReadHelper::tail() const { return tail_; } template -prefix_ bool satcom::lib::ReadHelper::complete() +prefix_ bool senf::ReadHelper::complete() const { return complete_; } template -prefix_ bool satcom::lib::ReadHelper::error() +prefix_ bool senf::ReadHelper::error() const { return errno_ != 0; } template -prefix_ void satcom::lib::ReadHelper::throw_error() +prefix_ void senf::ReadHelper::throw_error() const { if (errno_ != 0) throw SystemException(errno_); diff --git a/Scheduler/ReadHelper.hh b/Scheduler/ReadHelper.hh index 8f38b16..8fb80bf 100644 --- a/Scheduler/ReadHelper.hh +++ b/Scheduler/ReadHelper.hh @@ -19,12 +19,12 @@ //#include "ReadHelper.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + template class ReadHelper - : public satcom::lib::intrusive_refcount + : public senf::intrusive_refcount { public: /////////////////////////////////////////////////////////////////////////// @@ -66,8 +66,8 @@ namespace lib { 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_; @@ -88,7 +88,7 @@ namespace lib { std::string target; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "ReadHelper.cci" diff --git a/Scheduler/ReadHelper.ih b/Scheduler/ReadHelper.ih index e174b5f..bca58bc 100644 --- a/Scheduler/ReadHelper.ih +++ b/Scheduler/ReadHelper.ih @@ -9,8 +9,8 @@ ///////////////////////////////ih.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + template struct ReadHelper::InternalPredicate @@ -28,7 +28,7 @@ namespace lib { virtual std::string::size_type operator()(std::string const & data) = 0; }; -}} +} ///////////////////////////////ih.e//////////////////////////////////////// diff --git a/Scheduler/Scheduler.cc b/Scheduler/Scheduler.cc index 75ed7f8..62a5dfe 100644 --- a/Scheduler/Scheduler.cc +++ b/Scheduler/Scheduler.cc @@ -78,25 +78,25 @@ static const int EPollInitialSize = 16; #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); @@ -120,7 +120,7 @@ prefix_ void satcom::lib::Scheduler::do_add(int fd, SimpleCallback const & cb, i 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()) @@ -148,7 +148,7 @@ prefix_ void satcom::lib::Scheduler::do_remove(int fd, int eventMask) } -prefix_ int satcom::lib::Scheduler::EventSpec::epollMask() +prefix_ int senf::Scheduler::EventSpec::epollMask() const { int mask (0); @@ -160,7 +160,7 @@ prefix_ int satcom::lib::Scheduler::EventSpec::epollMask() return mask; } -prefix_ void satcom::lib::Scheduler::process() +prefix_ void senf::Scheduler::process() { terminate_ = false; while (! terminate_) { @@ -226,5 +226,5 @@ prefix_ void satcom::lib::Scheduler::process() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Scheduler/Scheduler.cci b/Scheduler/Scheduler.cci index d332654..f752d3e 100644 --- a/Scheduler/Scheduler.cci +++ b/Scheduler/Scheduler.cci @@ -29,12 +29,12 @@ #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; } @@ -45,5 +45,5 @@ prefix_ int satcom::lib::retrieve_filehandle(int fd) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Scheduler/Scheduler.ct b/Scheduler/Scheduler.ct index 05afa48..1df75e3 100644 --- a/Scheduler/Scheduler.ct +++ b/Scheduler/Scheduler.ct @@ -35,5 +35,5 @@ // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Scheduler/Scheduler.cti b/Scheduler/Scheduler.cti index 0bd2d7f..62bfe38 100644 --- a/Scheduler/Scheduler.cti +++ b/Scheduler/Scheduler.cti @@ -31,7 +31,7 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ void satcom::lib::Scheduler::add(Handle const & handle, +prefix_ void senf::Scheduler::add(Handle const & handle, typename GenericCallback::Callback const & cb, int eventMask) { @@ -42,7 +42,7 @@ prefix_ void satcom::lib::Scheduler::add(Handle const & handle, } template -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); @@ -54,5 +54,5 @@ prefix_ void satcom::lib::Scheduler::remove(Handle const & handle, int eventMask // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Scheduler/Scheduler.hh b/Scheduler/Scheduler.hh index 785dce9..cdcd4f6 100644 --- a/Scheduler/Scheduler.hh +++ b/Scheduler/Scheduler.hh @@ -42,8 +42,8 @@ //#include "scheduler.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + /** \brief Singleton class to manage the event loop @@ -142,7 +142,7 @@ namespace lib { int retrieve_filehandle(int fd); -}} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "Scheduler.cci" @@ -153,5 +153,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Scheduler/Scheduler.test.cc b/Scheduler/Scheduler.test.cc index 6845277..6665f6e 100644 --- a/Scheduler/Scheduler.test.cc +++ b/Scheduler/Scheduler.test.cc @@ -44,7 +44,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::lib; +using namespace senf; namespace { @@ -264,5 +264,5 @@ BOOST_AUTO_UNIT_TEST(scheduler) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Scheduler/WriteHelper.ct b/Scheduler/WriteHelper.ct index 8ef626d..04a4f1c 100644 --- a/Scheduler/WriteHelper.ct +++ b/Scheduler/WriteHelper.ct @@ -15,18 +15,18 @@ ///////////////////////////////ct.p//////////////////////////////////////// template -prefix_ satcom::lib::WriteHelper::WriteHelper(Handle handle, std::string data, +prefix_ senf::WriteHelper::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 -prefix_ std::string const & satcom::lib::WriteHelper::data() +prefix_ std::string const & senf::WriteHelper::data() const { if (offset_ > 0) { @@ -37,17 +37,17 @@ prefix_ std::string const & satcom::lib::WriteHelper::data() } template -prefix_ void satcom::lib::WriteHelper::revoke() +prefix_ void senf::WriteHelper::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 prefix_ void -satcom::lib::WriteHelper::dispatchProcess(ptr helper, Handle handle, - satcom::lib::Scheduler::EventId event) +senf::WriteHelper::dispatchProcess(ptr helper, Handle handle, + senf::Scheduler::EventId event) { // since we have a 'ptr' argument, the instance cannot be deleted // before this method returns @@ -55,26 +55,26 @@ satcom::lib::WriteHelper::dispatchProcess(ptr helper, Handle handle, } template -prefix_ void satcom::lib::WriteHelper::process(Handle handle, - satcom::lib::Scheduler::EventId event) +prefix_ void senf::WriteHelper::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 -prefix_ void satcom::lib::WriteHelper::done() +prefix_ void senf::WriteHelper::done() { revoke(); callback_(ptr(this)); diff --git a/Scheduler/WriteHelper.cti b/Scheduler/WriteHelper.cti index e73fd19..14437e9 100644 --- a/Scheduler/WriteHelper.cti +++ b/Scheduler/WriteHelper.cti @@ -13,39 +13,39 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ typename satcom::lib::WriteHelper::ptr -satcom::lib::WriteHelper::dispatch(Handle handle, std::string data, Callback callback) +prefix_ typename senf::WriteHelper::ptr +senf::WriteHelper::dispatch(Handle handle, std::string data, Callback callback) { return ptr(new WriteHelper(handle, data, callback)); } template -prefix_ Handle satcom::lib::WriteHelper::handle() +prefix_ Handle senf::WriteHelper::handle() const { return handle_; } template -prefix_ bool satcom::lib::WriteHelper::complete() +prefix_ bool senf::WriteHelper::complete() const { return data_.empty(); } template -prefix_ bool satcom::lib::WriteHelper::error() +prefix_ bool senf::WriteHelper::error() const { return errno_ != 0; } template -prefix_ void satcom::lib::WriteHelper::throw_error() +prefix_ void senf::WriteHelper::throw_error() const { if (errno_ != 0) - throw satcom::lib::SystemException(errno_); + throw senf::SystemException(errno_); } diff --git a/Scheduler/WriteHelper.hh b/Scheduler/WriteHelper.hh index 02c3161..f22cbfe 100644 --- a/Scheduler/WriteHelper.hh +++ b/Scheduler/WriteHelper.hh @@ -15,12 +15,12 @@ //#include "WriteHelper.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + template class WriteHelper - : public satcom::lib::intrusive_refcount + : public senf::intrusive_refcount { public: /////////////////////////////////////////////////////////////////////////// @@ -53,8 +53,8 @@ namespace lib { 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_; @@ -66,7 +66,7 @@ namespace lib { }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "WriteHelper.cci" diff --git a/Sniffer/Sniffer.cc b/Sniffer/Sniffer.cc index e2a4997..530bcb5 100644 --- a/Sniffer/Sniffer.cc +++ b/Sniffer/Sniffer.cc @@ -81,22 +81,22 @@ namespace { void use_em() { // Pull in symbols from the wanted packets ... - satcom::pkf::Packet::create(0,0); - satcom::pkf::Packet::create(0,0); + senf::Packet::create(0,0); + senf::Packet::create(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( + senf::EthernetPacket::ptr packet ( + senf::Packet::create( data.begin(), data.end())); packet->dump(std::cout); hexdump(packet->last()->begin(), @@ -105,7 +105,7 @@ int main (int argc, char const * argv[]) } } catch (std::exception const & ex) { - std::cerr << satcom::lib::prettyName(typeid(ex)) << ": " << ex.what() << "\n"; + std::cerr << senf::prettyName(typeid(ex)) << ": " << ex.what() << "\n"; } } @@ -116,5 +116,5 @@ int main (int argc, char const * argv[]) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/AddressingPolicy.hh b/Socket/AddressingPolicy.hh index b13ac1d..238dfcb 100644 --- a/Socket/AddressingPolicy.hh +++ b/Socket/AddressingPolicy.hh @@ -29,13 +29,13 @@ //#include "AddressingPolicy.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + struct NoAddressingPolicy : public AddressingPolicyBase {}; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "AddressingPolicy.cci" @@ -47,5 +47,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/BSDSocketProtocol.cc b/Socket/BSDSocketProtocol.cc index f7df702..bb595ac 100644 --- a/Socket/BSDSocketProtocol.cc +++ b/Socket/BSDSocketProtocol.cc @@ -35,7 +35,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ std::pair satcom::lib::BSDSocketProtocol::linger() +prefix_ std::pair senf::BSDSocketProtocol::linger() const { struct linger ling; @@ -46,7 +46,7 @@ prefix_ std::pair satcom::lib::BSDSocketProtocol::linger() 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; @@ -56,7 +56,7 @@ prefix_ void satcom::lib::BSDSocketProtocol::linger(bool enable, unsigned timeou 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 @@ -69,7 +69,7 @@ prefix_ struct timeval satcom::lib::BSDSocketProtocol::timestamp() /////////////////////////////////////////////////////////////////////////// -prefix_ bool satcom::lib::AddressableBSDSocketProtocol::reuseaddr() +prefix_ bool senf::AddressableBSDSocketProtocol::reuseaddr() const { int value; @@ -79,7 +79,7 @@ prefix_ bool satcom::lib::AddressableBSDSocketProtocol::reuseaddr() return value; } -prefix_ void satcom::lib::AddressableBSDSocketProtocol::reuseaddr(bool value) +prefix_ void senf::AddressableBSDSocketProtocol::reuseaddr(bool value) const { int ivalue (value); @@ -94,5 +94,5 @@ prefix_ void satcom::lib::AddressableBSDSocketProtocol::reuseaddr(bool value) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/BSDSocketProtocol.hh b/Socket/BSDSocketProtocol.hh index 3d35599..39d19d8 100644 --- a/Socket/BSDSocketProtocol.hh +++ b/Socket/BSDSocketProtocol.hh @@ -30,8 +30,8 @@ //#include "BSDSocketProtocol.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + class BSDSocketProtocol : public virtual SocketProtocol @@ -51,7 +51,7 @@ namespace lib { void reuseaddr(bool value) const; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// @@ -64,5 +64,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/BufferingPolicy.cc b/Socket/BufferingPolicy.cc index e1c3171..8fdf27b 100644 --- a/Socket/BufferingPolicy.cc +++ b/Socket/BufferingPolicy.cc @@ -35,7 +35,7 @@ #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)); @@ -46,13 +46,13 @@ prefix_ unsigned satcom::lib::SocketBufferingPolicy::rcvbuf(FileHandle handle) 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)); @@ -64,7 +64,7 @@ prefix_ unsigned satcom::lib::SocketBufferingPolicy::sndbuf(FileHandle handle) } -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); @@ -77,5 +77,5 @@ prefix_ void satcom::lib::SocketBufferingPolicy::sndbuf(FileHandle handle, unsig // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/BufferingPolicy.hh b/Socket/BufferingPolicy.hh index 9dccd88..6eb705c 100644 --- a/Socket/BufferingPolicy.hh +++ b/Socket/BufferingPolicy.hh @@ -30,8 +30,8 @@ //#include "BufferingPolicy.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + // TODO: Should this be dependent on Read / WritePolicy ? struct SocketBufferingPolicy : public BufferingPolicyBase @@ -43,7 +43,7 @@ namespace lib { static void sndbuf(FileHandle handle, unsigned size); }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "BufferingPolicy.cci" @@ -55,5 +55,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ClientSocketHandle.ct b/Socket/ClientSocketHandle.ct index 50c80a8..acd736b 100644 --- a/Socket/ClientSocketHandle.ct +++ b/Socket/ClientSocketHandle.ct @@ -30,7 +30,7 @@ ///////////////////////////////ct.p//////////////////////////////////////// template -prefix_ std::string satcom::lib::ClientSocketHandle::read(unsigned limit) +prefix_ std::string senf::ClientSocketHandle::read(unsigned limit) { std::string rv; this->read(rv,limit); @@ -38,7 +38,7 @@ prefix_ std::string satcom::lib::ClientSocketHandle::read(unsigned limit } template -prefix_ void satcom::lib::ClientSocketHandle::read(std::string & buffer, unsigned limit) +prefix_ void senf::ClientSocketHandle::read(std::string & buffer, unsigned limit) { unsigned nread = available(); if (limit>0 && nread>limit) @@ -52,7 +52,7 @@ prefix_ void satcom::lib::ClientSocketHandle::read(std::string & buffer, template prefix_ std::pair -satcom::lib::ClientSocketHandle::readfrom() +senf::ClientSocketHandle::readfrom() { std::string rv; typename Policy::AddressingPolicy::Address addr; @@ -61,7 +61,7 @@ satcom::lib::ClientSocketHandle::readfrom() } template -prefix_ void satcom::lib::ClientSocketHandle:: +prefix_ void senf::ClientSocketHandle:: readfrom(std::string & buffer, typename Policy::AddressingPolicy::Address & from) { unsigned nread = available(); @@ -73,7 +73,7 @@ readfrom(std::string & buffer, typename Policy::AddressingPolicy::Address & from } template -prefix_ unsigned satcom::lib::ClientSocketHandle::write(std::string const & data) +prefix_ unsigned senf::ClientSocketHandle::write(std::string const & data) { unsigned written = this->write(data.data(),data.size()); if (written == 0) @@ -94,7 +94,7 @@ prefix_ unsigned satcom::lib::ClientSocketHandle::write(std::string cons } template -prefix_ unsigned satcom::lib::ClientSocketHandle::available() +prefix_ unsigned senf::ClientSocketHandle::available() { unsigned nread = this->protocol().available(); if (nread == 0 && this->blocking()) { @@ -110,5 +110,5 @@ prefix_ unsigned satcom::lib::ClientSocketHandle::available() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ClientSocketHandle.cti b/Socket/ClientSocketHandle.cti index eec7cf7..c6a9348 100644 --- a/Socket/ClientSocketHandle.cti +++ b/Socket/ClientSocketHandle.cti @@ -32,20 +32,20 @@ template template -prefix_ satcom::lib::ClientSocketHandle:: +prefix_ senf::ClientSocketHandle:: ClientSocketHandle(ClientSocketHandle other, typename SocketHandle::template IsCompatible::type *) : SocketHandle(other,true) {} template -prefix_ satcom::lib::ClientSocketHandle::ClientSocketHandle(FileHandle other, +prefix_ senf::ClientSocketHandle::ClientSocketHandle(FileHandle other, bool isChecked) : SocketHandle(other, isChecked) {} template -prefix_ satcom::lib::ClientSocketHandle:: +prefix_ senf::ClientSocketHandle:: ClientSocketHandle(std::auto_ptr protocol, int fd) : SocketHandle(protocol,false) { @@ -54,8 +54,8 @@ ClientSocketHandle(std::auto_ptr protocol, int fd) template template -prefix_ typename satcom::lib::SocketHandle::template IsCompatible::type const & -satcom::lib::ClientSocketHandle::operator=(ClientSocketHandle other) +prefix_ typename senf::SocketHandle::template IsCompatible::type const & +senf::ClientSocketHandle::operator=(ClientSocketHandle other) { assign(other); return *this; @@ -67,28 +67,28 @@ satcom::lib::ClientSocketHandle::operator=(ClientSocketHandle -prefix_ unsigned satcom::lib::ClientSocketHandle::read(char * buffer, +prefix_ unsigned senf::ClientSocketHandle::read(char * buffer, unsigned size) { return Policy::ReadPolicy::read(*this, buffer, size); } template -prefix_ unsigned satcom::lib::ClientSocketHandle:: +prefix_ unsigned senf::ClientSocketHandle:: readfrom(char * buffer, unsigned size, typename Policy::AddressingPolicy::Address & from) { return Policy::ReadPolicy::readfrom(*this, buffer, size, from); } template -prefix_ unsigned satcom::lib::ClientSocketHandle::write(char const * buffer, +prefix_ unsigned senf::ClientSocketHandle::write(char const * buffer, unsigned size) { return Policy::WritePolicy::write(*this, buffer, size); } template -prefix_ unsigned satcom::lib::ClientSocketHandle:: +prefix_ unsigned senf::ClientSocketHandle:: writeto(typename boost::call_traits::param_type addr, std::string const & data) { @@ -96,7 +96,7 @@ writeto(typename boost::call_traits: } template -prefix_ unsigned satcom::lib::ClientSocketHandle:: +prefix_ unsigned senf::ClientSocketHandle:: writeto(typename boost::call_traits::param_type addr, char const * buffer, unsigned size) { @@ -108,7 +108,7 @@ writeto(typename boost::call_traits: template prefix_ typename Policy::AddressingPolicy::Address -satcom::lib::ClientSocketHandle::peer() +senf::ClientSocketHandle::peer() { typename Policy::AddressingPolicy::Address addr; this->peer(addr); @@ -116,7 +116,7 @@ satcom::lib::ClientSocketHandle::peer() } template -prefix_ void satcom::lib::ClientSocketHandle:: +prefix_ void senf::ClientSocketHandle:: peer(typename Policy::AddressingPolicy::Address & addr) { Policy::AddressingPolicy::peer(*this,addr); @@ -124,7 +124,7 @@ peer(typename Policy::AddressingPolicy::Address & addr) template prefix_ typename Policy::AddressingPolicy::Address -satcom::lib::ClientSocketHandle::local() +senf::ClientSocketHandle::local() { typename Policy::AddressingPolicy::Address addr; this->local(addr); @@ -132,20 +132,20 @@ satcom::lib::ClientSocketHandle::local() } template -prefix_ void satcom::lib::ClientSocketHandle:: +prefix_ void senf::ClientSocketHandle:: local(typename Policy::AddressingPolicy::Address & addr) { Policy::AddressingPolicy::local(*this,addr); } template -prefix_ void satcom::lib::ClientSocketHandle::connect(AddressParam addr) +prefix_ void senf::ClientSocketHandle::connect(AddressParam addr) { Policy::AddressingPolicy::connect(*this,addr); } template -prefix_ void satcom::lib::ClientSocketHandle:: +prefix_ void senf::ClientSocketHandle:: bind(typename boost::call_traits::param_type addr) { Policy::AddressingPolicy::bind(*this,addr); @@ -155,25 +155,25 @@ bind(typename boost::call_traits::pa // Buffering template -prefix_ unsigned satcom::lib::ClientSocketHandle::rcvbuf() +prefix_ unsigned senf::ClientSocketHandle::rcvbuf() { return Policy::BufferingPolicy::rcvbuf(*this); } template -prefix_ void satcom::lib::ClientSocketHandle::rcvbuf(unsigned size) +prefix_ void senf::ClientSocketHandle::rcvbuf(unsigned size) { Policy::BufferingPolicy::rcvbuf(*this,size); } template -prefix_ unsigned satcom::lib::ClientSocketHandle::sndbuf() +prefix_ unsigned senf::ClientSocketHandle::sndbuf() { return Policy::BufferingPolicy::sndbuf(*this); } template -prefix_ void satcom::lib::ClientSocketHandle::sndbuf(unsigned size) +prefix_ void senf::ClientSocketHandle::sndbuf(unsigned size) { Policy::BufferingPolicy::sndbuf(*this,size); } @@ -181,15 +181,15 @@ prefix_ void satcom::lib::ClientSocketHandle::sndbuf(unsigned size) /////////////////////////////////////////////////////////////////////////// template -prefix_ satcom::lib::ClientSocketHandle -satcom::lib::ClientSocketHandle::cast_static(FileHandle handle) +prefix_ senf::ClientSocketHandle +senf::ClientSocketHandle::cast_static(FileHandle handle) { return ClientSocketHandle(handle, true); } template -prefix_ satcom::lib::ClientSocketHandle -satcom::lib::ClientSocketHandle::cast_dynamic(FileHandle handle) +prefix_ senf::ClientSocketHandle +senf::ClientSocketHandle::cast_dynamic(FileHandle handle) { SocketHandle h (SocketHandle::cast_dynamic(handle)); if (static_cast(FileHandle::body(h)).isServer()) @@ -198,14 +198,14 @@ satcom::lib::ClientSocketHandle::cast_dynamic(FileHandle handle) } template -prefix_ void satcom::lib::ClientSocketHandle::state(SocketStateMap & map, unsigned lod) +prefix_ void senf::ClientSocketHandle::state(SocketStateMap & map, unsigned lod) { map["handle"] = prettyName(typeid(*this)); this->body().state(map,lod); } template -prefix_ std::string satcom::lib::ClientSocketHandle::dumpState(unsigned lod) +prefix_ std::string senf::ClientSocketHandle::dumpState(unsigned lod) { SocketStateMap map; state(map,lod); @@ -218,5 +218,5 @@ prefix_ std::string satcom::lib::ClientSocketHandle::dumpState(unsigned // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ClientSocketHandle.hh b/Socket/ClientSocketHandle.hh index 4f9b986..a4280e8 100644 --- a/Socket/ClientSocketHandle.hh +++ b/Socket/ClientSocketHandle.hh @@ -33,8 +33,8 @@ //#include "ClientSocketHandle.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + template class ServerSocketHandle; @@ -138,10 +138,10 @@ namespace lib { private: unsigned available(); - friend class satcom::lib::ServerSocketHandle; + friend class senf::ServerSocketHandle; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "ClientSocketHandle.cci" @@ -152,5 +152,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ClientSocketHandle.test.cc b/Socket/ClientSocketHandle.test.cc index e82c57d..ab07335 100644 --- a/Socket/ClientSocketHandle.test.cc +++ b/Socket/ClientSocketHandle.test.cc @@ -39,7 +39,7 @@ namespace { - namespace sl = satcom::lib; + namespace sl = senf; class MySocketHandle : public sl::ClientSocketHandle @@ -113,7 +113,7 @@ BOOST_AUTO_UNIT_TEST(clientSocketHandle) } 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 ) ); @@ -135,5 +135,5 @@ BOOST_AUTO_UNIT_TEST(clientSocketHandle) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/CommunicationPolicy.cc b/Socket/CommunicationPolicy.cc index bc2fa33..816da3a 100644 --- a/Socket/CommunicationPolicy.cc +++ b/Socket/CommunicationPolicy.cc @@ -36,13 +36,13 @@ #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) { @@ -69,5 +69,5 @@ prefix_ int satcom::lib::ConnectedCommunicationPolicy::do_accept(FileHandle hand // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/CommunicationPolicy.cti b/Socket/CommunicationPolicy.cti index f3be50d..98711da 100644 --- a/Socket/CommunicationPolicy.cti +++ b/Socket/CommunicationPolicy.cti @@ -30,7 +30,7 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ int satcom::lib::ConnectedCommunicationPolicy:: +prefix_ int senf::ConnectedCommunicationPolicy:: accept(ServerSocketHandle handle, typename ServerSocketHandle::Address & address, typename IfAddressingPolicyIsNot::type *) @@ -44,5 +44,5 @@ accept(ServerSocketHandle handle, // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/CommunicationPolicy.hh b/Socket/CommunicationPolicy.hh index e5ad207..4d8cdce 100644 --- a/Socket/CommunicationPolicy.hh +++ b/Socket/CommunicationPolicy.hh @@ -33,8 +33,8 @@ struct sockaddr; -namespace satcom { -namespace lib { +namespace senf { + template class ServerSocketHandle; @@ -52,7 +52,7 @@ namespace lib { struct UnconnectedCommunicationPolicy : public CommunicationPolicyBase {}; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// @@ -64,5 +64,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/FileHandle.cc b/Socket/FileHandle.cc index 4865ae6..687bde7 100644 --- a/Socket/FileHandle.cc +++ b/Socket/FileHandle.cc @@ -36,30 +36,30 @@ #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); @@ -67,7 +67,7 @@ prefix_ bool satcom::lib::FileBody::blocking() 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); @@ -76,7 +76,7 @@ prefix_ void satcom::lib::FileBody::blocking(bool status) 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; @@ -103,5 +103,5 @@ prefix_ bool satcom::lib::FileBody::pollCheck(int fd, bool incoming, bool block) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/FileHandle.cci b/Socket/FileHandle.cci index bb366ba..f69d3e0 100644 --- a/Socket/FileHandle.cci +++ b/Socket/FileHandle.cci @@ -32,13 +32,13 @@ ///////////////////////////////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 { @@ -49,7 +49,7 @@ prefix_ satcom::lib::FileBody::~FileBody() } } -prefix_ void satcom::lib::FileBody::close() +prefix_ void senf::FileBody::close() { if (!valid()) throw SystemException(EBADF); @@ -57,7 +57,7 @@ prefix_ void satcom::lib::FileBody::close() fd_ = -1; } -prefix_ void satcom::lib::FileBody::terminate() +prefix_ void senf::FileBody::terminate() { if (valid()) { v_terminate(); @@ -65,169 +65,169 @@ prefix_ void satcom::lib::FileBody::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 body) +prefix_ senf::FileHandle::FileHandle(std::auto_ptr 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(); } @@ -238,5 +238,5 @@ prefix_ int satcom::lib::retrieve_filehandle(FileHandle handle) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/FileHandle.hh b/Socket/FileHandle.hh index 3bbbb9b..963689d 100644 --- a/Socket/FileHandle.hh +++ b/Socket/FileHandle.hh @@ -40,8 +40,8 @@ ///////////////////////////////hh.p//////////////////////////////////////// #include "FileHandle.ih" -namespace satcom { -namespace lib { +namespace senf { + /** \brief */ @@ -103,7 +103,7 @@ namespace lib { int retrieve_filehandle(FileHandle handle); -}} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "FileHandle.cci" @@ -114,5 +114,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/FileHandle.ih b/Socket/FileHandle.ih index 8e59737..9ca832d 100644 --- a/Socket/FileHandle.ih +++ b/Socket/FileHandle.ih @@ -29,13 +29,13 @@ ///////////////////////////////ih.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + /** \brief */ class FileBody - : public satcom::lib::intrusive_refcount + : public senf::intrusive_refcount { public: /////////////////////////////////////////////////////////////////////////// @@ -91,7 +91,7 @@ namespace lib { int fd_; }; -}} +} ///////////////////////////////ih.e//////////////////////////////////////// #endif @@ -99,5 +99,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/FileHandle.test.cc b/Socket/FileHandle.test.cc index c86a26b..dd22435 100644 --- a/Socket/FileHandle.test.cc +++ b/Socket/FileHandle.test.cc @@ -38,19 +38,19 @@ ///////////////////////////////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( - new satcom::lib::FileBody(fd))) {} + : senf::FileHandle(std::auto_ptr( + new senf::FileBody(fd))) {} FHandle(std::string name) - : satcom::lib::FileHandle(std::auto_ptr( - new satcom::lib::FileBody())) + : senf::FileHandle(std::auto_ptr( + 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); } }; @@ -71,7 +71,7 @@ BOOST_AUTO_UNIT_TEST(fileHandle) 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()); } @@ -111,5 +111,5 @@ BOOST_AUTO_UNIT_TEST(fileHandle) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/FramingPolicy.hh b/Socket/FramingPolicy.hh index 96a4b98..97a440c 100644 --- a/Socket/FramingPolicy.hh +++ b/Socket/FramingPolicy.hh @@ -29,8 +29,8 @@ //#include "FramingPolicy.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + struct StreamFramingPolicy : public FramingPolicyBase {}; @@ -38,7 +38,7 @@ namespace lib { struct DatagramFramingPolicy : public FramingPolicyBase {}; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "FramingPolicy.cci" @@ -49,5 +49,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/GenericAddressingPolicy.cc b/Socket/GenericAddressingPolicy.cc index abb99f5..a59d174 100644 --- a/Socket/GenericAddressingPolicy.cc +++ b/Socket/GenericAddressingPolicy.cc @@ -34,7 +34,7 @@ #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) { @@ -42,7 +42,7 @@ prefix_ void satcom::lib::GenericAddressingPolicy_Base::do_local(FileHandle hand 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) { @@ -50,7 +50,7 @@ prefix_ void satcom::lib::GenericAddressingPolicy_Base::do_peer(FileHandle handl 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) { @@ -58,7 +58,7 @@ prefix_ void satcom::lib::GenericAddressingPolicy_Base::do_bind(FileHandle handl 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) { @@ -92,5 +92,5 @@ prefix_ void satcom::lib::GenericAddressingPolicy_Base::do_connect(FileHandle ha // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/GenericAddressingPolicy.cti b/Socket/GenericAddressingPolicy.cti index cb0d400..33e6120 100644 --- a/Socket/GenericAddressingPolicy.cti +++ b/Socket/GenericAddressingPolicy.cti @@ -30,11 +30,11 @@ ///////////////////////////////cti.p/////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -// satcom::lib::GenericAddressingPolicy
+// senf::GenericAddressingPolicy
template template -prefix_ void satcom::lib::GenericAddressingPolicy
:: +prefix_ void senf::GenericAddressingPolicy
:: peer(SocketHandle handle, Address & addr, typename IfCommunicationPolicyIs::type *) { @@ -44,7 +44,7 @@ peer(SocketHandle handle, Address & addr, template template -prefix_ void satcom::lib::GenericAddressingPolicy
:: +prefix_ void senf::GenericAddressingPolicy
:: connect(SocketHandle handle, Address const & addr, typename IfCommunicationPolicyIs::type *) { @@ -52,7 +52,7 @@ connect(SocketHandle handle, Address const & addr, } template -prefix_ void satcom::lib::GenericAddressingPolicy
::local(FileHandle handle, +prefix_ void senf::GenericAddressingPolicy
::local(FileHandle handle, Address & addr) { addr.clear(); @@ -60,7 +60,7 @@ prefix_ void satcom::lib::GenericAddressingPolicy
::local(FileHandle han } template -prefix_ void satcom::lib::GenericAddressingPolicy
::bind(FileHandle handle, +prefix_ void senf::GenericAddressingPolicy
::bind(FileHandle handle, Address const & addr) { do_bind(handle,addr.sockaddr_p(),addr.sockaddr_len()); @@ -72,5 +72,5 @@ prefix_ void satcom::lib::GenericAddressingPolicy
::bind(FileHandle hand // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/GenericAddressingPolicy.hh b/Socket/GenericAddressingPolicy.hh index da55c11..fa7f5d1 100644 --- a/Socket/GenericAddressingPolicy.hh +++ b/Socket/GenericAddressingPolicy.hh @@ -32,8 +32,8 @@ //#include "GenericAddressingPolicy.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + struct GenericAddressingPolicy_Base { @@ -58,7 +58,7 @@ namespace lib { static void bind(FileHandle handle, Address const & addr); }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "GenericAddressingPolicy.cci" @@ -70,5 +70,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/GenericSockAddr.cci b/Socket/GenericSockAddr.cci index 7ab4372..81907cc 100644 --- a/Socket/GenericSockAddr.cci +++ b/Socket/GenericSockAddr.cci @@ -9,21 +9,21 @@ #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(&addr_); } -prefix_ struct sockaddr const * satcom::lib::GenericSockAddr::sockaddr_p() +prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p() const { return reinterpret_cast(&addr_); } -prefix_ unsigned satcom::lib::GenericSockAddr::sockaddr_len() +prefix_ unsigned senf::GenericSockAddr::sockaddr_len() const { return sizeof(addr_); diff --git a/Socket/GenericSockAddr.hh b/Socket/GenericSockAddr.hh index c05d158..7e1b437 100644 --- a/Socket/GenericSockAddr.hh +++ b/Socket/GenericSockAddr.hh @@ -11,8 +11,8 @@ //#include "GenericSockAddr.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + class GenericSockAddr { @@ -27,7 +27,7 @@ namespace lib { struct ::sockaddr_storage addr_; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "GenericSockAddr.cci" diff --git a/Socket/INetAddressing.cc b/Socket/INetAddressing.cc index 013704d..404f865 100644 --- a/Socket/INetAddressing.cc +++ b/Socket/INetAddressing.cc @@ -35,7 +35,7 @@ #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 @@ -44,7 +44,7 @@ prefix_ satcom::lib::INet4Address::INet4Address(std::string host, unsigned port) addr_.sin_port = htons(port); } -prefix_ std::string satcom::lib::INet4Address::str() +prefix_ std::string senf::INet4Address::str() const { std::stringstream s; @@ -52,13 +52,13 @@ prefix_ std::string satcom::lib::INet4Address::str() 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 @@ -83,5 +83,5 @@ prefix_ void satcom::lib::INet4Address::assignString(std::string address) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/INetAddressing.cci b/Socket/INetAddressing.cci index a04def2..7089881 100644 --- a/Socket/INetAddressing.cci +++ b/Socket/INetAddressing.cci @@ -28,59 +28,59 @@ #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(&addr_); } -prefix_ struct sockaddr const * satcom::lib::INet4Address::sockaddr_p() +prefix_ struct sockaddr const * senf::INet4Address::sockaddr_p() const { return reinterpret_cast(&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; @@ -92,5 +92,5 @@ prefix_ std::ostream & satcom::lib::operator<<(std::ostream & os, INet4Address c // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/INetAddressing.hh b/Socket/INetAddressing.hh index 28a8a59..60a71a2 100644 --- a/Socket/INetAddressing.hh +++ b/Socket/INetAddressing.hh @@ -35,8 +35,8 @@ //#include "INetAddressing.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + // TODO: Implement real INet4Address datatype and // rename this one to INet4SockAddress ... @@ -98,7 +98,7 @@ namespace lib { struct InvalidINetAddressException : public std::exception { char const * what() const throw() { return "invalid inet address"; } }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "INetAddressing.cci" @@ -110,5 +110,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/INetAddressing.test.cc b/Socket/INetAddressing.test.cc index dea7b88..04b6600 100644 --- a/Socket/INetAddressing.test.cc +++ b/Socket/INetAddressing.test.cc @@ -36,8 +36,8 @@ BOOST_AUTO_UNIT_TEST(inet4Address) { - using satcom::lib::INet4Address; - using satcom::lib::InvalidINetAddressException; + using senf::INet4Address; + using senf::InvalidINetAddressException; { INet4Address addr; @@ -85,5 +85,5 @@ BOOST_AUTO_UNIT_TEST(inet6Address) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/INetProtocol.cc b/Socket/INetProtocol.cc index b66e15d..4fb2ff0 100644 --- a/Socket/INetProtocol.cc +++ b/Socket/INetProtocol.cc @@ -36,23 +36,23 @@ ///////////////////////////////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; @@ -62,7 +62,7 @@ prefix_ bool satcom::lib::IPv4Protocol::mcLoop() return value; } -prefix_ void satcom::lib::IPv4Protocol::mcLoop(bool value) +prefix_ void senf::IPv4Protocol::mcLoop(bool value) const { int ivalue (value); @@ -70,7 +70,7 @@ prefix_ void satcom::lib::IPv4Protocol::mcLoop(bool 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; @@ -81,7 +81,7 @@ prefix_ void satcom::lib::IPv4Protocol::mcAddMembership(INet4Address const & mcA throw SystemException(errno); } -prefix_ void satcom::lib::IPv4Protocol::mcAddMembership(INet4Address const & mcAddr, +prefix_ void senf::IPv4Protocol::mcAddMembership(INet4Address const & mcAddr, INet4Address const & localAddr) const { @@ -93,7 +93,7 @@ prefix_ void satcom::lib::IPv4Protocol::mcAddMembership(INet4Address const & mcA 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; @@ -104,7 +104,7 @@ prefix_ void satcom::lib::IPv4Protocol::mcDropMembership(INet4Address const & mc throw SystemException(errno); } -prefix_ void satcom::lib::IPv4Protocol::mcDropMembership(INet4Address const & mcAddr, +prefix_ void senf::IPv4Protocol::mcDropMembership(INet4Address const & mcAddr, INet4Address const & localAddr) const { @@ -116,7 +116,7 @@ prefix_ void satcom::lib::IPv4Protocol::mcDropMembership(INet4Address const & mc 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; @@ -130,7 +130,7 @@ prefix_ void satcom::lib::IPv4Protocol::mcIface(std::string iface) throw SystemException(errno); } -prefix_ unsigned satcom::lib::IPv4Protocol::mcTTL() +prefix_ unsigned senf::IPv4Protocol::mcTTL() const { int value; @@ -140,7 +140,7 @@ prefix_ unsigned satcom::lib::IPv4Protocol::mcTTL() 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) @@ -155,5 +155,5 @@ prefix_ void satcom::lib::IPv4Protocol::mcTTL(unsigned value) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/INetProtocol.hh b/Socket/INetProtocol.hh index a5a3cd6..5c6bc7a 100644 --- a/Socket/INetProtocol.hh +++ b/Socket/INetProtocol.hh @@ -38,8 +38,8 @@ //#include "INetProtocol.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + class IPv4Protocol : public virtual SocketProtocol @@ -74,7 +74,7 @@ namespace lib { : public virtual SocketProtocol {}; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "INetProtocol.cci" @@ -85,5 +85,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/LLAddressing.cc b/Socket/LLAddressing.cc index 6ef9508..262500d 100644 --- a/Socket/LLAddressing.cc +++ b/Socket/LLAddressing.cc @@ -38,7 +38,7 @@ #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'; @@ -49,7 +49,7 @@ prefix_ unsigned char satcom::lib::detail::hexnibble(char c) throw InvalidLLSocketAddressException(); } -prefix_ std::string satcom::lib::LLSocketAddress::interface() +prefix_ std::string senf::LLSocketAddress::interface() const { if (addr_.sll_ifindex == 0) @@ -79,7 +79,7 @@ prefix_ std::string satcom::lib::LLSocketAddress::interface() /* -prefix_ void satcom::lib::LLSocketAddress::address(std::string address) +prefix_ void senf::LLSocketAddress::address(std::string address) { typedef boost::split_iterator StringSplitIterator; StringSplitIterator i = boost::make_split_iterator(address, boost::token_finder(boost::is_any_of("-: "))); @@ -94,7 +94,7 @@ prefix_ void satcom::lib::LLSocketAddress::address(std::string address) } */ -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()); @@ -104,8 +104,8 @@ prefix_ void satcom::lib::LLSocketAddress::interface(std::string interface) } -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("-: "))); @@ -124,5 +124,5 @@ satcom::lib::llAddress(std::string address) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/LLAddressing.cci b/Socket/LLAddressing.cci index 3de8a5e..f7dfdf9 100644 --- a/Socket/LLAddressing.cci +++ b/Socket/LLAddressing.cci @@ -29,37 +29,37 @@ #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 @@ -67,7 +67,7 @@ prefix_ unsigned satcom::lib::LLSocketAddress::arptype() 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 @@ -75,29 +75,29 @@ prefix_ unsigned satcom::lib::LLSocketAddress::pkttype() 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(&addr_); } -prefix_ struct sockaddr const * satcom::lib::LLSocketAddress::sockaddr_p() +prefix_ struct sockaddr const * senf::LLSocketAddress::sockaddr_p() const { return reinterpret_cast(&addr_); } -prefix_ unsigned satcom::lib::LLSocketAddress::sockaddr_len() +prefix_ unsigned senf::LLSocketAddress::sockaddr_len() const { return sizeof(addr_); @@ -109,5 +109,5 @@ prefix_ unsigned satcom::lib::LLSocketAddress::sockaddr_len() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/LLAddressing.ct b/Socket/LLAddressing.ct index cf38dd4..c9b2086 100644 --- a/Socket/LLAddressing.ct +++ b/Socket/LLAddressing.ct @@ -33,7 +33,7 @@ ///////////////////////////////ct.p//////////////////////////////////////// template -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(); @@ -48,7 +48,7 @@ prefix_ void satcom::lib::LLSocketAddress::address(ForwardRange const & address) template prefix_ std::string -satcom::lib::llAddress(ForwardRange const & address, +senf::llAddress(ForwardRange const & address, typename boost::enable_if< boost::is_class >::type *) { if (boost::empty(address)) @@ -66,7 +66,7 @@ satcom::lib::llAddress(ForwardRange const & address, } template -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) @@ -82,5 +82,5 @@ prefix_ unsigned char satcom::lib::detail::HexConverter::operator()(ForwardRange // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/LLAddressing.cti b/Socket/LLAddressing.cti index c1a5e68..e8ffd94 100644 --- a/Socket/LLAddressing.cti +++ b/Socket/LLAddressing.cti @@ -31,7 +31,7 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::lib::LLSocketAddress:: +prefix_ senf::LLSocketAddress:: LLSocketAddress(ForwardRange const & address, std::string interface, typename boost::enable_if_c::value >::type *) { @@ -46,5 +46,5 @@ LLSocketAddress(ForwardRange const & address, std::string interface, // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/LLAddressing.hh b/Socket/LLAddressing.hh index ce699be..e27ecff 100644 --- a/Socket/LLAddressing.hh +++ b/Socket/LLAddressing.hh @@ -39,8 +39,8 @@ #include "LLAddressing.ih" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + class LLSocketAddress { @@ -122,7 +122,7 @@ namespace lib { struct InvalidLLSocketAddressException : public std::exception { char const * what() const throw() { return "invalid ll address"; } }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "LLAddressing.cci" @@ -134,5 +134,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/LLAddressing.ih b/Socket/LLAddressing.ih index 57ec8b1..004b293 100644 --- a/Socket/LLAddressing.ih +++ b/Socket/LLAddressing.ih @@ -28,8 +28,8 @@ ///////////////////////////////ih.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + namespace detail { struct HexConverter { @@ -44,7 +44,7 @@ namespace detail { unsigned char hexnibble(char c); -}}} +}} ///////////////////////////////ih.e//////////////////////////////////////// #endif @@ -52,5 +52,5 @@ namespace detail { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/LLAddressing.test.cc b/Socket/LLAddressing.test.cc index cdbbe45..69e0ee1 100644 --- a/Socket/LLAddressing.test.cc +++ b/Socket/LLAddressing.test.cc @@ -37,7 +37,7 @@ BOOST_AUTO_UNIT_TEST(llAddress) { { - satcom::lib::LLSocketAddress a; + senf::LLSocketAddress a; BOOST_CHECK_EQUAL( a.protocol(), 0u ); BOOST_CHECK_EQUAL( a.interface(), "" ); @@ -45,8 +45,8 @@ BOOST_AUTO_UNIT_TEST(llAddress) 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); @@ -54,24 +54,24 @@ BOOST_AUTO_UNIT_TEST(llAddress) } { - 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()), "" ); } } @@ -81,5 +81,5 @@ BOOST_AUTO_UNIT_TEST(llAddress) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/PacketSocketHandle.cc b/Socket/PacketSocketHandle.cc index 4dc8791..59bbab0 100644 --- a/Socket/PacketSocketHandle.cc +++ b/Socket/PacketSocketHandle.cc @@ -38,7 +38,7 @@ #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; @@ -52,13 +52,13 @@ prefix_ void satcom::lib::PacketProtocol::init_client(SocketType type, int proto body().fd(sock); } -prefix_ std::auto_ptr satcom::lib::PacketProtocol::clone() +prefix_ std::auto_ptr senf::PacketProtocol::clone() const { return std::auto_ptr(new PacketProtocol()); } -prefix_ unsigned satcom::lib::PacketProtocol::available() +prefix_ unsigned senf::PacketProtocol::available() const { if (! body().readable()) @@ -69,13 +69,13 @@ prefix_ unsigned satcom::lib::PacketProtocol::available() 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 @@ -100,7 +100,7 @@ prefix_ void satcom::lib::PacketProtocol::promisc(std::string interface, Promisc 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 { @@ -123,5 +123,5 @@ prefix_ void satcom::lib::PacketProtocol::do_mc_i(std::string interface, // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/PacketSocketHandle.ct b/Socket/PacketSocketHandle.ct index 964ca76..bc2ac29 100644 --- a/Socket/PacketSocketHandle.ct +++ b/Socket/PacketSocketHandle.ct @@ -31,7 +31,7 @@ template prefix_ unsigned -satcom::lib::detail::Range_LLAddressCopier::operator()(unsigned char * target) +senf::detail::Range_LLAddressCopier::operator()(unsigned char * target) const { std::size_t len (0); @@ -49,5 +49,5 @@ satcom::lib::detail::Range_LLAddressCopier::operator()(unsigned ch // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/PacketSocketHandle.cti b/Socket/PacketSocketHandle.cti index a612e18..c162b8e 100644 --- a/Socket/PacketSocketHandle.cti +++ b/Socket/PacketSocketHandle.cti @@ -30,7 +30,7 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ void satcom::lib::PacketProtocol::mcAdd(std::string interface, +prefix_ void senf::PacketProtocol::mcAdd(std::string interface, ForwardRange const & address) const { @@ -38,7 +38,7 @@ prefix_ void satcom::lib::PacketProtocol::mcAdd(std::string interface, } template -prefix_ void satcom::lib::PacketProtocol::mcDrop(std::string interface, +prefix_ void senf::PacketProtocol::mcDrop(std::string interface, ForwardRange const & address) const { @@ -46,13 +46,13 @@ prefix_ void satcom::lib::PacketProtocol::mcDrop(std::string interface, } template -prefix_ satcom::lib::detail::Range_LLAddressCopier:: +prefix_ senf::detail::Range_LLAddressCopier:: Range_LLAddressCopier(ForwardRange const & range) : range_ (range) {} template -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 { @@ -66,5 +66,5 @@ prefix_ void satcom::lib::PacketProtocol::do_mc(std::string interface, // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/PacketSocketHandle.hh b/Socket/PacketSocketHandle.hh index 179d7aa..1ab5e67 100644 --- a/Socket/PacketSocketHandle.hh +++ b/Socket/PacketSocketHandle.hh @@ -38,8 +38,8 @@ #include "PacketSocketHandle.ih" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + typedef MakeSocketPolicy< LLAddressingPolicy, @@ -82,7 +82,7 @@ namespace lib { typedef ProtocolClientSocketHandle PacketSocketHandle; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "PacketSocketHandle.cci" @@ -94,5 +94,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/PacketSocketHandle.ih b/Socket/PacketSocketHandle.ih index cc121b0..9ae920e 100644 --- a/Socket/PacketSocketHandle.ih +++ b/Socket/PacketSocketHandle.ih @@ -27,8 +27,8 @@ ///////////////////////////////ih.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + namespace detail { struct LLAddressCopier @@ -48,7 +48,7 @@ namespace detail { ForwardRange const & range_; }; -}}} +}} ///////////////////////////////ih.e//////////////////////////////////////// #endif @@ -56,5 +56,5 @@ namespace detail { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/PacketSocketHandle.test.cc b/Socket/PacketSocketHandle.test.cc index 77ce526..4e8ca91 100644 --- a/Socket/PacketSocketHandle.test.cc +++ b/Socket/PacketSocketHandle.test.cc @@ -41,15 +41,15 @@ BOOST_AUTO_UNIT_TEST(packetSocketHandle) { // 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" ); @@ -58,17 +58,17 @@ BOOST_AUTO_UNIT_TEST(packetSocketHandle) // 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() ); @@ -81,5 +81,5 @@ BOOST_AUTO_UNIT_TEST(packetSocketHandle) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ProtocolClientSocketHandle.cti b/Socket/ProtocolClientSocketHandle.cti index 0f01b88..98d722a 100644 --- a/Socket/ProtocolClientSocketHandle.cti +++ b/Socket/ProtocolClientSocketHandle.cti @@ -30,9 +30,9 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::lib::ProtocolClientSocketHandle::ProtocolClientSocketHandle() +prefix_ senf::ProtocolClientSocketHandle::ProtocolClientSocketHandle() : ClientSocketHandle( - std::auto_ptr(new SocketProtocol())) + std::auto_ptr(new SocketProtocol())) { this->protocol().init_client(); } @@ -41,31 +41,31 @@ prefix_ satcom::lib::ProtocolClientSocketHandle::ProtocolClientS #include BOOST_PP_ITERATE() template -prefix_ satcom::lib::ProtocolClientSocketHandle:: +prefix_ senf::ProtocolClientSocketHandle:: ProtocolClientSocketHandle(FileHandle other, bool isChecked) : ClientSocketHandle(other, isChecked) {} template prefix_ SocketProtocol const & -satcom::lib::ProtocolClientSocketHandle::protocol() +senf::ProtocolClientSocketHandle::protocol() { BOOST_ASSERT( dynamic_cast(&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(this->body().protocol()); } template -prefix_ satcom::lib::ProtocolClientSocketHandle -satcom::lib::ProtocolClientSocketHandle::cast_static(FileHandle handle) +prefix_ senf::ProtocolClientSocketHandle +senf::ProtocolClientSocketHandle::cast_static(FileHandle handle) { return ProtocolClientSocketHandle(handle,true); } template -prefix_ satcom::lib::ProtocolClientSocketHandle -satcom::lib::ProtocolClientSocketHandle::cast_dynamic(FileHandle handle) +prefix_ senf::ProtocolClientSocketHandle +senf::ProtocolClientSocketHandle::cast_dynamic(FileHandle handle) { ClientSocketHandle h( ClientSocketHandle::cast_dynamic(handle)); @@ -76,7 +76,7 @@ satcom::lib::ProtocolClientSocketHandle::cast_dynamic(FileHandle template prefix_ void -satcom::lib::ProtocolClientSocketHandle::state(SocketStateMap & map, +senf::ProtocolClientSocketHandle::state(SocketStateMap & map, unsigned lod) { map["handle"] = prettyName(typeid(*this)); @@ -85,7 +85,7 @@ satcom::lib::ProtocolClientSocketHandle::state(SocketStateMap & template prefix_ std::string -satcom::lib::ProtocolClientSocketHandle::dumpState(unsigned lod) +senf::ProtocolClientSocketHandle::dumpState(unsigned lod) { SocketStateMap map; state(map,lod); @@ -98,5 +98,5 @@ satcom::lib::ProtocolClientSocketHandle::dumpState(unsigned lod) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ProtocolClientSocketHandle.hh b/Socket/ProtocolClientSocketHandle.hh index eeca1e7..cf23044 100644 --- a/Socket/ProtocolClientSocketHandle.hh +++ b/Socket/ProtocolClientSocketHandle.hh @@ -29,8 +29,8 @@ #include "ProtocolClientSocketHandle.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + template class ProtocolServerSocketHandle; @@ -73,7 +73,7 @@ namespace lib { friend class ProtocolServerSocketHandle; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "ProtocolClientSocketHandle.cci" @@ -85,5 +85,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ProtocolClientSocketHandle.mpp b/Socket/ProtocolClientSocketHandle.mpp index 2804682..df53979 100644 --- a/Socket/ProtocolClientSocketHandle.mpp +++ b/Socket/ProtocolClientSocketHandle.mpp @@ -45,7 +45,7 @@ ////// #if BOOST_PP_ITERATION_FLAGS()==1 /////////////////////////////////////////////////////////////////////////// -// satcom::lib::ProtocolClientSocketHandle:: +// senf::ProtocolClientSocketHandle:: // ProtocolClientSocketHandle (constructor) declaration template < mpp_PCSH_TemplateParameters() > @@ -54,15 +54,15 @@ ProtocolClientSocketHandle( mpp_PCSH_MethodParameters() ); ////// #elif BOOST_PP_ITERATION_FLAGS()==2 /////////////////////////////////////////////////////////////////////////// -// satcom::lib::ProtocolClientSocketHandle:: +// senf::ProtocolClientSocketHandle:: // ProtocolClientSocketHandle (constructor) implementation template template < mpp_PCSH_TemplateParameters() > -prefix_ satcom::lib::ProtocolClientSocketHandle:: +prefix_ senf::ProtocolClientSocketHandle:: ProtocolClientSocketHandle( mpp_PCSH_MethodParameters() ) : ClientSocketHandle( - std::auto_ptr(new SocketProtocol())) + std::auto_ptr(new SocketProtocol())) { this->protocol().init_client( mpp_PCSH_CallParameters() ); } @@ -89,5 +89,5 @@ ProtocolClientSocketHandle( mpp_PCSH_MethodParameters() ) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ProtocolClientSocketHandle.test.cc b/Socket/ProtocolClientSocketHandle.test.cc index be924ce..82c18f3 100644 --- a/Socket/ProtocolClientSocketHandle.test.cc +++ b/Socket/ProtocolClientSocketHandle.test.cc @@ -36,30 +36,30 @@ ///////////////////////////////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 MySocketHandle; + typedef senf::ProtocolClientSocketHandle 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 OtherSocketHandle; + typedef senf::SocketHandle OtherSocketHandle; MySocketHandle h; h.protocol(); OtherSocketHandle osh (h); - h = satcom::lib::static_socket_cast(osh); + h = senf::static_socket_cast(osh); } { @@ -73,5 +73,5 @@ BOOST_AUTO_UNIT_TEST(protocolClientSocketHandle) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ProtocolServerSocketHandle.cti b/Socket/ProtocolServerSocketHandle.cti index 76bb242..45be81f 100644 --- a/Socket/ProtocolServerSocketHandle.cti +++ b/Socket/ProtocolServerSocketHandle.cti @@ -31,9 +31,9 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::lib::ProtocolServerSocketHandle::ProtocolServerSocketHandle() +prefix_ senf::ProtocolServerSocketHandle::ProtocolServerSocketHandle() : ServerSocketHandle( - std::auto_ptr(new SocketProtocol())) + std::auto_ptr(new SocketProtocol())) {} #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 9, "Socket/ProtocolServerSocketHandle.mpp", 2)) @@ -41,32 +41,32 @@ prefix_ satcom::lib::ProtocolServerSocketHandle::ProtocolServerS template prefix_ SocketProtocol const & -satcom::lib::ProtocolServerSocketHandle::protocol() +senf::ProtocolServerSocketHandle::protocol() { BOOST_ASSERT( dynamic_cast(&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(this->body().protocol()); } template -prefix_ satcom::lib::ProtocolClientSocketHandle -satcom::lib::ProtocolServerSocketHandle::accept() +prefix_ senf::ProtocolClientSocketHandle +senf::ProtocolServerSocketHandle::accept() { return ProtocolClientSocketHandle( FileHandle(this->ServerSocketHandle::accept()),true); } template -prefix_ satcom::lib::ProtocolServerSocketHandle -satcom::lib::ProtocolServerSocketHandle::cast_static(FileHandle handle) +prefix_ senf::ProtocolServerSocketHandle +senf::ProtocolServerSocketHandle::cast_static(FileHandle handle) { return ProtocolServerSocketHandle(handle,true); } template -prefix_ satcom::lib::ProtocolServerSocketHandle -satcom::lib::ProtocolServerSocketHandle::cast_dynamic(FileHandle handle) +prefix_ senf::ProtocolServerSocketHandle +senf::ProtocolServerSocketHandle::cast_dynamic(FileHandle handle) { ServerSocketHandle h( ServerSocketHandle::cast_dynamic(handle)); @@ -77,7 +77,7 @@ satcom::lib::ProtocolServerSocketHandle::cast_dynamic(FileHandle template prefix_ void -satcom::lib::ProtocolServerSocketHandle::state(SocketStateMap & map, +senf::ProtocolServerSocketHandle::state(SocketStateMap & map, unsigned lod) { map["handle"] = prettyName(typeid(*this)); @@ -86,7 +86,7 @@ satcom::lib::ProtocolServerSocketHandle::state(SocketStateMap & template prefix_ std::string -satcom::lib::ProtocolServerSocketHandle::dumpState(unsigned lod) +senf::ProtocolServerSocketHandle::dumpState(unsigned lod) { SocketStateMap map; state(map,lod); @@ -94,7 +94,7 @@ satcom::lib::ProtocolServerSocketHandle::dumpState(unsigned lod) } template -prefix_ satcom::lib::ProtocolServerSocketHandle:: +prefix_ senf::ProtocolServerSocketHandle:: ProtocolServerSocketHandle(FileHandle other, bool isChecked) : ServerSocketHandle(other,isChecked) {} @@ -105,5 +105,5 @@ ProtocolServerSocketHandle(FileHandle other, bool isChecked) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ProtocolServerSocketHandle.hh b/Socket/ProtocolServerSocketHandle.hh index c42ee11..2686510 100644 --- a/Socket/ProtocolServerSocketHandle.hh +++ b/Socket/ProtocolServerSocketHandle.hh @@ -29,8 +29,8 @@ #include "ProtocolServerSocketHandle.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + template class ProtocolClientSocketHandle; @@ -75,7 +75,7 @@ namespace lib { }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "ProtocolServerSocketHandle.cci" @@ -86,5 +86,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ProtocolServerSocketHandle.mpp b/Socket/ProtocolServerSocketHandle.mpp index 029a995..101d41b 100644 --- a/Socket/ProtocolServerSocketHandle.mpp +++ b/Socket/ProtocolServerSocketHandle.mpp @@ -45,7 +45,7 @@ ////// #if BOOST_PP_ITERATION_FLAGS()==1 /////////////////////////////////////////////////////////////////////////// -// satcom::lib::ProtocolServerSocketHandle:: +// senf::ProtocolServerSocketHandle:: // ProtocolServerSocketHandle (constructor) declaration template < mpp_PSSH_TemplateParameters() > @@ -54,15 +54,15 @@ ProtocolServerSocketHandle( mpp_PSSH_MethodParameters() ); ////// #elif BOOST_PP_ITERATION_FLAGS()==2 /////////////////////////////////////////////////////////////////////////// -// satcom::lib::ProtocolServerSocketHandle:: +// senf::ProtocolServerSocketHandle:: // ProtocolServerSocketHandle (constructor) implementation template template < mpp_PSSH_TemplateParameters() > -prefix_ satcom::lib::ProtocolServerSocketHandle:: +prefix_ senf::ProtocolServerSocketHandle:: ProtocolServerSocketHandle( mpp_PSSH_MethodParameters() ) : ServerSocketHandle( - std::auto_ptr(new SocketProtocol())) + std::auto_ptr(new SocketProtocol())) { this->protocol().init_server( mpp_PSSH_CallParameters() ); } @@ -89,5 +89,5 @@ ProtocolServerSocketHandle( mpp_PSSH_MethodParameters() ) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ProtocolServerSocketHandle.test.cc b/Socket/ProtocolServerSocketHandle.test.cc index 22b6cb4..7dff657 100644 --- a/Socket/ProtocolServerSocketHandle.test.cc +++ b/Socket/ProtocolServerSocketHandle.test.cc @@ -37,39 +37,39 @@ 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 MySocketHandle; + typedef senf::ProtocolServerSocketHandle 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 OtherSocketHandle; + typedef senf::SocketHandle OtherSocketHandle; MySocketHandle h; h.protocol(); OtherSocketHandle osh (h); - h = satcom::lib::static_socket_cast(osh); + h = senf::static_socket_cast(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\n" + "socket.policy: senf::SocketPolicy\n" "socket.protocol: (anonymous namespace)::MyProtocol\n" "socket.server: true\n" ); @@ -86,5 +86,5 @@ BOOST_AUTO_UNIT_TEST(protocolServerSocketHandle) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ReadWritePolicy.cc b/Socket/ReadWritePolicy.cc index 4f772e4..c441f19 100644 --- a/Socket/ReadWritePolicy.cc +++ b/Socket/ReadWritePolicy.cc @@ -36,7 +36,7 @@ #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; @@ -57,7 +57,7 @@ prefix_ unsigned satcom::lib::ReadablePolicy::read(FileHandle handle, char * buf 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) { @@ -78,7 +78,7 @@ prefix_ unsigned satcom::lib::ReadablePolicy::do_readfrom(FileHandle handle, cha 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; @@ -98,7 +98,7 @@ prefix_ unsigned satcom::lib::WriteablePolicy::do_write(FileHandle handle, char 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) { @@ -126,5 +126,5 @@ prefix_ unsigned satcom::lib::WriteablePolicy::do_writeto(FileHandle handle, // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ReadWritePolicy.cti b/Socket/ReadWritePolicy.cti index f4f7f84..84a378f 100644 --- a/Socket/ReadWritePolicy.cti +++ b/Socket/ReadWritePolicy.cti @@ -30,7 +30,7 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ unsigned satcom::lib::ReadablePolicy:: +prefix_ unsigned senf::ReadablePolicy:: readfrom(ClientSocketHandle handle, char * buffer, unsigned size, typename Policy::AddressingPolicy::Address & address, typename IfCommunicationPolicyIs::type *) @@ -39,7 +39,7 @@ readfrom(ClientSocketHandle handle, char * buffer, unsigned size, } template -prefix_ unsigned satcom::lib::WriteablePolicy:: +prefix_ unsigned senf::WriteablePolicy:: write(ClientSocketHandle handle, char const * buffer, unsigned size, typename IfCommunicationPolicyIs::type *) { @@ -47,7 +47,7 @@ write(ClientSocketHandle handle, char const * buffer, unsigned size, } template -prefix_ unsigned satcom::lib::WriteablePolicy:: +prefix_ unsigned senf::WriteablePolicy:: writeto(ClientSocketHandle handle, typename boost::call_traits::param_type addr, char const * buffer, unsigned size, @@ -62,5 +62,5 @@ writeto(ClientSocketHandle handle, // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ReadWritePolicy.hh b/Socket/ReadWritePolicy.hh index fa49481..e5203ae 100644 --- a/Socket/ReadWritePolicy.hh +++ b/Socket/ReadWritePolicy.hh @@ -35,8 +35,8 @@ struct sockaddr; -namespace satcom { -namespace lib { +namespace senf { + struct ReadablePolicy : public ReadPolicyBase { @@ -74,7 +74,7 @@ namespace lib { struct NotWriteablePolicy : public WritePolicyBase {}; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// @@ -86,5 +86,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ServerSocketHandle.cti b/Socket/ServerSocketHandle.cti index 0887c90..37bbe44 100644 --- a/Socket/ServerSocketHandle.cti +++ b/Socket/ServerSocketHandle.cti @@ -32,22 +32,22 @@ template template -prefix_ satcom::lib::ServerSocketHandle:: +prefix_ senf::ServerSocketHandle:: ServerSocketHandle(ServerSocketHandle other, typename SocketHandle::template IsCompatible::type *) : SocketHandle(other,true) {} template -prefix_ satcom::lib::ServerSocketHandle:: +prefix_ senf::ServerSocketHandle:: ServerSocketHandle(std::auto_ptr protocol) : SocketHandle(protocol,true) {} template template -prefix_ typename satcom::lib::SocketHandle::template IsCompatible::type const & -satcom::lib::ServerSocketHandle::operator=(ServerSocketHandle other) +prefix_ typename senf::SocketHandle::template IsCompatible::type const & +senf::ServerSocketHandle::operator=(ServerSocketHandle other) { assign(other); return *this; @@ -57,20 +57,20 @@ satcom::lib::ServerSocketHandle::operator=(ServerSocketHandle -prefix_ void satcom::lib::ServerSocketHandle::bind(AddressParam addr) +prefix_ void senf::ServerSocketHandle::bind(AddressParam addr) { Policy::AddressingPolicy::bind(*this,addr); } template -prefix_ void satcom::lib::ServerSocketHandle::listen(unsigned backlog) +prefix_ void senf::ServerSocketHandle::listen(unsigned backlog) { Policy::CommunicationPolicy::listen(*this,backlog); } template -prefix_ typename satcom::lib::ServerSocketHandle::Address -satcom::lib::ServerSocketHandle::local() +prefix_ typename senf::ServerSocketHandle::Address +senf::ServerSocketHandle::local() { typename Policy::AddressingPolicy::Address addr; this->local(addr); @@ -78,23 +78,23 @@ satcom::lib::ServerSocketHandle::local() } template -prefix_ void satcom::lib::ServerSocketHandle::local(Address & addr) +prefix_ void senf::ServerSocketHandle::local(Address & addr) { Policy::AddressingPolicy::local(*this,addr); } template -prefix_ typename satcom::lib::ServerSocketHandle::ClientSocketHandle -satcom::lib::ServerSocketHandle::accept() +prefix_ typename senf::ServerSocketHandle::ClientSocketHandle +senf::ServerSocketHandle::accept() { Address address; return acceptfrom(address); } template -prefix_ std::pair::ClientSocketHandle, - typename satcom::lib::ServerSocketHandle::Address> -satcom::lib::ServerSocketHandle::acceptfrom() +prefix_ std::pair::ClientSocketHandle, + typename senf::ServerSocketHandle::Address> +senf::ServerSocketHandle::acceptfrom() { Address address; @@ -103,8 +103,8 @@ satcom::lib::ServerSocketHandle::acceptfrom() } template -prefix_ typename satcom::lib::ServerSocketHandle::ClientSocketHandle -satcom::lib::ServerSocketHandle::acceptfrom(Address & addr) +prefix_ typename senf::ServerSocketHandle::ClientSocketHandle +senf::ServerSocketHandle::acceptfrom(Address & addr) { return ClientSocketHandle(this->protocol().clone(), Policy::CommunicationPolicy::accept(*this,addr)); @@ -113,21 +113,21 @@ satcom::lib::ServerSocketHandle::acceptfrom(Address & addr) /////////////////////////////////////////////////////////////////////////// template -prefix_ satcom::lib::ServerSocketHandle::ServerSocketHandle(FileHandle other, +prefix_ senf::ServerSocketHandle::ServerSocketHandle(FileHandle other, bool isChecked) : SocketHandle(other, isChecked) {} template -prefix_ satcom::lib::ServerSocketHandle -satcom::lib::ServerSocketHandle::cast_static(FileHandle handle) +prefix_ senf::ServerSocketHandle +senf::ServerSocketHandle::cast_static(FileHandle handle) { return ServerSocketHandle(handle,true); } template -prefix_ satcom::lib::ServerSocketHandle -satcom::lib::ServerSocketHandle::cast_dynamic(FileHandle handle) +prefix_ senf::ServerSocketHandle +senf::ServerSocketHandle::cast_dynamic(FileHandle handle) { SocketHandle h (SocketHandle::cast_dynamic(handle)); if (! static_cast(FileHandle::body(handle)).isServer()) @@ -136,14 +136,14 @@ satcom::lib::ServerSocketHandle::cast_dynamic(FileHandle handle) } template -prefix_ void satcom::lib::ServerSocketHandle::state(SocketStateMap & map, unsigned lod) +prefix_ void senf::ServerSocketHandle::state(SocketStateMap & map, unsigned lod) { map["handle"] = prettyName(typeid(*this)); this->body().state(map,lod); } template -prefix_ std::string satcom::lib::ServerSocketHandle::dumpState(unsigned lod) +prefix_ std::string senf::ServerSocketHandle::dumpState(unsigned lod) { SocketStateMap map; state(map,lod); @@ -156,5 +156,5 @@ prefix_ std::string satcom::lib::ServerSocketHandle::dumpState(unsigned // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ServerSocketHandle.hh b/Socket/ServerSocketHandle.hh index 42a6bae..a626360 100644 --- a/Socket/ServerSocketHandle.hh +++ b/Socket/ServerSocketHandle.hh @@ -33,8 +33,8 @@ //#include "ServerSocketHandle.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + template class ClientSocketHandle; @@ -110,7 +110,7 @@ namespace lib { }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "ServerSocketHandle.cci" @@ -121,5 +121,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/ServerSocketHandle.test.cc b/Socket/ServerSocketHandle.test.cc index 299524f..97546de 100644 --- a/Socket/ServerSocketHandle.test.cc +++ b/Socket/ServerSocketHandle.test.cc @@ -39,7 +39,7 @@ namespace { - namespace sl = satcom::lib; + namespace sl = senf; class MySocketHandle : public sl::ServerSocketHandle @@ -70,7 +70,7 @@ BOOST_AUTO_UNIT_TEST(serverSocketHandle) typedef sl::ServerSocketHandle::policy> SomeOtherSocketHandle; typedef sl::ClientSocketHandle OtherClientHandle; @@ -97,5 +97,5 @@ BOOST_AUTO_UNIT_TEST(serverSocketHandle) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketHandle.cc b/Socket/SocketHandle.cc index d0e7e91..1400d35 100644 --- a/Socket/SocketHandle.cc +++ b/Socket/SocketHandle.cc @@ -34,7 +34,7 @@ #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); @@ -42,7 +42,7 @@ prefix_ void satcom::lib::SocketBody::v_close() throw SystemException(errno); } -prefix_ void satcom::lib::SocketBody::v_terminate() +prefix_ void senf::SocketBody::v_terminate() { struct linger ling; ling.l_onoff = 0; @@ -56,13 +56,13 @@ prefix_ void satcom::lib::SocketBody::v_terminate() ::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(); @@ -73,7 +73,7 @@ prefix_ void satcom::lib::SocketBody::state(SocketStateMap & map, unsigned lod) } /////////////////////////////////////////////////////////////////////////// -// satcom::lib::detail::StateMapOrdering +// senf::detail::StateMapOrdering namespace { bool contains(std::string::iterator b, std::string::iterator e, char c) @@ -85,7 +85,7 @@ namespace { } } -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()); @@ -120,7 +120,7 @@ prefix_ bool satcom::lib::detail::StateMapOrdering::operator()(std::string a1, s 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()); @@ -131,7 +131,7 @@ prefix_ std::string satcom::lib::detail::dumpState(SocketStateMap const & map) } template -prefix_ std::ostream & satcom::lib::operator<<(std::ostream & os, SocketHandle handle) +prefix_ std::ostream & senf::operator<<(std::ostream & os, SocketHandle handle) { os << handle.dumpState(); return os; @@ -144,5 +144,5 @@ prefix_ std::ostream & satcom::lib::operator<<(std::ostream & os, SocketHandle

protocol, +prefix_ senf::SocketBody::SocketBody(std::auto_ptr protocol, bool isServer) : protocol_(protocol), isServer_(isServer) { @@ -39,7 +39,7 @@ prefix_ satcom::lib::SocketBody::SocketBody(std::auto_ptr protoc protocol_->body_ = this; } -prefix_ satcom::lib::SocketBody::SocketBody(std::auto_ptr protocol, +prefix_ senf::SocketBody::SocketBody(std::auto_ptr protocol, bool isServer, int fd) : FileBody(fd), protocol_(protocol), isServer_(isServer) { @@ -47,24 +47,24 @@ prefix_ satcom::lib::SocketBody::SocketBody(std::auto_ptr protoc 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") {} @@ -74,5 +74,5 @@ prefix_ satcom::lib::detail::ConvertibleString::ConvertibleString(bool v) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketHandle.ct b/Socket/SocketHandle.ct index 9a90bd8..0082ffb 100644 --- a/Socket/SocketHandle.ct +++ b/Socket/SocketHandle.ct @@ -31,8 +31,8 @@ ///////////////////////////////ct.p//////////////////////////////////////// template -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+=(", "); @@ -46,5 +46,5 @@ satcom::lib::detail::ConvertibleString::operator+=(ConvertibleString const & oth // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketHandle.cti b/Socket/SocketHandle.cti index dde5bf7..f573e43 100644 --- a/Socket/SocketHandle.cti +++ b/Socket/SocketHandle.cti @@ -34,15 +34,15 @@ template template -prefix_ satcom::lib::SocketHandle::SocketHandle(SocketHandle other, +prefix_ senf::SocketHandle::SocketHandle(SocketHandle other, typename IsCompatible::type *) : FileHandle(other) {} template template -prefix_ typename satcom::lib::SocketHandle::template IsCompatible::type const & -satcom::lib::SocketHandle::operator=(SocketHandle other) +prefix_ typename senf::SocketHandle::template IsCompatible::type const & +senf::SocketHandle::operator=(SocketHandle other) { assign(other); return *this; @@ -50,13 +50,13 @@ satcom::lib::SocketHandle::operator=(SocketHandle oth template prefix_ -satcom::lib::SocketHandle::SocketHandle(std::auto_ptr protocol, +senf::SocketHandle::SocketHandle(std::auto_ptr protocol, bool isServer) : FileHandle(std::auto_ptr(new SocketBody(protocol,isServer))) {} template -prefix_ satcom::lib::SocketHandle::SocketHandle(FileHandle other, bool isChecked) +prefix_ senf::SocketHandle::SocketHandle(FileHandle other, bool isChecked) : FileHandle(other) { BOOST_ASSERT( isChecked ); @@ -64,14 +64,14 @@ prefix_ satcom::lib::SocketHandle::SocketHandle(FileHandle other, } template -prefix_ satcom::lib::SocketBody & satcom::lib::SocketHandle::body() +prefix_ senf::SocketBody & senf::SocketHandle::body() { BOOST_ASSERT( dynamic_cast(&FileHandle::body()) ); return static_cast(FileHandle::body()); } template -prefix_ satcom::lib::SocketBody const & satcom::lib::SocketHandle::body() +prefix_ senf::SocketBody const & senf::SocketHandle::body() const { BOOST_ASSERT( dynamic_cast(&FileHandle::body()) ); @@ -79,28 +79,28 @@ prefix_ satcom::lib::SocketBody const & satcom::lib::SocketHandle: } template -prefix_ satcom::lib::SocketProtocol const & satcom::lib::SocketHandle::protocol() +prefix_ senf::SocketProtocol const & senf::SocketHandle::protocol() const { return body().protocol(); } template -prefix_ void satcom::lib::SocketHandle::assign(FileHandle other) +prefix_ void senf::SocketHandle::assign(FileHandle other) { FileHandle::operator=(other); } template -prefix_ satcom::lib::SocketHandle -satcom::lib::SocketHandle::cast_static(FileHandle handle) +prefix_ senf::SocketHandle +senf::SocketHandle::cast_static(FileHandle handle) { return SocketHandle(handle,true); } template -prefix_ satcom::lib::SocketHandle -satcom::lib::SocketHandle::cast_dynamic(FileHandle handle) +prefix_ senf::SocketHandle +senf::SocketHandle::cast_dynamic(FileHandle handle) { // throws bad_cast if the body is not a SocketBody SocketBody & body (dynamic_cast(FileHandle::body(handle))); @@ -110,7 +110,7 @@ satcom::lib::SocketHandle::cast_dynamic(FileHandle handle) } template -prefix_ Target satcom::lib::static_socket_cast(Source handle) +prefix_ Target senf::static_socket_cast(Source handle) { BOOST_STATIC_ASSERT(( boost::is_convertible::value && @@ -122,7 +122,7 @@ prefix_ Target satcom::lib::static_socket_cast(Source handle) } template -prefix_ Target satcom::lib::dynamic_socket_cast(Source handle) +prefix_ Target senf::dynamic_socket_cast(Source handle) { BOOST_STATIC_ASSERT(( boost::is_convertible::value && @@ -133,7 +133,7 @@ prefix_ Target satcom::lib::dynamic_socket_cast(Source handle) } template -prefix_ bool satcom::lib::check_socket_cast(Source handle) +prefix_ bool senf::check_socket_cast(Source handle) { BOOST_STATIC_ASSERT(( boost::is_convertible::value && @@ -156,14 +156,14 @@ prefix_ bool satcom::lib::check_socket_cast(Source handle) } template -prefix_ void satcom::lib::SocketHandle::state(SocketStateMap & map, unsigned lod) +prefix_ void senf::SocketHandle::state(SocketStateMap & map, unsigned lod) { map["handle"] = prettyName(typeid(*this)); body().state(map,lod); } template -prefix_ std::string satcom::lib::SocketHandle::dumpState(unsigned lod) +prefix_ std::string senf::SocketHandle::dumpState(unsigned lod) { SocketStateMap map; state(map,lod); @@ -171,10 +171,10 @@ prefix_ std::string satcom::lib::SocketHandle::dumpState(unsigned } /////////////////////////////////////////////////////////////////////////// -// satcom::lib::detail::ConvertibleString +// senf::detail::ConvertibleString template -prefix_ satcom::lib::detail::ConvertibleString::ConvertibleString(T const & other) +prefix_ senf::detail::ConvertibleString::ConvertibleString(T const & other) : std::string(boost::lexical_cast(other)) {} @@ -184,5 +184,5 @@ prefix_ satcom::lib::detail::ConvertibleString::ConvertibleString(T const & othe // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketHandle.hh b/Socket/SocketHandle.hh index e3ad05a..9c1fd1c 100644 --- a/Socket/SocketHandle.hh +++ b/Socket/SocketHandle.hh @@ -37,8 +37,8 @@ ///////////////////////////////hh.p//////////////////////////////////////// #include "SocketHandle.ih" -namespace satcom { -namespace lib { +namespace senf { + /** \brief */ @@ -108,7 +108,7 @@ namespace lib { template bool check_socket_cast(Source handle); -}} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "SocketHandle.cci" @@ -119,5 +119,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketHandle.ih b/Socket/SocketHandle.ih index f2e2a32..5ad2b99 100644 --- a/Socket/SocketHandle.ih +++ b/Socket/SocketHandle.ih @@ -31,8 +31,8 @@ ///////////////////////////////ih.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + class SocketProtocol; @@ -99,7 +99,7 @@ namespace lib { bool isServer_; }; -}} +} ///////////////////////////////ih.e//////////////////////////////////////// #endif @@ -107,5 +107,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketHandle.test.cc b/Socket/SocketHandle.test.cc index cc2def8..8a3f6cd 100644 --- a/Socket/SocketHandle.test.cc +++ b/Socket/SocketHandle.test.cc @@ -37,7 +37,7 @@ ///////////////////////////////cc.p//////////////////////////////////////// namespace { - namespace sl = satcom::lib; + namespace sl = senf; class MySocketHandle : public sl::SocketHandle @@ -50,12 +50,12 @@ namespace { }; class FDHandle - : public satcom::lib::FileHandle + : public senf::FileHandle { public: FDHandle() - : satcom::lib::FileHandle(std::auto_ptr( - new satcom::lib::FileBody())) {} + : senf::FileHandle(std::auto_ptr( + new senf::FileBody())) {} }; } @@ -72,27 +72,27 @@ BOOST_AUTO_UNIT_TEST(socketHandle) osh = myh; typedef sl::SocketHandle SomeSocketHandle; - SomeSocketHandle ssh = satcom::lib::static_socket_cast(osh); + SomeSocketHandle ssh = senf::static_socket_cast(osh); - BOOST_CHECK_NO_THROW( satcom::lib::dynamic_socket_cast(osh) ); + BOOST_CHECK_NO_THROW( senf::dynamic_socket_cast(osh) ); typedef sl::SocketHandle< sl::MakeSocketPolicy< OtherSocketPolicy, - satcom::lib::NoAddressingPolicy + senf::NoAddressingPolicy >::policy> SomeOtherSocketHandle; - BOOST_CHECK_THROW( satcom::lib::dynamic_socket_cast(osh), + BOOST_CHECK_THROW( senf::dynamic_socket_cast(osh), std::bad_cast ); - BOOST_CHECK_THROW( satcom::lib::dynamic_socket_cast( - satcom::lib::FileHandle(FDHandle())), + BOOST_CHECK_THROW( senf::dynamic_socket_cast( + senf::FileHandle(FDHandle())), std::bad_cast ); BOOST_CHECK_EQUAL( myh.dumpState(), - "handle: satcom::lib::SocketHandle >\n" + "handle: senf::SocketHandle >\n" "file.handle: -1\n" "file.refcount: 3\n" - "socket.policy: satcom::lib::SocketPolicy\n" - "socket.protocol: satcom::lib::test::SomeProtocol\n" + "socket.policy: senf::SocketPolicy\n" + "socket.protocol: senf::test::SomeProtocol\n" "socket.server: false\n" ); } @@ -103,5 +103,5 @@ BOOST_AUTO_UNIT_TEST(socketHandle) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketPolicy.ct b/Socket/SocketPolicy.ct index 277dc81..cc21916 100644 --- a/Socket/SocketPolicy.ct +++ b/Socket/SocketPolicy.ct @@ -33,7 +33,7 @@ #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(other.BOOST_PP_CAT(the,SomePolicy)()); @@ -50,5 +50,5 @@ checkBaseOf(SocketPolicyBase const & other) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketPolicy.hh b/Socket/SocketPolicy.hh index a2a0c05..e821d92 100644 --- a/Socket/SocketPolicy.hh +++ b/Socket/SocketPolicy.hh @@ -28,8 +28,8 @@ //#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 @@ -59,7 +59,7 @@ namespace lib { // template SocketPolicy< ..policies.. > // template MakeSocketPolicy< ..args.. > // template SocketPolicyIsBaseOf< Base, Derived > -}} +} //////////////////////////////hh.e//////////////////////////////////////// #include "SocketPolicy.ih" @@ -71,5 +71,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketPolicy.ih b/Socket/SocketPolicy.ih index b60fd94..a6d9ebb 100644 --- a/Socket/SocketPolicy.ih +++ b/Socket/SocketPolicy.ih @@ -50,8 +50,8 @@ ///////////////////////////////ih.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + # define SATLIB_SOCKET_POLICIES_N BOOST_PP_SEQ_SIZE( SATLIB_SOCKET_POLICIES ) @@ -205,7 +205,7 @@ namespace impl { } // 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 ) > >, @@ -241,7 +241,7 @@ namespace impl { # undef SP_DefineConditions -}} +} ///////////////////////////////ih.e//////////////////////////////////////// #endif @@ -249,5 +249,5 @@ namespace impl { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketPolicy.test.cc b/Socket/SocketPolicy.test.cc index af167a4..5b7aeb0 100644 --- a/Socket/SocketPolicy.test.cc +++ b/Socket/SocketPolicy.test.cc @@ -38,7 +38,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -using namespace satcom::lib; +using namespace senf; namespace { struct INetAddressingPolicy : public AddressingPolicyBase {}; @@ -136,5 +136,5 @@ BOOST_AUTO_UNIT_TEST(socketPolicy) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketPolicy.test.hh b/Socket/SocketPolicy.test.hh index cebba2d..418707b 100644 --- a/Socket/SocketPolicy.test.hh +++ b/Socket/SocketPolicy.test.hh @@ -30,11 +30,11 @@ //#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; @@ -48,16 +48,16 @@ namespace test { {} }; - 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; @@ -75,7 +75,7 @@ namespace test { } }; - struct SomeWritePolicy : public satcom::lib::WritePolicyBase + struct SomeWritePolicy : public senf::WritePolicyBase { static unsigned write(FileHandle handle, char const * buffer, unsigned size) { @@ -92,7 +92,7 @@ namespace test { } }; - struct SomeBufferingPolicy : public satcom::lib::BufferingPolicyBase + struct SomeBufferingPolicy : public senf::BufferingPolicyBase { static unsigned rcvbuf(FileHandle handle) { return 0; } @@ -105,7 +105,7 @@ namespace test { { return 0; } }; - typedef satcom::lib::MakeSocketPolicy< + typedef senf::MakeSocketPolicy< SomeAddressingPolicy, SomeFramingPolicy, SomeCommunicationPolicy, @@ -114,7 +114,7 @@ namespace test { SomeBufferingPolicy >::policy SomeSocketPolicy; -}}} +}} ///////////////////////////////hh.e//////////////////////////////////////// //#include "SocketPolicy.test.cci" @@ -126,5 +126,5 @@ namespace test { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketProtocol.cc b/Socket/SocketProtocol.cc index f82cd5f..d5afd75 100644 --- a/Socket/SocketProtocol.cc +++ b/Socket/SocketProtocol.cc @@ -31,7 +31,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ void satcom::lib::SocketProtocol::state(SocketStateMap & map, unsigned lod) +prefix_ void senf::SocketProtocol::state(SocketStateMap & map, unsigned lod) const {} @@ -42,5 +42,5 @@ prefix_ void satcom::lib::SocketProtocol::state(SocketStateMap & map, unsigned l // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketProtocol.cci b/Socket/SocketProtocol.cci index a10def6..a8a848b 100644 --- a/Socket/SocketProtocol.cci +++ b/Socket/SocketProtocol.cci @@ -30,14 +30,14 @@ #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_ ); @@ -50,5 +50,5 @@ prefix_ satcom::lib::SocketBody & satcom::lib::SocketProtocol::body() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketProtocol.cti b/Socket/SocketProtocol.cti index f2b3287..ff56cc1 100644 --- a/Socket/SocketProtocol.cti +++ b/Socket/SocketProtocol.cti @@ -30,12 +30,12 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::lib::ConcreteSocketProtocol::~ConcreteSocketProtocol() +prefix_ senf::ConcreteSocketProtocol::~ConcreteSocketProtocol() {} template -prefix_ typename satcom::lib::ConcreteSocketProtocol::Policy const & -satcom::lib::ConcreteSocketProtocol::policy() +prefix_ typename senf::ConcreteSocketProtocol::Policy const & +senf::ConcreteSocketProtocol::policy() const { return policy_; @@ -47,5 +47,5 @@ satcom::lib::ConcreteSocketProtocol::policy() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketProtocol.hh b/Socket/SocketProtocol.hh index e55cbf8..008716e 100644 --- a/Socket/SocketProtocol.hh +++ b/Socket/SocketProtocol.hh @@ -31,8 +31,8 @@ //#include "SocketProtocol.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + class SocketPolicyBase; @@ -107,7 +107,7 @@ namespace lib { }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "SocketProtocol.cci" @@ -118,5 +118,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketProtocol.test.cc b/Socket/SocketProtocol.test.cc index fdd880c..a138d98 100644 --- a/Socket/SocketProtocol.test.cc +++ b/Socket/SocketProtocol.test.cc @@ -38,7 +38,7 @@ BOOST_AUTO_UNIT_TEST(socketProtocol) { - satcom::lib::test::SomeProtocol protocol; + senf::test::SomeProtocol protocol; // This would fail an assertion ... // BOOST_CHECK( protocol.body() == 0 ); @@ -52,5 +52,5 @@ BOOST_AUTO_UNIT_TEST(socketProtocol) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/SocketProtocol.test.hh b/Socket/SocketProtocol.test.hh index 047a6a9..680d8e1 100644 --- a/Socket/SocketProtocol.test.hh +++ b/Socket/SocketProtocol.test.hh @@ -31,8 +31,8 @@ //#include "SocketProtocol.test.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + namespace test { class SomeProtocol @@ -52,7 +52,7 @@ namespace test { { return false; } }; -}}} +}} ///////////////////////////////hh.e//////////////////////////////////////// //#include "SocketProtocol.test.cci" @@ -64,5 +64,5 @@ namespace test { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/TCPProtocol.cc b/Socket/TCPProtocol.cc index f444ac3..246eacd 100644 --- a/Socket/TCPProtocol.cc +++ b/Socket/TCPProtocol.cc @@ -37,7 +37,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ bool satcom::lib::TCPProtocol::nodelay() +prefix_ bool senf::TCPProtocol::nodelay() const { int value; @@ -47,7 +47,7 @@ prefix_ bool satcom::lib::TCPProtocol::nodelay() return value; } -prefix_ void satcom::lib::TCPProtocol::nodelay(bool value) +prefix_ void senf::TCPProtocol::nodelay(bool value) const { int ivalue (value); @@ -55,7 +55,7 @@ prefix_ void satcom::lib::TCPProtocol::nodelay(bool value) throw SystemException(errno); } -prefix_ unsigned satcom::lib::TCPProtocol::siocinq() +prefix_ unsigned senf::TCPProtocol::siocinq() const { int n; @@ -64,7 +64,7 @@ prefix_ unsigned satcom::lib::TCPProtocol::siocinq() return n; } -prefix_ unsigned satcom::lib::TCPProtocol::siocoutq() +prefix_ unsigned senf::TCPProtocol::siocoutq() const { int n; @@ -73,13 +73,13 @@ prefix_ unsigned satcom::lib::TCPProtocol::siocoutq() 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; @@ -93,5 +93,5 @@ prefix_ bool satcom::lib::TCPProtocol::eof() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/TCPProtocol.hh b/Socket/TCPProtocol.hh index adf029f..3dba9e2 100644 --- a/Socket/TCPProtocol.hh +++ b/Socket/TCPProtocol.hh @@ -29,8 +29,8 @@ //#include "TCPProtocol.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + class TCPProtocol : public virtual SocketProtocol @@ -45,7 +45,7 @@ namespace lib { bool eof() const; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "TCPProtocol.cci" @@ -56,5 +56,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/TCPSocketHandle.cc b/Socket/TCPSocketHandle.cc index 0eb1446..e7bb95c 100644 --- a/Socket/TCPSocketHandle.cc +++ b/Socket/TCPSocketHandle.cc @@ -36,7 +36,7 @@ #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); @@ -46,14 +46,14 @@ prefix_ void satcom::lib::TCPv4SocketProtocol::init_client() } 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); @@ -62,7 +62,7 @@ prefix_ void satcom::lib::TCPv4SocketProtocol::init_server() 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 { @@ -73,7 +73,7 @@ prefix_ void satcom::lib::TCPv4SocketProtocol::init_server(INet4Address const & throw SystemException(errno); } -prefix_ std::auto_ptr satcom::lib::TCPv4SocketProtocol::clone() +prefix_ std::auto_ptr senf::TCPv4SocketProtocol::clone() const { return std::auto_ptr(new TCPv4SocketProtocol()); @@ -86,5 +86,5 @@ prefix_ std::auto_ptr satcom::lib::TCPv4SocketProto // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/TCPSocketHandle.hh b/Socket/TCPSocketHandle.hh index 5d3b2c0..0181981 100644 --- a/Socket/TCPSocketHandle.hh +++ b/Socket/TCPSocketHandle.hh @@ -40,8 +40,8 @@ //#include "TCPSocketHandle.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + typedef MakeSocketPolicy< INet4AddressingPolicy, @@ -92,7 +92,7 @@ namespace lib { typedef ProtocolClientSocketHandle TCPv6ClientSocketHandle; typedef ProtocolServerSocketHandle TCPv6ServerSocketHandle; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "TCPSocketHandle.cci" @@ -103,5 +103,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Socket/TCPSocketHandle.test.cc b/Socket/TCPSocketHandle.test.cc index 2a8659b..ac9d2d8 100644 --- a/Socket/TCPSocketHandle.test.cc +++ b/Socket/TCPSocketHandle.test.cc @@ -120,15 +120,15 @@ namespace { 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" ); @@ -153,21 +153,21 @@ BOOST_AUTO_UNIT_TEST(tcpv4ClientSocketHandle) } { - 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) ); @@ -215,12 +215,12 @@ BOOST_AUTO_UNIT_TEST(tcpv4ServerSocketHandle) { { 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"); @@ -235,5 +235,5 @@ BOOST_AUTO_UNIT_TEST(tcpv4ServerSocketHandle) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Utils/DaemonTools.cc b/Utils/DaemonTools.cc index 0dc3f0b..44165b6 100644 --- a/Utils/DaemonTools.cc +++ b/Utils/DaemonTools.cc @@ -20,25 +20,25 @@ #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//////////////////////////////////////// diff --git a/Utils/DaemonTools.hh b/Utils/DaemonTools.hh index e96ade6..7fab851 100644 --- a/Utils/DaemonTools.hh +++ b/Utils/DaemonTools.hh @@ -11,13 +11,13 @@ //#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" diff --git a/Utils/Exception.cc b/Utils/Exception.cc index c9a43f1..2798216 100644 --- a/Utils/Exception.cc +++ b/Utils/Exception.cc @@ -32,7 +32,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ void satcom::lib::SystemException::init() +prefix_ void senf::SystemException::init() { std::stringstream s; if (where) @@ -41,7 +41,7 @@ prefix_ void satcom::lib::SystemException::init() buffer_ = s.str(); } -prefix_ char const * satcom::lib::SystemException::what() +prefix_ char const * senf::SystemException::what() const throw() { return buffer_.c_str(); @@ -53,5 +53,5 @@ prefix_ char const * satcom::lib::SystemException::what() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Utils/Exception.hh b/Utils/Exception.hh index 1c5ca1c..7d5dbf1 100644 --- a/Utils/Exception.hh +++ b/Utils/Exception.hh @@ -30,8 +30,8 @@ //#include "Exception.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + struct SystemException : public std::exception { @@ -49,7 +49,7 @@ namespace lib { std::string buffer_; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "Exception.cci" @@ -60,5 +60,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Utils/MicroTime.cc b/Utils/MicroTime.cc index 40e59c3..5006c50 100644 --- a/Utils/MicroTime.cc +++ b/Utils/MicroTime.cc @@ -18,7 +18,7 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ satcom::lib::MicroTime satcom::lib::now() +prefix_ senf::MicroTime senf::now() { struct timeval tv; if (gettimeofday(&tv,0) < 0) diff --git a/Utils/MicroTime.hh b/Utils/MicroTime.hh index f4fc8ca..d4495e1 100644 --- a/Utils/MicroTime.hh +++ b/Utils/MicroTime.hh @@ -11,14 +11,14 @@ //#include "MicroTime.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + typedef boost::uint64_t MicroTime; MicroTime now(); -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "MicroTime.cci" diff --git a/Utils/MicroTime.test.cc b/Utils/MicroTime.test.cc index 93dfd54..cd3bc33 100644 --- a/Utils/MicroTime.test.cc +++ b/Utils/MicroTime.test.cc @@ -18,7 +18,7 @@ BOOST_AUTO_UNIT_TEST(microTime) { - BOOST_CHECK_NO_THROW( satcom::lib::now() ); + BOOST_CHECK_NO_THROW( senf::now() ); } ///////////////////////////////cc.e//////////////////////////////////////// diff --git a/Utils/SafeBool.cci b/Utils/SafeBool.cci index 4c49b5b..8cce0e5 100644 --- a/Utils/SafeBool.cci +++ b/Utils/SafeBool.cci @@ -9,22 +9,22 @@ #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/////////////////////////////////////// diff --git a/Utils/SafeBool.cti b/Utils/SafeBool.cti index 603ae8a..f223f75 100644 --- a/Utils/SafeBool.cti +++ b/Utils/SafeBool.cti @@ -12,7 +12,7 @@ ///////////////////////////////cti.p/////////////////////////////////////// template -prefix_ satcom::lib::SafeBool::operator bool_type() +prefix_ senf::SafeBool::operator bool_type() const { return (static_cast(this))->boolean_test() @@ -20,24 +20,24 @@ prefix_ satcom::lib::SafeBool::operator bool_type() } template -prefix_ bool satcom::lib::SafeBool::operator!() +prefix_ bool senf::SafeBool::operator!() const { return ! (static_cast(this))->boolean_test(); } template -prefix_ satcom::lib::SafeBool::~SafeBool() +prefix_ senf::SafeBool::~SafeBool() {} template -prefix_ void satcom::lib::operator==(const SafeBool& lhs, const SafeBool& rhs) +prefix_ void senf::operator==(const SafeBool& lhs, const SafeBool& rhs) { lhs.this_type_does_not_support_comparisons(); } template -prefix_ void satcom::lib::operator!=(const SafeBool& lhs, const SafeBool& rhs) +prefix_ void senf::operator!=(const SafeBool& lhs, const SafeBool& rhs) { lhs.this_type_does_not_support_comparisons(); } diff --git a/Utils/SafeBool.hh b/Utils/SafeBool.hh index 5bde302..43e317b 100644 --- a/Utils/SafeBool.hh +++ b/Utils/SafeBool.hh @@ -10,8 +10,8 @@ //#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 @@ -67,7 +67,7 @@ namespace lib { template void operator!=(const SafeBool& lhs,const SafeBool& rhs); -}} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "SafeBool.cci" diff --git a/Utils/TypeInfo.cc b/Utils/TypeInfo.cc index c6860f5..9f0bd6a 100644 --- a/Utils/TypeInfo.cc +++ b/Utils/TypeInfo.cc @@ -41,7 +41,7 @@ // 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); @@ -58,5 +58,5 @@ prefix_ std::string satcom::lib::prettyName(std::type_info const & type) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Utils/TypeInfo.hh b/Utils/TypeInfo.hh index 72168b6..98c3b38 100644 --- a/Utils/TypeInfo.hh +++ b/Utils/TypeInfo.hh @@ -30,12 +30,12 @@ //#include "TypeInfo.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + std::string prettyName(std::type_info const & type); -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "TypeInfo.cci" @@ -47,5 +47,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Utils/TypeInfo.test.cc b/Utils/TypeInfo.test.cc index ac73a7e..1d05bfb 100644 --- a/Utils/TypeInfo.test.cc +++ b/Utils/TypeInfo.test.cc @@ -53,8 +53,8 @@ BOOST_AUTO_UNIT_TEST(prettyName) 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, 10>" ); + BOOST_CHECK_EQUAL( senf::prettyName(typeid(int)), "int"); + BOOST_CHECK_EQUAL( senf::prettyName(typeid(baseOb)), "test::Foo, 10>" ); } ///////////////////////////////cc.e//////////////////////////////////////// @@ -63,5 +63,5 @@ BOOST_AUTO_UNIT_TEST(prettyName) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Utils/impl/membind.hh b/Utils/impl/membind.hh index ef18500..a0c619d 100644 --- a/Utils/impl/membind.hh +++ b/Utils/impl/membind.hh @@ -20,7 +20,7 @@ // 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 diff --git a/Utils/intrusive_refcount.cci b/Utils/intrusive_refcount.cci index a6a9d1a..3318a4d 100644 --- a/Utils/intrusive_refcount.cci +++ b/Utils/intrusive_refcount.cci @@ -30,40 +30,40 @@ #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; @@ -75,5 +75,5 @@ prefix_ void satcom::lib::intrusive_ptr_release(intrusive_refcount* p) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Utils/intrusive_refcount.hh b/Utils/intrusive_refcount.hh index a63dbe6..60a60e6 100644 --- a/Utils/intrusive_refcount.hh +++ b/Utils/intrusive_refcount.hh @@ -29,8 +29,8 @@ //#include "intrusive_refcount.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + /** \brief */ @@ -54,14 +54,14 @@ namespace lib { 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" @@ -72,5 +72,5 @@ namespace lib { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Utils/intrusive_refcount.test.cc b/Utils/intrusive_refcount.test.cc index f09e4bc..8ed8772 100644 --- a/Utils/intrusive_refcount.test.cc +++ b/Utils/intrusive_refcount.test.cc @@ -37,7 +37,7 @@ namespace { struct Tester - : public satcom::lib::intrusive_refcount + : public senf::intrusive_refcount { typedef boost::intrusive_ptr ptr; @@ -80,5 +80,5 @@ BOOST_AUTO_UNIT_TEST(intrusive_refcount) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/Utils/membind.hh b/Utils/membind.hh index e624e76..bc9b30d 100644 --- a/Utils/membind.hh +++ b/Utils/membind.hh @@ -29,8 +29,8 @@ ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + #define scOBTYPE T * #include "Utils/impl/membind.hh" @@ -40,7 +40,7 @@ namespace lib { #include "Utils/impl/membind.hh" #undef scOBTYPE -}} +} ///////////////////////////////hh.e//////////////////////////////////////// //#include "membind.cci" diff --git a/Utils/membind.test.cc b/Utils/membind.test.cc index 7c05954..465e29c 100644 --- a/Utils/membind.test.cc +++ b/Utils/membind.test.cc @@ -55,8 +55,8 @@ namespace { BOOST_AUTO_UNIT_TEST(membind) { Test instance; - boost::function f1 (satcom::lib::membind(&Test::meth1,instance)); - boost::function f2 (satcom::lib::membind(&Test::meth2,instance)); + boost::function f1 (senf::membind(&Test::meth1,instance)); + boost::function f2 (senf::membind(&Test::meth2,instance)); BOOST_CHECK_EQUAL( f1(), "meth1()" ); BOOST_CHECK_EQUAL( f2(1,2), "meth2(1,2)" ); @@ -68,5 +68,5 @@ BOOST_AUTO_UNIT_TEST(membind) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: diff --git a/doclib/Doxyfile.global b/doclib/Doxyfile.global index 54d2c9b..05a7777 100644 --- a/doclib/Doxyfile.global +++ b/doclib/Doxyfile.global @@ -83,7 +83,7 @@ FILE_PATTERNS = *.c *.cc *.cci *.ct *.cti *.h *.hh *.ih *.mmc *.dox RECURSIVE = NO EXCLUDE = doc EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = *.test.cc *~ .* +EXCLUDE_PATTERNS = *.test.cc .* EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO diff --git a/doclib/doxy-header-overview.html b/doclib/doxy-header-overview.html index 93c5692..e0f52b3 100644 --- a/doclib/doxy-header-overview.html +++ b/doclib/doxy-header-overview.html @@ -26,6 +26,6 @@ div.tabs ul li.$projectname a { background-color: #EDE497; }

  • libPackets
  • libScheduler
  • libUtils
  • -
  • SENFSCons
  • +
  • SENFSCons
  • diff --git a/doclib/doxy-header.html b/doclib/doxy-header.html index 471e460..a630f59 100644 --- a/doclib/doxy-header.html +++ b/doclib/doxy-header.html @@ -26,6 +26,6 @@ div.tabs ul li.$projectname a { background-color: #EDE497; }
  • libPackets
  • libScheduler
  • libUtils
  • -
  • SENFSCons
  • +
  • SENFSCons
  • diff --git a/satscons/BoostUnitTests.py b/senfscons/BoostUnitTests.py similarity index 100% rename from satscons/BoostUnitTests.py rename to senfscons/BoostUnitTests.py diff --git a/satscons/Dia2Png.py b/senfscons/Dia2Png.py similarity index 100% rename from satscons/Dia2Png.py rename to senfscons/Dia2Png.py diff --git a/satscons/Doxyfile b/senfscons/Doxyfile similarity index 100% rename from satscons/Doxyfile rename to senfscons/Doxyfile diff --git a/satscons/Doxyfile.template b/senfscons/Doxyfile.template similarity index 100% rename from satscons/Doxyfile.template rename to senfscons/Doxyfile.template diff --git a/satscons/Doxygen.py b/senfscons/Doxygen.py similarity index 100% rename from satscons/Doxygen.py rename to senfscons/Doxygen.py diff --git a/satscons/SConfig.template b/senfscons/SConfig.template similarity index 100% rename from satscons/SConfig.template rename to senfscons/SConfig.template diff --git a/satscons/SConscript b/senfscons/SConscript similarity index 100% rename from satscons/SConscript rename to senfscons/SConscript diff --git a/satscons/SConscript.template b/senfscons/SConscript.template similarity index 100% rename from satscons/SConscript.template rename to senfscons/SConscript.template diff --git a/satscons/SConstruct.template b/senfscons/SConstruct.template similarity index 92% rename from satscons/SConstruct.template rename to senfscons/SConstruct.template index ef68cb9..6803479 100644 --- a/satscons/SConstruct.template +++ b/senfscons/SConstruct.template @@ -1,5 +1,5 @@ import sys, glob -sys.path.append('satscons') +sys.path.append('senfscons') import SatSCons ########################################################################### diff --git a/satscons/SatSCons.py b/senfscons/SatSCons.py similarity index 100% rename from satscons/SatSCons.py rename to senfscons/SatSCons.py diff --git a/satscons/__init__.py b/senfscons/__init__.py similarity index 100% rename from satscons/__init__.py rename to senfscons/__init__.py diff --git a/satscons/nodeglob.py b/senfscons/nodeglob.py similarity index 100% rename from satscons/nodeglob.py rename to senfscons/nodeglob.py diff --git a/satscons/pdflatex.py b/senfscons/pdflatex.py similarity index 100% rename from satscons/pdflatex.py rename to senfscons/pdflatex.py