optional_range r (nextPacketRange());
if (!r)
throw InvalidPacketChainException();
-
+
if (next())
impl().truncateInterpreters(next().get());
- typename PacketInterpreter<Type>::ptr pi
+ typename PacketInterpreter<Type>::ptr pi
(PacketInterpreter<Type>::create(&impl(),r->begin(),r->end(),Append));
return pi;
}
optional_range r (packet->nextPacketRange());
if (!r)
throw InvalidPacketChainException();
-
+
if (packet->next())
packet->impl().truncateInterpreters(packet->next().get());
{
if (packet->prev())
packet->impl().truncateInterpretersBackwards(packet->prev().get());
-
+
return create(&packet->impl(),packet->data().begin(),packet->data().end(),Prepend);
}
+template <class PacketType>
+prefix_ typename senf::PacketInterpreter<PacketType>::ptr
+senf::PacketInterpreter<PacketType>::createInsertBefore(PacketInterpreterBase::ptr packet)
+{
+ ptr pi (createInsertBefore(packet, senf::noinit));
+ pi->data().insert(pi->data().begin(),initHeadSize(),byte(0x00u));
+ pi->data().insert(pi->data().end(),initSize()-initHeadSize(),byte(0x00u));
+ pi->init();
+ return pi;
+}
+
+template <class PacketType>
+prefix_ typename senf::PacketInterpreter<PacketType>::ptr
+senf::PacketInterpreter<PacketType>::createInsertBefore(PacketInterpreterBase::ptr packet,
+ senf::NoInit_t)
+{
+ return create(&packet->impl(),packet->data().begin(),packet->data().end(),packet);
+}
+
////////////////////////////////////////
// private members
return senf::PacketInterpreter<PacketType>::createBefore(packet,senf::noinit);
}
+template <class PacketType>
+prefix_ senf::PacketInterpreterBase::ptr
+senf::PacketInterpreter<PacketType>::FactoryImpl::
+createInsertBefore(PacketInterpreterBase::ptr packet)
+ const
+{
+ return senf::PacketInterpreter<PacketType>::createInsertBefore(packet);
+}
+
+template <class PacketType>
+prefix_ senf::PacketInterpreterBase::ptr
+senf::PacketInterpreter<PacketType>::FactoryImpl::
+createInsertBefore(PacketInterpreterBase::ptr packet, senf::NoInit_t)
+ const
+{
+ return senf::PacketInterpreter<PacketType>::createInsertBefore(packet,senf::noinit);
+}
+
// Parse next packet in chain
template <class PacketType>
optional_range r (packet->nextPacketRange());
if (!r)
throw InvalidPacketChainException();
-
+
if (packet->next())
packet->impl().truncateInterpreters(packet->next().get());
}
template <class PacketType>
-const typename senf::PacketInterpreter<PacketType>::FactoryImpl
+const typename senf::PacketInterpreter<PacketType>::FactoryImpl
senf::PacketInterpreter<PacketType>::factory_;
///////////////////////////////ct.e////////////////////////////////////////