@ -61,17 +61,65 @@ const NamedEnumTable< Interface >& interfaceNames();
* to create a more strongly - typed Module Descriptor that carries
* only the necessary information and no variants .
*/
// using Descriptor = QVariantMap;
class Descriptor
{
public :
///@brief an invalid, and empty, descriptor
Descriptor ( ) ;
/** @brief Fills a descriptor from the loaded (YAML) data.
*
*/
static Descriptor fromDescriptorData ( const QVariantMap & moduleDesc ) ;
bool isValid ( ) const { return false ; }
QString name ( ) const { return QString ( ) ; }
Type type ( ) const { return Type : : Job ; }
Interface interface ( ) const { return Interface : : QtPlugin ; }
bool isEmergency ( ) const { return false ; }
bool hasConfig ( ) const { return true ; }
/// @brief The directory where the module.desc lives
QString directory ( ) const { return m_directory ; }
void setDirectory ( const QString & d ) { m_directory = d ; }
QStringList requiredModules ( ) const { return QStringList { } ; }
/** @section C++ Modules
*
* The C + + modules are the most general , and are loaded as
* a shared library after which a suitable factory creates
* objects from them .
*/
/// @brief Short path to the shared-library; no extension.
QString load ( ) const { return QString ( ) ; }
/** @section Process Job modules
*
* Process Jobs are somewhat deprecated in favor of shellprocess
* and contextualprocess jobs , since those handle multiple configuration
* much more gracefully .
*
* Process Jobs execute one command .
*/
/// @brief The command to execute; passed to the shell
QString command ( ) const { return QString ( ) ; }
/// @brief Timeout in seconds
int timeout ( ) const { return 30 ; }
/// @brief Run command in chroot?
bool chroot ( ) const { return false ; }
/** @section Python Job modules
*
* Python job modules have one specific script to load and run .
*/
QString script ( ) const { return QString ( ) ; }
private :
QString m_directory ;
} ;
} // namespace ModuleSystem