simplify TYPE_CONSTANT code
This commit is contained in:
@@ -102,7 +102,7 @@ public:
|
||||
if ( !globalModuleServer().getError() ) {
|
||||
if ( string_equal( names, "*" ) ) {
|
||||
InsertModules<Type> visitor( m_modules );
|
||||
globalModuleServer().foreachModule( typename Type::Name(), typename Type::Version(), visitor );
|
||||
globalModuleServer().foreachModule( Type::Name, Type::Version, visitor );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -113,11 +113,11 @@ public:
|
||||
if ( string_empty( name ) ) {
|
||||
break;
|
||||
}
|
||||
Module* module = globalModuleServer().findModule( typename Type::Name(), typename Type::Version(), name );
|
||||
Module* module = globalModuleServer().findModule( Type::Name, Type::Version, name );
|
||||
if ( module == 0 ) {
|
||||
globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted( typename Type::Name() ) << " version=" << makeQuoted( typename Type::Version() ) << " name=" << makeQuoted( name ) << " - not found\n";
|
||||
globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted( Type::Name ) << " version=" << makeQuoted( Type::Version ) << " name=" << makeQuoted( name ) << " - not found\n";
|
||||
// do not fail on missing image or model plugin, they can be optional
|
||||
if ( !string_equal( typename Type::Name(), "image" ) && !string_equal( typename Type::Name(), "model" ) ){
|
||||
if ( !string_equal( Type::Name, "image" ) && !string_equal( Type::Name, "model" ) ){
|
||||
globalModuleServer().setError( true );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class DefaultAPIConstructor
|
||||
{
|
||||
public:
|
||||
const char* getName(){
|
||||
return typename API::Name();
|
||||
return API::Name;
|
||||
}
|
||||
|
||||
API* constructAPI( Dependencies& dependencies ){
|
||||
@@ -49,7 +49,7 @@ class DependenciesAPIConstructor
|
||||
{
|
||||
public:
|
||||
const char* getName(){
|
||||
return typename API::Name();
|
||||
return API::Name;
|
||||
}
|
||||
|
||||
API* constructAPI( Dependencies& dependencies ){
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
}
|
||||
|
||||
void selfRegister(){
|
||||
globalModuleServer().registerModule( typename Type::Name(), typename Type::Version(), APIConstructor::getName(), *this );
|
||||
globalModuleServer().registerModule( Type::Name, Type::Version, APIConstructor::getName(), *this );
|
||||
}
|
||||
|
||||
Dependencies& getDependencies(){
|
||||
@@ -101,16 +101,16 @@ public:
|
||||
}
|
||||
void capture(){
|
||||
if ( ++m_refcount == 1 ) {
|
||||
globalOutputStream() << "Module Initialising: '" << typename Type::Name() << "' '" << APIConstructor::getName() << "'\n";
|
||||
globalOutputStream() << "Module Initialising: '" << Type::Name << "' '" << APIConstructor::getName() << "'\n";
|
||||
m_dependencies = new Dependencies();
|
||||
m_dependencyCheck = !globalModuleServer().getError();
|
||||
if ( m_dependencyCheck ) {
|
||||
m_api = APIConstructor::constructAPI( *m_dependencies );
|
||||
globalOutputStream() << "Module Ready: '" << typename Type::Name() << "' '" << APIConstructor::getName() << "'\n";
|
||||
globalOutputStream() << "Module Ready: '" << Type::Name << "' '" << APIConstructor::getName() << "'\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
globalErrorStream() << "Module Dependencies Failed: '" << typename Type::Name() << "' '" << APIConstructor::getName() << "'\n";
|
||||
globalErrorStream() << "Module Dependencies Failed: '" << Type::Name << "' '" << APIConstructor::getName() << "'\n";
|
||||
}
|
||||
m_cycleCheck = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user