00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 #ifndef IH_SENF_Packets_ListNParser_
00027 #define IH_SENF_Packets_ListNParser_ 1
00028
00029
00030 #include "ListParser.ih"
00031
00032
00033
00034 namespace senf {
00035 namespace detail {
00036
00041 template <class ElementParser, class AuxPolicy>
00042 struct ListNParser_Policy
00043 : public AuxPolicy
00044 {
00045 typedef ListNParser_Policy<
00046 ElementParser, typename AuxPolicy::ParserPolicy> parser_policy;
00047 typedef ListNParser_Policy<
00048 ElementParser, typename AuxPolicy::WrapperPolicy> container_policy;
00049 typedef PacketParserBase::data_iterator data_iterator;
00050 typedef PacketParserBase::state_type state_type;
00051 typedef PacketParserBase::size_type size_type;
00052 typedef ElementParser element_type;
00053 typedef ListParser<parser_policy> parser_type;
00054 typedef ListParser_Container<container_policy> container_type;
00055
00056 static const size_type init_bytes = AuxPolicy::aux_bytes;
00057
00058 ListNParser_Policy();
00059 template <class Arg> ListNParser_Policy(Arg const & aux);
00060 ListNParser_Policy(parser_policy const & policy);
00061
00062 size_type bytes (data_iterator i, state_type s) const;
00063 size_type size (data_iterator i, state_type s) const;
00064 void init (data_iterator i, state_type s) const;
00065
00066 void construct (container_type & c) const;
00067 void destruct (container_type & c) const;
00068 void erase (container_type & c, data_iterator p) const;
00069 void insert (container_type & c, data_iterator p) const;
00070 void update (container_type const & c) const;
00071
00073 struct iterator_data {
00074 size_type n_;
00075 };
00076
00077 data_iterator setBegin (container_type const & c, iterator_data & d) const;
00078 data_iterator setEnd (container_type const & c, iterator_data & d) const;
00079 void setFromPosition (container_type const & c, iterator_data & d, data_iterator p) const;
00080 data_iterator next (container_type const & c, iterator_data & d) const;
00081 data_iterator raw (container_type const & c, iterator_data const & d) const;
00082 };
00083
00084 #ifndef DOXYGEN
00085
00086 template <class ElementParser, class AuxPolicy>
00087 struct ListParserPolicy<ElementParser, AuxPolicy, senf::detail::auxtag::none>
00088 {
00089 typedef ListNParser_Policy<ElementParser, AuxPolicy> type;
00090 };
00091
00092 template <class ElementParser, class AuxPolicy, class Transform>
00093 struct ListParserPolicy<ElementParser, AuxPolicy,
00094 senf::detail::auxtag::transform<Transform,
00095 senf::detail::auxtag::none> >
00096 {
00097 typedef ListNParser_Policy< ElementParser,
00098 TransformAuxParserPolicy<AuxPolicy, Transform> > type;
00099 };
00100
00101 #endif
00102
00103 }}
00104
00105
00106 #endif
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117