X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketPolicy.test.hh;h=8dd46d1086582a8eae1c8704889ecb27ac4f291b;hb=b8ca4a544cce3e6023bb56b712a03d6362f2bb79;hp=cebba2d2c97a6772408ef963fab1f4774af9b4ae;hpb=c52cd7d87dbb525c1267aad27391b8b7365dbb57;p=senf.git diff --git a/Socket/SocketPolicy.test.hh b/Socket/SocketPolicy.test.hh index cebba2d..8dd46d1 100644 --- a/Socket/SocketPolicy.test.hh +++ b/Socket/SocketPolicy.test.hh @@ -1,9 +1,9 @@ // $Id$ // -// Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Copyright (C) 2006 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -20,8 +20,8 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#ifndef HH_SocketPolicy_test_ -#define HH_SocketPolicy_test_ 1 +#ifndef HH_SENF_Socket_SocketPolicy_test_ +#define HH_SENF_Socket_SocketPolicy_test_ 1 // Custom includes #include "SocketPolicy.hh" @@ -30,14 +30,13 @@ //#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; - + static void peer(FileHandle handle, unsigned & addr) { addr=1; } static void local(FileHandle, unsigned & addr) @@ -48,16 +47,18 @@ 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; } + static int accept(FileHandle handle) + { return -1; } }; - struct SomeReadPolicy : public satcom::lib::ReadPolicyBase + struct SomeReadPolicy : public senf::ReadPolicyBase { static unsigned const TEST_SIZE = 9; @@ -75,7 +76,7 @@ namespace test { } }; - struct SomeWritePolicy : public satcom::lib::WritePolicyBase + struct SomeWritePolicy : public senf::WritePolicyBase { static unsigned write(FileHandle handle, char const * buffer, unsigned size) { @@ -91,30 +92,16 @@ namespace test { return write(handle,buffer,size); } }; - - struct SomeBufferingPolicy : public satcom::lib::BufferingPolicyBase - { - static unsigned rcvbuf(FileHandle handle) - { return 0; } - static unsigned rcvbuf(FileHandle handle, unsigned size) - { return 0; } - - static unsigned sndbuf(FileHandle handle) - { return 0; } - static unsigned sndbuf(FileHandle handle, unsigned size) - { return 0; } - }; - typedef satcom::lib::MakeSocketPolicy< + typedef senf::MakeSocketPolicy< SomeAddressingPolicy, SomeFramingPolicy, SomeCommunicationPolicy, SomeReadPolicy, - SomeWritePolicy, - SomeBufferingPolicy + SomeWritePolicy >::policy SomeSocketPolicy; -}}} +}} ///////////////////////////////hh.e//////////////////////////////////////// //#include "SocketPolicy.test.cci" @@ -126,5 +113,10 @@ namespace test { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: