14 #define MAX_POSSIBLE_SPECIFIED_OBJECT_TYPES ((sizeof(ED4_level)*8)-1)
55 known_spec[idx] = ospec;
65 return known_spec[index];
92 return objspec_registry;
95 bool ED4_objspec::object_specs_initialized =
false;
96 bool ED4_objspec::descendants_uptodate =
false;
101 object_specs_initialized =
true;
104 void ED4_objspec::calc_descendants()
const {
109 possible_descendants = used_children;
116 if (child_spec && child_spec !=
this) {
118 child_spec->calc_descendants();
119 if (used_children & child_spec->
level) possible_descendants =
ED4_level(possible_descendants|child_spec->possible_descendants);
140 if (spec) spec->calc_descendants();
143 descendants_uptodate =
true;
150 static_prop(static_prop_),
152 allowed_children(allowed_children_),
153 handled_level(handled_level_),
154 restriction_level(restriction_level_)
187 void TEST_objspec_registry() {
#define MAX_POSSIBLE_SPECIFIED_OBJECT_TYPES
#define TEST_REJECT_ZERO(cond)
STATIC_ASSERT(SPECIFIED_OBJECT_TYPES<=MAX_POSSIBLE_SPECIFIED_OBJECT_TYPES)
ED4_properties static_prop
static class ED4_objspec_registry & get_objspec_registry()
int count_registered() const
static void init_object_specs()
bool allowed_to_contain(ED4_level child_level) const
static void recalc_descendants()
#define TEST_EXPECT(cond)
const ED4_objspec * get_object_spec_at_index(int index) const
bool has_manager_that_may_contain(ED4_level lev) const
ED4_level index2level(int index)
ED4_objspec(ED4_properties static_prop_, ED4_level level_, ED4_level allowed_children_, ED4_level handled_level_, ED4_level restriction_level_)
ED4_level get_possible_descendants() const
const ED4_objspec & get_object_spec(ED4_level lev) const
#define TEST_EXPECT_ZERO(cond)
void register_objspec(ED4_objspec *ospec)
int level2index(ED4_level lev)
friend ED4_objspec_registry & get_objspec_registry()
ED4_level allowed_children
ED4_level get_allowed_descendants() const
void announce_added(ED4_level child_level) const
#define TEST_EXPECT_EQUAL(expr, want)
#define SPECIFIED_OBJECT_TYPES