MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / unlinkClass

Method unlinkClass

Engine/source/console/consoleInternal.cpp:985–1018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

983}
984
985bool Namespace::unlinkClass( Namespace *parent )
986{
987 AssertFatal( mPackage == NULL, "Namespace::unlinkClass - Must not be called on a namespace coming from a package!" );
988
989 // Skip additions to this namespace coming from packages.
990
991 Namespace* walk = getPackageRoot();
992
993 // Make sure "parent" is the direct parent namespace.
994
995 if( parent != NULL && walk->mParent && walk->mParent != parent )
996 {
997 Con::errorf(ConsoleLogEntry::General, "Namespace::unlinkClass - cannot unlink namespace parent linkage for %s for %s.",
998 walk->mName, walk->mParent->mName);
999 return false;
1000 }
1001
1002 // Decrease the reference count. Note that we do this on
1003 // the bottom-most namespace, i.e. the one guaranteed not
1004 // to come from a package.
1005
1006 mRefCountToParent --;
1007 AssertFatal( mRefCountToParent >= 0, "Namespace::unlinkClass - reference count to parent is less than 0" );
1008
1009 // Unlink if the count dropped to zero.
1010
1011 if( mRefCountToParent == 0 )
1012 {
1013 walk->mParent = NULL;
1014 trashCache();
1015 }
1016
1017 return true;
1018}
1019
1020
1021bool Namespace::classLinkTo(Namespace *parent)

Callers 2

consoleObject.cppFile · 0.80
unlinkNamespacesFunction · 0.80

Calls 1

errorfFunction · 0.85

Tested by

no test coverage detected