Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Static Public Member Functions
CppExport::ExportHelpers Class Reference

Public Types

enum class  QualificationType { ParentClass , Using }
 

Static Public Member Functions

static CodeCompositeapiInclude (Model::Node *node)
 
static QString exportFlag (Model::Node *node)
 
static OOModel::DeclarationfirstValidAncestorPrintContext (Model::Node *node)
 
static bool isInHeader (OOModel::Method *method, CppPrintContext &printContext)
 
static bool isSignalingDeclaration (OOModel::Declaration *declaration)
 
static bool methodSignaturesMatch (OOModel::Method *method, OOModel::Method *other)
 
static OOModel::ModuleparentNamespaceModule (Model::Node *node)
 
static QString pluginName (Model::Node *node)
 
static bool printDeclarationQualifier (QualificationType qualification, Export::CompositeFragment *fragment, OOModel::Declaration *from, OOModel::Class *parentClass, Model::Node *to, bool printTypename=false)
 Adds additional qualifications for references, if needed. More...
 
static bool shouldExportMethod (OOModel::Method *method, bool isHeaderVisitor, bool isSourceVisitor)
 used to prevent exporting of declarations already provided in a meta call of the parent. More...
 
static QString strip_CPPFromName (Model::Node *node)
 
template<typename T >
static QList< T * > topologicalSort (QHash< T *, QSet< T * >> dependsOn, std::function< T *(QList< T * > &, T *)> selector=nullptr)
 

Member Enumeration Documentation

◆ QualificationType

Enumerator
ParentClass 
Using 

Member Function Documentation

◆ apiInclude()

CodeComposite * CppExport::ExportHelpers::apiInclude ( Model::Node node)
static

◆ exportFlag()

QString CppExport::ExportHelpers::exportFlag ( Model::Node node)
static

◆ firstValidAncestorPrintContext()

OOModel::Declaration * CppExport::ExportHelpers::firstValidAncestorPrintContext ( Model::Node node)
static

◆ isInHeader()

bool CppExport::ExportHelpers::isInHeader ( OOModel::Method method,
CppPrintContext printContext 
)
static

◆ isSignalingDeclaration()

bool CppExport::ExportHelpers::isSignalingDeclaration ( OOModel::Declaration declaration)
static

◆ methodSignaturesMatch()

bool CppExport::ExportHelpers::methodSignaturesMatch ( OOModel::Method method,
OOModel::Method other 
)
static

◆ parentNamespaceModule()

OOModel::Module * CppExport::ExportHelpers::parentNamespaceModule ( Model::Node node)
static

◆ pluginName()

QString CppExport::ExportHelpers::pluginName ( Model::Node node)
static

◆ printDeclarationQualifier()

bool CppExport::ExportHelpers::printDeclarationQualifier ( QualificationType  qualification,
Export::CompositeFragment fragment,
OOModel::Declaration from,
OOModel::Class parentClass,
Model::Node to,
bool  printTypename = false 
)
static

Adds additional qualifications for references, if needed.

Returns true if any qualifications were added.

There are two cases where references need additional qualifications:

  • Printing result types and field types in the cpp file, when these are outside of the scope of the class but refer to class members.
  • Printing types in a header file, when the cpp file has a using namespace declaration.

Note that the type is exclusive, either one or the other qualification is applied.

parentClass is the parent class that should be considered for parentClass qualifications. This is needed in order to also consider all classes from which parentClass inherits, as their scopes also provide accessible symbols.

◆ shouldExportMethod()

bool CppExport::ExportHelpers::shouldExportMethod ( OOModel::Method method,
bool  isHeaderVisitor,
bool  isSourceVisitor 
)
static

used to prevent exporting of declarations already provided in a meta call of the parent.

◆ strip_CPPFromName()

QString CppExport::ExportHelpers::strip_CPPFromName ( Model::Node node)
static

◆ topologicalSort()

template<typename T >
QList< T * > CppExport::ExportHelpers::topologicalSort ( QHash< T *, QSet< T * >>  dependsOn,
std::function< T *(QList< T * > &, T *)>  selector = nullptr 
)
static