Drop the (inter-)module dependencies system.

- Was marked incomplete and unused; none of the existing modules
   set any requirements, and the descriptors are not set up to
   hold the requirements information anyway.
 - Dependencies are generally through globalStorage values, or if
   there are dependent jobs they should be created in-order by one
   source (e.g. though a View or a subclass of CppJob which overrides
   jobs() ).
 - It is the responsibility of deployers to formulate a settings.conf
   that includes all the required modules.
 - A 'real' dependency system is going to lead to the introduction
   of interface-definitions and a great deal of complexity, for a
   use case that can be handled with careful deployment instead.
This commit is contained in:
Adriaan de Groot 2017-09-27 05:34:06 -04:00
parent d2cce926de
commit 8917d153da
4 changed files with 2 additions and 52 deletions

View File

@ -233,13 +233,6 @@ Module::instanceKey() const
} }
QStringList
Module::requiredModules() const
{
return m_requiredModules;
}
QString QString
Module::location() const Module::location() const
{ {

View File

@ -106,13 +106,6 @@ public:
*/ */
virtual QString instanceKey() const final; virtual QString instanceKey() const final;
/**
* @brief requiredModules a list of names of modules required by this one.
* @return the list of names.
* The module dependencies system is currently incomplete and unused.
*/
virtual QStringList requiredModules() const;
/** /**
* @brief location returns the full path of this module's directory. * @brief location returns the full path of this module's directory.
* @return the path. * @return the path.
@ -176,8 +169,8 @@ protected:
private: private:
void loadConfigurationFile( const QString& configFileName ); //throws YAML::Exception void loadConfigurationFile( const QString& configFileName ); //throws YAML::Exception
QString m_name; QString m_name;
QStringList m_requiredModules;
QString m_directory; QString m_directory;
QString m_instanceId; QString m_instanceId;

View File

@ -150,9 +150,6 @@ ModuleManager::doInit()
cDebug() << "ModuleManager bad search path" << path; cDebug() << "ModuleManager bad search path" << path;
} }
} }
// At this point m_availableModules is filled with whatever was found in the
// search paths.
checkDependencies();
emit initDone(); emit initDone();
} }
@ -318,35 +315,4 @@ ModuleManager::loadModules()
} ); } );
} }
} // namespace
void
ModuleManager::checkDependencies()
{
// This goes through the map of available modules, and deletes those whose
// dependencies are not met, if any.
bool somethingWasRemovedBecauseOfUnmetDependencies = false;
forever
{
for ( auto it = m_availableDescriptorsByModuleName.begin();
it != m_availableDescriptorsByModuleName.end(); ++it )
{
foreach ( const QString& depName,
(*it).value( "requiredModules" ).toStringList() )
{
if ( !m_availableDescriptorsByModuleName.contains( depName ) )
{
somethingWasRemovedBecauseOfUnmetDependencies = true;
m_availableDescriptorsByModuleName.erase( it );
break;
}
}
if ( somethingWasRemovedBecauseOfUnmetDependencies )
break;
}
if ( !somethingWasRemovedBecauseOfUnmetDependencies )
break;
}
}
}

View File

@ -88,8 +88,6 @@ private slots:
void doInit(); void doInit();
private: private:
void checkDependencies();
QMap< QString, QVariantMap > m_availableDescriptorsByModuleName; QMap< QString, QVariantMap > m_availableDescriptorsByModuleName;
QMap< QString, QString > m_moduleDirectoriesByModuleName; QMap< QString, QString > m_moduleDirectoriesByModuleName;
QMap< QString, Module* > m_loadedModulesByInstanceKey; QMap< QString, Module* > m_loadedModulesByInstanceKey;