// our assumption of the size of RdataSet holds. If it's not the case
// we should use the bare value instead of the class object.
BOOST_STATIC_ASSERT(sizeof(type) == sizeof(uint16_t));
+
+ // Confirm we meet the alignment requirement for RdataEncoder
+ // ("this + 1" should be safely passed to the encoder).
+ BOOST_STATIC_ASSERT(sizeof(RdataSet) % sizeof(uint16_t) == 0);
}
} // namespace memory
#include <dns/rrset.h>
#include <dns/rrttl.h>
+#include <boost/interprocess/offset_ptr.hpp>
+
#include <stdint.h>
namespace isc {
static void destroy(util::MemorySegment& mem_sgmt, dns::RRClass rrclass,
RdataSet* rdataset);
+ typedef boost::interprocess::offset_ptr<RdataSet> RdataSetPtr;
+ typedef boost::interprocess::offset_ptr<const RdataSet> ConstRdataSetPtr;
+
+ // Note: the size and order of the members are important. Don't change
+ // them unless there's strong reason for that and the consequences are
+ // considered.
+
+ RdataSetPtr next;
const dns::RRType type;
private:
const uint16_t sig_rdata_count : 3;
// would detect any memory leak)
RdataSet* rdataset = RdataSet::create(mem_sgmt_, encoder_, a_rrset_,
ConstRRsetPtr());
+ EXPECT_FALSE(rdataset->next); // by default the next pointer should be NULL
EXPECT_EQ(RRType::A(), rdataset->type);
EXPECT_EQ(RRTTL(1076895760), restoreTTL(rdataset->getTTLData()));
EXPECT_EQ(1, rdataset->getRdataCount());