17 #ifndef HH_SENF_Packets_PacketInterpreter_ 18 #define HH_SENF_Packets_PacketInterpreter_ 1 21 #include <boost/optional.hpp> 22 #include <boost/range/iterator_range.hpp> 66 typedef boost::iterator_range<iterator>
range;
86 virtual ptr
create()
const = 0;
90 template <
class ForwardReadableRange>
91 ptr
create(ForwardReadableRange
const & range)
const;
92 virtual ptr
create(byte *
data, size_type size, size_type chunkSize = 0u,
93 size_type offset = 0u) = 0;
102 template <
class ForwardReadableRange>
104 ForwardReadableRange
const & range)
const;
146 template <
class Type>
149 template <
class Type>
156 template <
class Type>
172 template <
class Annotation>
214 virtual optional_range v_nextPacketRange() = 0;
217 virtual void v_finalize() = 0;
218 virtual void v_dump(std::ostream & os) = 0;
220 virtual factory_t v_factory() = 0;
221 virtual factory_t v_nextPacketType() = 0;
236 friend struct detail::packet::test::TestDriver;
253 template <
class PacketType>
282 template <
class ForwardReadableRange>
283 static ptr
create(ForwardReadableRange
const &
range);
294 template <
class ForwardReadableRange>
296 ForwardReadableRange
const &
range);
349 virtual void v_finalize();
350 virtual void v_dump(std::ostream & os);
363 struct FactoryImpl :
public Factory {
406 friend struct detail::packet::test::TestDriver;
408 friend struct FactoryImpl;
423 #if !defined(HH_SENF_Packets_Packets__decls_) && !defined(HH_SENF_Packets_PacketInterpreter_i_) 424 #define HH_SENF_Packets_PacketInterpreter_i_
void dump(std::ostream &os, DumpPacketAnnotations_t dumpAnnotationsSwitch)
static factory_t no_factory()
Internal: Abstract packet factory.
senf::detail::packet::smart_pointer< PacketInterpreter >::ptr_t ptr
detail::PacketImpl & impl() const
PacketInterpreterBase * nextP()
PacketData public header.
senf::detail::packet::iterator iterator
PacketInterpreter< Type >::ptr parseNextAs()
void intrusive_ptr_add_ref(PacketInterpreterBase const *p)
virtual ptr createAfter(PacketInterpreterBase::ptr const &packet) const =0
Internal: Concrete packet interpreter.
senf::detail::packet::difference_type difference_type
Internal: Base packet interpreter class.
Annotation & annotation()
void finalizeTo(ptr other)
virtual ptr create() const =0
PacketInterpreter< Type >::ptr as()
virtual ptr createInsertBefore(PacketInterpreterBase::ptr const &packet) const =0
raw_container::const_iterator const_iterator
InvalidPacketChainException()
virtual ~PacketInterpreterBase()
boost::intrusive::list_base_hook< boost::intrusive::tag< interpreter_list_tag > > interpreter_list_base
Invalid packet chain operation.
Packet data STL-sequence view.
raw_container::size_type size_type
Internal: Packet data storage.
virtual ptr createBefore(PacketInterpreterBase::ptr const &packet) const =0
raw_container::iterator iterator
senf::detail::packet::smart_pointer< PacketInterpreterBase >::ptr_t ptr
senf::detail::packet::byte byte
ptr appendClone(detail::PacketImpl *impl, iterator base, iterator new_base)
senf::detail::packet::size_type size_type
Internal: Template typedef for used smart pointer.
size_type size() const
Returns the number of bytes in the packet data.
raw_container::difference_type difference_type
boost::intrusive_ptr< T > ptr_t
virtual ptr parseNext(ptr const &packet, PacketInterpreterBase::optional_range const &range) const =0
boost::optional< range > optional_range
senf::detail::packet::size_type size_type
void intrusive_ptr_release(PacketInterpreterBase const *p)
PacketInterpreterBase * prevP()
factory_t nextPacketType()
boost::iterator_range< iterator > range
senf::detail::packet::byte byte
void memDebug(std::ostream &os)
friend class PacketInterpreter
PacketInterpreter< Type >::ptr replaceAs(difference_type offset, difference_type tailOffset)
PacketInterpreterBase(detail::PacketImpl *impl, iterator b, iterator e, Append_t)
senf::detail::packet::const_iterator const_iterator
optional_range nextPacketRange()
Factory const * factory_t
senf::detail::packet::iterator iterator