prefix_ void senf::Packet::reparse()
const
{
- return ptr()->reparse();
+ ptr()->reparse();
}
prefix_ void senf::Packet::clearAnnotations()
{
- return ptr()->clearAnnotations();
+ ptr()->clearAnnotations();
}
template <class PacketType, class Parser>
\internal
The Guard will keep the PacketImpl instance alive during a members execution time
- It the refcount should drop to 0, PacketImpl will be deleted after the member
+ If the refcount should drop to 0, PacketImpl will be deleted after the member
has completed executing.
*/
struct Guard {
senf::PacketInterpreter<PacketType>::create(size_type size, senf::NoInit_t)
{
detail::PacketImpl::Guard p (new detail::PacketImpl(size,0));
- ptr pi (create(p.p,p.p->begin(),p.p->end(),Append));
- return pi;
+ return create(p.p,p.p->begin(),p.p->end(),Append);
}
// Create packet as new packet after a given packet
template <class PacketType>
prefix_ typename senf::PacketInterpreter<PacketType>::ptr
-senf::PacketInterpreter<PacketType>::createAfter(PacketInterpreterBase::ptr packet,
+senf::PacketInterpreter<PacketType>::createAfter(PacketInterpreterBase::ptr const & packet,
size_type size)
{
if (size < initSize())
template <class PacketType>
prefix_ typename senf::PacketInterpreter<PacketType>::ptr
-senf::PacketInterpreter<PacketType>::createAfter(PacketInterpreterBase::ptr packet,
+senf::PacketInterpreter<PacketType>::createAfter(PacketInterpreterBase::ptr const & packet,
size_type size, senf::NoInit_t)
{
optional_range r (packet->nextPacketRange());
template <class PacketType>
template <class ForwardReadableRange>
prefix_ typename senf::PacketInterpreter<PacketType>::ptr
-senf::PacketInterpreter<PacketType>::createAfter(PacketInterpreterBase::ptr packet,
+senf::PacketInterpreter<PacketType>::createAfter(PacketInterpreterBase::ptr const & packet,
ForwardReadableRange const & range)
{
optional_range r (packet->nextPacketRange());
template <class PacketType>
prefix_ typename senf::PacketInterpreter<PacketType>::ptr
-senf::PacketInterpreter<PacketType>::createBefore(PacketInterpreterBase::ptr packet)
+senf::PacketInterpreter<PacketType>::createBefore(PacketInterpreterBase::ptr const & packet)
{
ptr pi (createBefore(packet, senf::noinit));
pi->data().insert(pi->data().begin(),initHeadSize(),byte(0x00u));
template <class PacketType>
prefix_ typename senf::PacketInterpreter<PacketType>::ptr
-senf::PacketInterpreter<PacketType>::createBefore(PacketInterpreterBase::ptr packet, senf::NoInit_t)
+senf::PacketInterpreter<PacketType>::createBefore(PacketInterpreterBase::ptr const & packet, senf::NoInit_t)
{
if (packet->prev())
packet->impl().truncateInterpretersBackwards(packet->prev().get());
template <class PacketType>
prefix_ typename senf::PacketInterpreter<PacketType>::ptr
-senf::PacketInterpreter<PacketType>::createInsertBefore(PacketInterpreterBase::ptr packet)
+senf::PacketInterpreter<PacketType>::createInsertBefore(PacketInterpreterBase::ptr const & packet)
{
ptr pi (createInsertBefore(packet, senf::noinit));
pi->data().insert(pi->data().begin(),initHeadSize(),byte(0x00u));
template <class PacketType>
prefix_ typename senf::PacketInterpreter<PacketType>::ptr
-senf::PacketInterpreter<PacketType>::createInsertBefore(PacketInterpreterBase::ptr packet,
+senf::PacketInterpreter<PacketType>::createInsertBefore(PacketInterpreterBase::ptr const & packet,
senf::NoInit_t)
{
return create(&packet->impl(),packet->data().begin(),packet->data().end(),packet);
template <class ForwardReadableRange>
prefix_ senf::PacketInterpreterBase::ptr
-senf::PacketInterpreterBase::Factory::createAfter(PacketInterpreterBase::ptr packet,
+senf::PacketInterpreterBase::Factory::createAfter(PacketInterpreterBase::ptr const & packet,
ForwardReadableRange const & range)
const
{
template <class PacketType>
prefix_ typename senf::PacketInterpreterBase::ptr
-senf::PacketInterpreter<PacketType>::FactoryImpl::createAfter(PacketInterpreterBase::ptr packet)
+senf::PacketInterpreter<PacketType>::FactoryImpl::createAfter(PacketInterpreterBase::ptr const & packet)
const
{
return senf::PacketInterpreter<PacketType>::createAfter(packet);
template <class PacketType>
prefix_ typename senf::PacketInterpreterBase::ptr
-senf::PacketInterpreter<PacketType>::FactoryImpl::createAfter(PacketInterpreterBase::ptr packet,
+senf::PacketInterpreter<PacketType>::FactoryImpl::createAfter(PacketInterpreterBase::ptr const & packet,
senf::NoInit_t)
const
{
template <class PacketType>
prefix_ typename senf::PacketInterpreterBase::ptr
-senf::PacketInterpreter<PacketType>::FactoryImpl::createAfter(PacketInterpreterBase::ptr packet,
+senf::PacketInterpreter<PacketType>::FactoryImpl::createAfter(PacketInterpreterBase::ptr const & packet,
size_type size)
const
{
template <class PacketType>
prefix_ typename senf::PacketInterpreterBase::ptr
-senf::PacketInterpreter<PacketType>::FactoryImpl::createAfter(PacketInterpreterBase::ptr packet,
+senf::PacketInterpreter<PacketType>::FactoryImpl::createAfter(PacketInterpreterBase::ptr const & packet,
size_type size, senf::NoInit_t)
const
{
template <class PacketType>
prefix_ typename senf::PacketInterpreterBase::ptr
senf::PacketInterpreter<PacketType>::FactoryImpl::
-createBefore(PacketInterpreterBase::ptr packet)
+createBefore(PacketInterpreterBase::ptr const & packet)
const
{
return senf::PacketInterpreter<PacketType>::createBefore(packet);
template <class PacketType>
prefix_ senf::PacketInterpreterBase::ptr
senf::PacketInterpreter<PacketType>::FactoryImpl::
-createBefore(PacketInterpreterBase::ptr packet, senf::NoInit_t)
+createBefore(PacketInterpreterBase::ptr const & packet, senf::NoInit_t)
const
{
return senf::PacketInterpreter<PacketType>::createBefore(packet,senf::noinit);
template <class PacketType>
prefix_ senf::PacketInterpreterBase::ptr
senf::PacketInterpreter<PacketType>::FactoryImpl::
-createInsertBefore(PacketInterpreterBase::ptr packet)
+createInsertBefore(PacketInterpreterBase::ptr const & 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)
+createInsertBefore(PacketInterpreterBase::ptr const & packet, senf::NoInit_t)
const
{
return senf::PacketInterpreter<PacketType>::createInsertBefore(packet,senf::noinit);
template <class PacketType>
prefix_ typename senf::PacketInterpreterBase::ptr
-senf::PacketInterpreter<PacketType>::FactoryImpl::parseNext(PacketInterpreterBase::ptr packet, PacketInterpreterBase::optional_range const & range)
+senf::PacketInterpreter<PacketType>::FactoryImpl::parseNext(PacketInterpreterBase::ptr const & packet, PacketInterpreterBase::optional_range const & range)
const
{
if (!range)
template <class PacketType>
prefix_ typename senf::PacketInterpreter<PacketType>::ptr
-senf::PacketInterpreter<PacketType>::createAfter(PacketInterpreterBase::ptr packet)
+senf::PacketInterpreter<PacketType>::createAfter(PacketInterpreterBase::ptr const & packet)
{
return createAfter(packet, initSize());
}
template <class PacketType>
prefix_ typename senf::PacketInterpreter<PacketType>::ptr
-senf::PacketInterpreter<PacketType>::createAfter(PacketInterpreterBase::ptr packet, senf::NoInit_t)
+senf::PacketInterpreter<PacketType>::createAfter(PacketInterpreterBase::ptr const & packet, senf::NoInit_t)
{
return createAfter(packet, 0, senf::noinit);
}
template <class PacketType>
prefix_ typename senf::PacketInterpreter<PacketType>::ptr
senf::PacketInterpreter<PacketType>::create(detail::PacketImpl * impl, iterator b, iterator e,
- PacketInterpreterBase::ptr before)
+ PacketInterpreterBase::ptr const & before)
{
return ptr(new PacketInterpreter(impl,b,e,before));
}
prefix_
senf::PacketInterpreter<PacketType>::PacketInterpreter(detail::PacketImpl * impl, iterator b,
iterator e,
- PacketInterpreterBase::ptr before)
+ PacketInterpreterBase::ptr const & before)
: PacketInterpreterBase(impl,b,e,before)
{}
// Create packet as new packet after a given packet
- virtual ptr createAfter(PacketInterpreterBase::ptr packet) const = 0;
- virtual ptr createAfter(PacketInterpreterBase::ptr packet, senf::NoInit_t) const = 0;
- virtual ptr createAfter(PacketInterpreterBase::ptr packet, size_type size) const = 0;
- virtual ptr createAfter(PacketInterpreterBase::ptr packet, size_type size,
+ virtual ptr createAfter(PacketInterpreterBase::ptr const & packet) const = 0;
+ virtual ptr createAfter(PacketInterpreterBase::ptr const & packet, senf::NoInit_t) const = 0;
+ virtual ptr createAfter(PacketInterpreterBase::ptr const & packet, size_type size) const = 0;
+ virtual ptr createAfter(PacketInterpreterBase::ptr const & packet, size_type size,
senf::NoInit_t) const = 0;
template <class ForwardReadableRange>
- ptr createAfter(PacketInterpreterBase::ptr packet,
+ ptr createAfter(PacketInterpreterBase::ptr const & packet,
ForwardReadableRange const & range) const;
// Create packet as new packet (header) const before a given packet
- virtual ptr createBefore(PacketInterpreterBase::ptr packet) const = 0;
- virtual ptr createBefore(PacketInterpreterBase::ptr packet, senf::NoInit_t) const = 0;
+ virtual ptr createBefore(PacketInterpreterBase::ptr const & packet) const = 0;
+ virtual ptr createBefore(PacketInterpreterBase::ptr const & packet, senf::NoInit_t) const = 0;
- virtual ptr createInsertBefore(PacketInterpreterBase::ptr packet) const = 0;
- virtual ptr createInsertBefore(PacketInterpreterBase::ptr packet, senf::NoInit_t) const = 0;
+ virtual ptr createInsertBefore(PacketInterpreterBase::ptr const & packet) const = 0;
+ virtual ptr createInsertBefore(PacketInterpreterBase::ptr const & packet, senf::NoInit_t) const = 0;
// Parse next packet in chain
- virtual ptr parseNext(ptr packet, PacketInterpreterBase::optional_range const & range) const = 0;
+ virtual ptr parseNext(ptr const & packet, PacketInterpreterBase::optional_range const & range) const = 0;
};
typedef Factory const * factory_t;
virtual ~PacketInterpreterBase();
- static factory_t no_factory();
+ static factory_t no_factory();
ptr clone();
// Create packet as new packet after a given packet
- static ptr createAfter(PacketInterpreterBase::ptr packet);
- static ptr createAfter(PacketInterpreterBase::ptr packet, senf::NoInit_t);
- static ptr createAfter(PacketInterpreterBase::ptr packet, size_type size);
- static ptr createAfter(PacketInterpreterBase::ptr packet, size_type size, senf::NoInit_t);
+ static ptr createAfter(PacketInterpreterBase::ptr const & packet);
+ static ptr createAfter(PacketInterpreterBase::ptr const & packet, senf::NoInit_t);
+ static ptr createAfter(PacketInterpreterBase::ptr const & packet, size_type size);
+ static ptr createAfter(PacketInterpreterBase::ptr const & packet, size_type size, senf::NoInit_t);
template <class ForwardReadableRange>
- static ptr createAfter(PacketInterpreterBase::ptr packet,
+ static ptr createAfter(PacketInterpreterBase::ptr const & packet,
ForwardReadableRange const & range);
// Create packet as new packet (header) before a given packet
- static ptr createBefore(PacketInterpreterBase::ptr packet);
- static ptr createBefore(PacketInterpreterBase::ptr packet, senf::NoInit_t);
+ static ptr createBefore(PacketInterpreterBase::ptr const & spacket);
+ static ptr createBefore(PacketInterpreterBase::ptr const & packet, senf::NoInit_t);
- static ptr createInsertBefore(PacketInterpreterBase::ptr packet);
- static ptr createInsertBefore(PacketInterpreterBase::ptr packet, senf::NoInit_t);
+ static ptr createInsertBefore(PacketInterpreterBase::ptr const & packet);
+ static ptr createInsertBefore(PacketInterpreterBase::ptr const & packet, senf::NoInit_t);
// Create a clone of the current packet
PacketInterpreter(detail::PacketImpl * impl, iterator b, iterator e, Append_t);
PacketInterpreter(detail::PacketImpl * impl, iterator b, iterator e, Prepend_t);
PacketInterpreter(detail::PacketImpl * impl, iterator b, iterator e,
- PacketInterpreterBase::ptr before);
+ PacketInterpreterBase::ptr const & before);
static ptr create(detail::PacketImpl * impl, iterator b, iterator e, Append_t);
static ptr create(detail::PacketImpl * impl, iterator b, iterator e, Prepend_t);
static ptr create(detail::PacketImpl * impl, iterator b, iterator e,
- PacketInterpreterBase::ptr before);
+ PacketInterpreterBase::ptr const & before);
// PacketType access
// Create packet as new packet after a given packet
- virtual PacketInterpreterBase::ptr createAfter(PacketInterpreterBase::ptr packet)
+ virtual PacketInterpreterBase::ptr createAfter(PacketInterpreterBase::ptr const & packet)
const;
- virtual PacketInterpreterBase::ptr createAfter(PacketInterpreterBase::ptr packet,
+ virtual PacketInterpreterBase::ptr createAfter(PacketInterpreterBase::ptr const & packet,
senf::NoInit_t) const;
- virtual PacketInterpreterBase::ptr createAfter(PacketInterpreterBase::ptr packet,
+ virtual PacketInterpreterBase::ptr createAfter(PacketInterpreterBase::ptr const & packet,
size_type size) const;
- virtual PacketInterpreterBase::ptr createAfter(PacketInterpreterBase::ptr packet,
+ virtual PacketInterpreterBase::ptr createAfter(PacketInterpreterBase::ptr const & packet,
size_type size, senf::NoInit_t) const;
// Create packet as new packet (header) before a given packet
- virtual PacketInterpreterBase::ptr createBefore(PacketInterpreterBase::ptr packet)
+ virtual PacketInterpreterBase::ptr createBefore(PacketInterpreterBase::ptr const & packet)
const;
- virtual PacketInterpreterBase::ptr createBefore(PacketInterpreterBase::ptr packet,
+ virtual PacketInterpreterBase::ptr createBefore(PacketInterpreterBase::ptr const & packet,
senf::NoInit_t)
const;
- virtual PacketInterpreterBase::ptr createInsertBefore(PacketInterpreterBase::ptr packet)
+ virtual PacketInterpreterBase::ptr createInsertBefore(PacketInterpreterBase::ptr const & packet)
const;
- virtual PacketInterpreterBase::ptr createInsertBefore(PacketInterpreterBase::ptr packet,
+ virtual PacketInterpreterBase::ptr createInsertBefore(PacketInterpreterBase::ptr const & packet,
senf::NoInit_t)
const;
// Parse next packet in chain
- virtual PacketInterpreterBase::ptr parseNext(PacketInterpreterBase::ptr packet, PacketInterpreterBase::optional_range const & range)
+ virtual PacketInterpreterBase::ptr parseNext(PacketInterpreterBase::ptr const & packet, PacketInterpreterBase::optional_range const & range)
const;
};