19 #include <boost/test/unit_test.hpp>
20 #include <boost/cstdint.hpp>
26 BOOST_AUTO_TEST_SUITE(common)
34 boost::uint32_t key0 = 0;
35 boost::uint32_t key1 = 1;
36 boost::uint32_t innerkey = 2;
38 boost::uint32_t value0 = 42;
39 boost::uint32_t innervalue = 99;
52 boost::uint32_t val0 = boost::any_cast<boost::uint32_t>(outer.
getAnnotation(key0));
53 BOOST_CHECK_EQUAL(val0, value0);
55 BOOST_CHECK_EQUAL(boost::any_cast<boost::uint32_t>((boost::any_cast<Annotated>(
56 outer.
getAnnotation(key1))).getAnnotation(innerkey)), innervalue);
63 BOOST_AUTO_TEST_SUITE_END()
void setAnnotation(uint32 inKey, boost::any inValue)
Set an annotation.
boost::any getAnnotation(uint32 inKey)
Get an annotation. Returns an empty annotation if the index doesn't exist.
Header for the Annotated class.
BOOST_AUTO_TEST_CASE(AnnotatedUnitTest)
Unit test for the Annotated class.
bool hasAnnotation(uint32 inKey)
Check if an annotation exists.
void removeAnnotation(uint32 inKey)
Remove an annotation.
Concept for any object that can be annotated.