X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FListParser.hh;h=865ebc82fb94e8d4e046bda04eeb06d03888123c;hb=ddb2132be4265f8a0d7d4c954c7c9401e59d027c;hp=d7c19a18a0f56c8fcfe6eff959d99b3581689fde;hpb=af5fee58087b479a8a346dc5f94047ec0c5f79cf;p=senf.git diff --git a/senf/Packets/ListParser.hh b/senf/Packets/ListParser.hh index d7c19a1..865ebc8 100644 --- a/senf/Packets/ListParser.hh +++ b/senf/Packets/ListParser.hh @@ -2,23 +2,28 @@ // // 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. +// 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 // -// 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. +// 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. // -// 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. +// 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. +// All Rights Reserved. +// +// Contributor(s): +// Stefan Bund /** \file \brief ListParser public header */ @@ -31,7 +36,7 @@ #include "PacketParser.hh" //#include "ListParser.mpp" -///////////////////////////////hh.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { @@ -62,8 +67,8 @@ namespace senf { API however you will need to instantiate a container wrapper for the list. See \ref packet_usage_fields_collection. - \see - \ref How to access \ref packet_usage_fields_collection + \see + How to access \ref packet_usage_fields_collection \n SENF_PARSER_LIST() macro used to define list fields \n ListParser_Container list container wrapper API \n ExampleListPolicy @@ -89,7 +94,7 @@ namespace senf { static const size_type init_bytes = ListPolicy::init_bytes; - /////////////////////////////////////////////////////////////////////////// + //-//////////////////////////////////////////////////////////////////////// // Container interface typedef typename ListPolicy::element_type value_type; @@ -120,7 +125,7 @@ namespace senf { This is the container wrapper used for list parsers. The container wrapper will stay valid after changing the collection. However the container still depends on the packet and will be invalidated if the Packet is deallocated or if the packet size is changed from without the - container wrapper (more precisely, it is invalided if the insertion/deletion happens before + container wrapper (more precisely, it is invalidated if the insertion/deletion happens before the vector in the packet data). The vector container wrapper provides a complete STL random-access sequence interface. @@ -138,7 +143,7 @@ namespace senf { : private ListPolicy { public: - /////////////////////////////////////////////////////////////////////////// + //-//////////////////////////////////////////////////////////////////////// // Types typedef ListPolicy policy; @@ -151,9 +156,9 @@ namespace senf { typedef iterator const_iterator; typedef PacketParserBase::state_type state_type; - /////////////////////////////////////////////////////////////////////////// + //-//////////////////////////////////////////////////////////////////////// ///\name Structors and default members - ///@{ + //\{ // no default constructor // default copy @@ -163,11 +168,11 @@ namespace senf { ListParser_Container(parser_type const & list); ~ListParser_Container(); - ///@} - /////////////////////////////////////////////////////////////////////////// + //\} + //-//////////////////////////////////////////////////////////////////////// ///\name Accessors - ///@{ + //\{ size_type size() const; bool empty() const; @@ -178,9 +183,9 @@ namespace senf { value_type front() const; value_type back() const; - ///@} + //\} ///\name Mutators - ///@{ + //\{ // All these operations can be quite inefficient depending on the list type value_type shift(iterator pos, size_type n=1); @@ -207,10 +212,10 @@ namespace senf { void resize (size_type n); template void resize (size_type n, Value value); - ///@} + //\} ///\name Parser interface - ///@{ + //\{ parser_type parser() const; data_iterator i() const; @@ -220,7 +225,7 @@ namespace senf { size_type bytes() const; void init() const; - ///@} + //\} private: friend class detail::ListParser_Iterator; @@ -240,7 +245,7 @@ namespace senf { // Define the list SENF_PARSER_LIST ( list, list_size_, EltParser ); \endcode - + Here \c EltParser can be an arbitrary parser and need not have a fixed size. \warning Realize, that the \a size field is controlled by the list parser. This field @@ -261,7 +266,7 @@ namespace senf { \c transform(\a transform, \c bytes(\a size))The \a transform is applied to the \a size value. The value is then interpreted containing the list size in bytes not - number of elements + number of elements The optional \a transform is a class with the following layout @@ -272,7 +277,7 @@ namespace senf { static value_type get(other_type v); static other_type set(value_type v); }; - \endcode + \endcode \c other_type is \a size ::\c value_type, the type of the value returned by the \a size field, whereas the \c value_type typedef is the arbitrary return type of the transform. @@ -297,7 +302,7 @@ namespace senf { \param[in] size name of field giving the list size \param[in] elt_type list element type - \see + \see How to use \ref packet_usage_fields_collection \n senf::ListParser the list parser API for list field access senf::ListParser_Container the list parser container API for list field access @@ -320,7 +325,7 @@ namespace senf { } -///////////////////////////////hh.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// #endif #if !defined(HH_SENF_Packets_Packets__decls_) && !defined(HH_SENF_Packets_ListParser_i_) #define HH_SENF_Packets_ListParser_i_