Handle & handle(); ///< Access handle
void handle(Handle handle); ///< Set handle
/**< Assigning an empty or in-valid() handle will disable
- the module until a new. valid handle is assigned. */
+ the module until a new valid handle is assigned. */
#ifndef DOXYGEN
void replaceHandle(Handle newHandle);
prefix_ bool senf::Packet::is()
const
{
- return ptr()->is<typename OtherPacket::type>();
+ return valid() && ptr()->is<typename OtherPacket::type>();
}
template <class OtherPacket>
SENF_AUTO_UNIT_TEST(packet)
{
+ BOOST_CHECK(! senf::Packet().is<BarPacket>() );
senf::Packet packet (FooPacket::create());
BarPacket::createAfter(packet);
BOOST_REQUIRE( packet );
BOOST_CHECK( packet.next() );
BOOST_CHECK( ! packet.next().next(senf::nothrow) );
+ BOOST_CHECK( ! packet.next().next(senf::nothrow).is<BarPacket>() );
BOOST_CHECK( ! packet.prev(senf::nothrow) );
BOOST_CHECK( packet.next().prev() == packet );
SENF_CHECK_NOT_EQUAL( packet.next(), packet );