Merge pull request #19583 from hyarion/refactor/base-type

Refactor Base::Type
This commit is contained in:
Chris Hennes
2025-03-17 00:03:22 -05:00
committed by GitHub
23 changed files with 174 additions and 159 deletions

View File

@@ -57,11 +57,11 @@ App::PropertyData App::Extension::propertyData;
void App::Extension::init()
{
assert(Extension::classTypeId == Base::Type::badType() && "don't init() twice!");
assert(Extension::classTypeId.isBad() && "don't init() twice!");
/* Set up entry in the type system. */
Extension::classTypeId =
Base::Type::createType(Base::Type::badType(), "App::Extension", Extension::create);
Base::Type::createType(Base::Type::BadType, "App::Extension", Extension::create);
}
using namespace App;
@@ -194,11 +194,11 @@ void Extension::initExtensionSubclass(Base::Type& toInit,
Base::Type::instantiationMethod method)
{
// don't init twice!
assert(toInit == Base::Type::badType());
assert(toInit.isBad());
// get the parent class
Base::Type parentType(Base::Type::fromName(ParentName));
// forgot init parent!
assert(parentType != Base::Type::badType());
assert(!parentType.isBad());
// create the new type
toInit = Base::Type::createType(parentType, ClassName, method);