copy_retrieved_options_ = copy;
}
+ /// @brief Returns whether the copying of retrieved options is enabled.
+ ///
+ /// Also see @ref setCopyRetrievedOptions.
+ ///
+ /// @return true if retrieved options are copied.
+ bool isCopyRetrievedOptions() const {
+ return (copy_retrieved_options_);
+ }
+
/// @brief Update packet timestamp.
///
/// Updates packet timestamp. This method is invoked
// Now force copying the options when they are retrieved.
pkt->setCopyRetrievedOptions(true);
+ EXPECT_TRUE(pkt->isCopyRetrievedOptions());
// Option pointer returned must point to a new instance of option 2.
OptionPtr option2_copy = pkt->getOption(2);
// Disable copying.
pkt->setCopyRetrievedOptions(false);
+ EXPECT_FALSE(pkt->isCopyRetrievedOptions());
// Expect that the original pointer is returned. This guarantees that
// option1 wasn't affected by copying option 2.