// $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. // All Rights Reserved. // // Contributor(s): // Stefan Bund /** \file \brief ListParser internal header */ #ifndef IH_SENF_Packets_ListParser_ #define IH_SENF_Packets_ListParser_ 1 // Custom includes #include //-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { namespace detail { /** \brief Internal: Iterator used by ListParser \internal */ template class ListParser_Iterator : public boost::iterator_facade< ListParser_Iterator, typename Container::value_type, boost::forward_traversal_tag, typename Container::value_type >, #ifndef DOXYGEN private Container::policy::iterator_data #endif { public: typedef typename Container::value_type value_type; ListParser_Iterator(); explicit ListParser_Iterator(Container const & c); PacketParserBase::data_iterator raw() const; PacketParserBase::data_iterator i() const; static ListParser_Iterator & get(typename Container::policy::iterator_data & d); static ListParser_Iterator const & get(typename Container::policy::iterator_data const & d); private: friend class boost::iterator_core_access; friend class ListParser_Container; value_type dereference() const; bool equal(ListParser_Iterator const & other) const; void increment(); PacketParserBase::data_iterator i_; Container const * c_; }; #ifndef DOXYGEN template struct ListParserPolicy {}; template struct ListParserTraits { template struct parser { typedef senf::ListParser< typename ListParserPolicy::type > type; }; }; # define SENF_PARSER_LIST_I(access, name, size, elt_type) \ SENF_PARSER_REQUIRE_VAR(list) \ SENF_PARSER_COLLECTION_I( access, \ name, \ size, \ senf::detail::ListParserTraits ) #endif }} //-///////////////////////////////////////////////////////////////////////////////////////////////// #endif // Local Variables: // mode: c++ // fill-column: 100 // comment-column: 40 // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" // compile-command: "scons -u test" // End: