Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
InformationScripting::QueryRegistry Class Reference

Public Types

enum class  ExtraArguments : int { Default , QueryExecutor }
 

Public Member Functions

QStringList aliasQueries () const
 
std::unique_ptr< QuerybuildQuery (const QString &command, Model::Node *target, QStringList args, QueryExecutor *executor)
 
QStringList registeredQueries () const
 
QStringList scriptQueries () const
 

Static Public Member Functions

static QueryRegistryinstance ()
 
template<typename QueryType , typename ... ForwardArguments>
static void registerQuery (const QString &name, ForwardArguments... forwardArguments)
 
template<typename QueryType , ExtraArguments extras, class ... ForwardArguments>
static void registerQuery (const QString &name, ForwardArguments... forwardArguments)
 

Private Types

using QueryConstructor = std::function< std::unique_ptr< Query >(Model::Node *, QStringList, QueryExecutor *, QString)>
 

Private Member Functions

 QueryRegistry ()=default
 
std::unique_ptr< QuerytryBuildQueryFromAlias (const QString &name, Model::Node *target, QStringList args, QueryExecutor *executor)
 
std::unique_ptr< QuerytryBuildQueryFromScript (const QString &name, Model::Node *target, QStringList args, QueryExecutor *executor)
 

Private Attributes

QHash< QString, QueryConstructorconstructors_
 
QString scriptLocation_ {"scripts/"}
 

Member Typedef Documentation

◆ QueryConstructor

using InformationScripting::QueryRegistry::QueryConstructor = std::function<std::unique_ptr<Query> (Model::Node*, QStringList, QueryExecutor*, QString)>
private

Member Enumeration Documentation

◆ ExtraArguments

Enumerator
Default 
QueryExecutor 

Constructor & Destructor Documentation

◆ QueryRegistry()

InformationScripting::QueryRegistry::QueryRegistry ( )
privatedefault

Member Function Documentation

◆ aliasQueries()

QStringList InformationScripting::QueryRegistry::aliasQueries ( ) const

◆ buildQuery()

std::unique_ptr< Query > InformationScripting::QueryRegistry::buildQuery ( const QString &  command,
Model::Node target,
QStringList  args,
QueryExecutor executor 
)

◆ instance()

QueryRegistry & InformationScripting::QueryRegistry::instance ( )
static

◆ registeredQueries()

QStringList InformationScripting::QueryRegistry::registeredQueries ( ) const
inline

◆ registerQuery() [1/2]

template<typename QueryType , typename ... ForwardArguments>
void InformationScripting::QueryRegistry::registerQuery ( const QString &  name,
ForwardArguments...  forwardArguments 
)
inlinestatic

◆ registerQuery() [2/2]

template<typename QueryType , QueryRegistry::ExtraArguments extras, class ... ForwardArguments>
void InformationScripting::QueryRegistry::registerQuery ( const QString &  name,
ForwardArguments...  forwardArguments 
)
inlinestatic

◆ scriptQueries()

QStringList InformationScripting::QueryRegistry::scriptQueries ( ) const

◆ tryBuildQueryFromAlias()

std::unique_ptr< Query > InformationScripting::QueryRegistry::tryBuildQueryFromAlias ( const QString &  name,
Model::Node target,
QStringList  args,
QueryExecutor executor 
)
private

◆ tryBuildQueryFromScript()

std::unique_ptr< Query > InformationScripting::QueryRegistry::tryBuildQueryFromScript ( const QString &  name,
Model::Node target,
QStringList  args,
QueryExecutor executor 
)
private

Member Data Documentation

◆ constructors_

QHash<QString, QueryConstructor> InformationScripting::QueryRegistry::constructors_
private

◆ scriptLocation_

QString InformationScripting::QueryRegistry::scriptLocation_ {"scripts/"}
private