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:
parent
d2cce926de
commit
8917d153da
@ -233,13 +233,6 @@ Module::instanceKey() const
|
||||
}
|
||||
|
||||
|
||||
QStringList
|
||||
Module::requiredModules() const
|
||||
{
|
||||
return m_requiredModules;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Module::location() const
|
||||
{
|
||||
|
@ -106,13 +106,6 @@ public:
|
||||
*/
|
||||
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.
|
||||
* @return the path.
|
||||
@ -176,8 +169,8 @@ protected:
|
||||
|
||||
private:
|
||||
void loadConfigurationFile( const QString& configFileName ); //throws YAML::Exception
|
||||
|
||||
QString m_name;
|
||||
QStringList m_requiredModules;
|
||||
QString m_directory;
|
||||
QString m_instanceId;
|
||||
|
||||
|
@ -150,9 +150,6 @@ ModuleManager::doInit()
|
||||
cDebug() << "ModuleManager bad search path" << path;
|
||||
}
|
||||
}
|
||||
// At this point m_availableModules is filled with whatever was found in the
|
||||
// search paths.
|
||||
checkDependencies();
|
||||
emit initDone();
|
||||
}
|
||||
|
||||
@ -318,35 +315,4 @@ ModuleManager::loadModules()
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // namespace
|
||||
|
@ -88,8 +88,6 @@ private slots:
|
||||
void doInit();
|
||||
|
||||
private:
|
||||
void checkDependencies();
|
||||
|
||||
QMap< QString, QVariantMap > m_availableDescriptorsByModuleName;
|
||||
QMap< QString, QString > m_moduleDirectoriesByModuleName;
|
||||
QMap< QString, Module* > m_loadedModulesByInstanceKey;
|
||||
|
Loading…
Reference in New Issue
Block a user