X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacket.cci;h=6e9d735441167a626f27d739c6cdb32c6ad561dd;hb=87204d50de0c429f265aec817bc9efd9af816082;hp=35bd9313e23c1910a5a6f888f87cc48eae4da03f;hpb=078c34233b7d5ca7f9fd9dfb77568f840ad41915;p=senf.git diff --git a/Packets/Packet.cci b/Packets/Packet.cci index 35bd931..6e9d735 100644 --- a/Packets/Packet.cci +++ b/Packets/Packet.cci @@ -108,7 +108,7 @@ prefix_ senf::Packet senf::Packet::parseNextAs(factory_t factory) return Packet(ptr()->parseNextAs(factory)); } -prefix_ senf::Packet senf::Packet::append(Packet packet) +prefix_ senf::Packet senf::Packet::append(Packet const & packet) const { return Packet(ptr()->append(packet.ptr())); @@ -131,7 +131,7 @@ prefix_ senf::Packet::size_type senf::Packet::size() // Other methods -prefix_ bool senf::Packet::operator==(Packet other) +prefix_ bool senf::Packet::operator==(Packet const & other) const { return ptr() == other.ptr(); @@ -142,7 +142,7 @@ prefix_ void senf::Packet::finalizeThis() ptr()->finalizeThis(); } -prefix_ void senf::Packet::finalizeTo(Packet other) +prefix_ void senf::Packet::finalizeTo(Packet const & other) { ptr()->finalizeTo(other.ptr()); } @@ -171,12 +171,31 @@ prefix_ senf::Packet::factory_t senf::Packet::factory() return ptr()->factory(); } +prefix_ unsigned long senf::Packet::id() + const +{ + return reinterpret_cast(&ptr()->impl()); +} + prefix_ bool senf::Packet::boolean_test() const { return packet_ && packet_->valid(); } +prefix_ bool senf::Packet::valid() + const +{ + return *this; +} + +template +prefix_ Parser senf::operator<<(Parser target, ConcretePacket const & packet) +{ + target << packet.parser(); + return target; +} + ///////////////////////////////cci.e/////////////////////////////////////// #undef prefix_