X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FParseHelpers.ih;h=96127c992a2208db7333eba6780241cd1802e1d7;hb=ab7ff164ab5ae711ec09ce2b24228510f1ffdcff;hp=4053ba375d745723ee41ac447758e1d1a3072572;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/Packets/ParseHelpers.ih b/senf/Packets/ParseHelpers.ih index 4053ba3..96127c9 100644 --- a/senf/Packets/ParseHelpers.ih +++ b/senf/Packets/ParseHelpers.ih @@ -1,26 +1,31 @@ -# // Copyright (C) 2007 -# // 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 -# // the Free Software Foundation; either version 2 of the License, or -# // (at your option) any later version. -# // -# // This program is distributed in the hope that it will be useful, -# // but WITHOUT ANY WARRANTY; without even the implied warranty of -# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# // GNU General Public License for more details. -# // -# // You should have received a copy of the GNU General Public License -# // along with this program; if not, write to the -# // Free Software Foundation, Inc., -# // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# /** \file -# \brief ParseHelpers internal header */ -# +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// +// The contents of this file are subject to the Fraunhofer FOKUS Public License +// Version 1.0 (the "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// http://senf.berlios.de/license.html +// +// The Fraunhofer FOKUS Public License Version 1.0 is based on, +// but modifies the Mozilla Public License Version 1.1. +// See the full license text for the amendments. +// +// Software distributed under the License is distributed on an "AS IS" basis, +// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +// for the specific language governing rights and limitations under the License. +// +// The Original Code is Fraunhofer FOKUS code. +// +// The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. +// (registered association), Hansastraße 27 c, 80686 Munich, Germany. +// +// Contributor(s): +// Stefan Bund +/** \file + \brief ParseHelpers internal header */ + # if !defined(IH_ParseHelpers_) # define IH_ParseHelpers_ 1 # @@ -30,11 +35,12 @@ # include # include # include +# include "../Utils/preprocessor.hh" # include "../Utils/mpl.hh" # -# ////////////////////////////////ih.p/////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_INITIALIZE # # define SENF_PARSER_INITIALIZE BOOST_PP_CAT( SENF_PARSER_INITIALIZE_ , SENF_PARSER_TYPE ) @@ -59,7 +65,7 @@ size_type field_offset_(senf::mpl::rv<0>*) const { return 0; } \ public: # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_INHERIT_* # # define SENF_PARSER_INHERIT_var(name) \ @@ -85,7 +91,7 @@ } \ public: # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_FIELD* # // SENF_PARSER_P_FIELD_* # @@ -115,7 +121,7 @@ BOOST_PP_CAT(SENF_PARSER_I_ISVAR_, ofstype) (name, type), \ access ) # -# //////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_I_FIELD_INTRO # # define SENF_PARSER_I_FIELD_INTRO(name, type, access) \ @@ -125,7 +131,7 @@ SENF_MPL_SLOT_SET(index, BOOST_PP_CAT(name,_index)); \ access: # -# //////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_I_FIELD_INIT_* # # define SENF_PARSER_I_FIELD_INIT_rw(name, type, access) \ @@ -143,7 +149,7 @@ } \ access: # -# //////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_I_FIELD_OFS_* # # define SENF_PARSER_I_FIELD_OFS_var(name, type, access) \ @@ -161,7 +167,7 @@ SENF_MPL_SLOT_GET(offset); \ private: # -# //////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_I_ADVANCE_OFS_* # # define SENF_PARSER_I_SIZE_var(name, type) senf::bytes(BOOST_PP_CAT(name, _)()) @@ -197,7 +203,7 @@ SENF_MPL_SLOT_SET(offset, BOOST_PP_CAT(name, _next_offset)); \ access: # -# //////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_I_FIELD_VAL_* # # define SENF_PARSER_I_FIELD_VAL_rw(name, type, access) \ @@ -220,7 +226,7 @@ return BOOST_PP_CAT(name,_)(); \ } # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_CUSTOM_FIELD_* # # define SENF_PARSER_CUSTOM_FIELD_var(name, type, size, isize) \ @@ -236,7 +242,7 @@ BOOST_PP_CAT(SENF_PARSER_I_ADVANCE_OFS_, ofstype) (name, type, size, isize, 1, public) \ BOOST_PP_CAT(name, _t) name() const # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_BITFIELD_* # // SENF_PARSER_P_BITFIELD_* # @@ -254,7 +260,7 @@ # define SENF_PARSER_P_BITFIELD_fix(name, bits, type) \ SENF_PARSER_BITFIELD_I(name, bits, type, fix, rw, protected) # -# //////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_BITFIELD_I # # define SENF_PARSER_BITFIELD_TYPE_signed(start, bits) senf::IntFieldParser @@ -287,7 +293,7 @@ BOOST_PP_CAT(SENF_PARSER_I_FIELD_VAL_, rwtype) (name, type, access) \ public: # -# //////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_I_BITFIELD_OFS_* # # define SENF_PARSER_I_BITFIELD_OFS_var(name, type, access) \ @@ -302,14 +308,14 @@ static size_type const BOOST_PP_CAT(name, _offset) = \ SENF_MPL_SLOT_GET(offset) - SENF_MPL_SLOT_GET(bitfield_size); # -# //////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_I_BITFIELD_RESET # # define SENF_PARSER_I_BITFIELD_RESET() \ SENF_MPL_SLOT_SET(bit, 0); \ SENF_MPL_SLOT_SET(bitfield_size, 0); # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_SKIP_* # # define SENF_PARSER_SKIP_var(bytes, ibytes) \ @@ -328,7 +334,7 @@ private) \ public: # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_SKIP_BITS_* # # define SENF_PARSER_SKIP_BITS_var(bits) SENF_PARSER_I_SKIP_BITS(bits, var) @@ -339,7 +345,7 @@ SENF_MPL_SLOT_SET(bit, SENF_MPL_SLOT_GET(bit) + bits); \ public: # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_GOTO_* # # define SENF_PARSER_GOTO_var(name) \ @@ -377,7 +383,7 @@ # define SENF_PARSER_I_GOTO_SET_OFS_fix(name, offs, initsize) \ SENF_MPL_SLOT_SET(offset, offs); # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_LABEL_* # # define SENF_PARSER_LABEL_var(name) SENF_PARSER_I_LABEL( name, var, public ) @@ -392,25 +398,25 @@ BOOST_PP_CAT(SENF_PARSER_I_ADVANCE_OFS_, ofstype) (name, void, 0, 0, 0, access) \ public: # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_OFFSET_* # # define SENF_PARSER_OFFSET_fix(name) BOOST_PP_CAT(name, _offset) # define SENF_PARSER_OFFSET_var(name) BOOST_PP_CAT(name, _offset)() # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_FIXED_OFFSET_* # # define SENF_PARSER_FIXED_OFFSET_fix(name) BOOST_PP_CAT(name, _offset) # define SENF_PARSER_FIXED_OFFSET_var(name) BOOST_PP_CAT(name, _init_bytes) # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_CURRENT_FIXED_OFFSET_* # # define SENF_PARSER_CURRENT_FIXED_OFFSET_fix() SENF_MPL_SLOT_GET(offset) # define SENF_PARSER_CURRENT_FIXED_OFFSET_var() SENF_MPL_SLOT_GET(init_bytes) # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_FINALIZE_* # # define SENF_PARSER_FINALIZE_var(name) \ @@ -434,7 +440,7 @@ public: \ void init() const { init(0); } # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_REQUIRE_VAR # # define SENF_PARSER_REQUIRE_VAR(description) \ @@ -447,7 +453,7 @@ BOOST_PP_CAT(description, _not_allowed_in_fixed_parser) ) \ BOOST_PP_CAT(errsym_, __LINE__); # -# /////////////////////////////////////////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_COLLECTION_I # # ifndef DOXYGEN @@ -506,14 +512,6 @@ # define SENF_PARSER_COLLECTION_TAG_GETAUX__packetSize() _ # define SENF_PARSER_COLLECTION_TAG_AUXTYPE__packetSize() packetSize # -# // No recursive call so we need some more of theese ... ARGH !!! -# define SENF_CAT_RECURS1(a, b) SENF_CAT_RECURS1_I(a,b) -# define SENF_CAT_RECURS1_I(a, b) a ## b -# define SENF_CAT_RECURS2(a, b) SENF_CAT_RECURS2_I(a,b) -# define SENF_CAT_RECURS2_I(a, b) a ## b -# define SENF_CAT_RECURS3(a, b) SENF_CAT_RECURS3_I(a,b) -# define SENF_CAT_RECURS3_I(a, b) a ## b -# # define SENF_PARSER_COLLECTION_TAG_EXPAND__none() senf::detail::auxtag::none # # define SENF_PARSER_COLLECTION_TAG_RECURS1(aux) \ @@ -648,7 +646,7 @@ BOOST_PP_CAT(name, _t) name() const \ { return BOOST_PP_CAT(name, _)(); } # -# ////////////////////////////////ih.e/////////////////////////////////////// +# //-/////////////////////////////////////////////////////////////////////////////////////////////// # endif # #