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

Public Member Functions

 CodeUnitPart (CodeUnit *parent)
 
void calculateDependencies (QList< CodeUnit * > &allUnits)
 
QSet< CodeUnitPart * > dependencies () const
 
QSet< CodeUnitPart * > dependenciesWithinFile (QList< CodeUnit * > units)
 
Export::SourceFragmentfragment () const
 
bool isSourceFragmentEmpty () const
 returns whether there is at least one text fragment inside sourceFragment. More...
 
const QSet< Model::Node * > & nameNodes () const
 
CodeUnitparent () const
 
const QSet< OOModel::ReferenceExpression * > & referenceNodes () const
 
void setFragment (Export::SourceFragment *sourceFragment)
 
QSet< DependencyTargetsoftDependencies () const
 

Private Member Functions

void assertForcedDependencyNecessary (OOModel::ReferenceExpression *reference)
 checks whether the provided reference is "Type" in constructs of the form: (void)(Type*)nullptr; this construct is used to force dependencies when Envision's reference resolution system is not yet good enough to properly detect the dependency, causing the export to C++ to omit a necessary #include. More...
 

Static Private Member Functions

static Model::NodefixedTarget (OOModel::ReferenceExpression *referenceExpression)
 
static bool isNameOnlyDependency (OOModel::ReferenceExpression *reference)
 
static const OOModel::TypestripPointerOrReference (const OOModel::Type *type)
 

Private Attributes

QSet< CodeUnitPart * > dependencies_
 
Export::SourceFragmentfragment_ {}
 
QSet< DependencyTargethardTargets_
 
QSet< Model::Node * > nameNodes_
 
CodeUnitparent_ {}
 
QSet< OOModel::ReferenceExpression * > referenceNodes_
 
QSet< DependencyTargetsoftTargets_
 

Constructor & Destructor Documentation

◆ CodeUnitPart()

CppExport::CodeUnitPart::CodeUnitPart ( CodeUnit parent)

Member Function Documentation

◆ assertForcedDependencyNecessary()

void CppExport::CodeUnitPart::assertForcedDependencyNecessary ( OOModel::ReferenceExpression reference)
private

checks whether the provided reference is "Type" in constructs of the form: (void)(Type*)nullptr; this construct is used to force dependencies when Envision's reference resolution system is not yet good enough to properly detect the dependency, causing the export to C++ to omit a necessary #include.

if the structure matches the construct then the method asserts that no hard dependency on it has been found already so in case one forced dependency becomes redundant it can be detected more easily.

◆ calculateDependencies()

void CppExport::CodeUnitPart::calculateDependencies ( QList< CodeUnit * > &  allUnits)

◆ dependencies()

QSet< CodeUnitPart * > CppExport::CodeUnitPart::dependencies ( ) const
inline

◆ dependenciesWithinFile()

QSet< CodeUnitPart * > CppExport::CodeUnitPart::dependenciesWithinFile ( QList< CodeUnit * >  units)

◆ fixedTarget()

Model::Node * CppExport::CodeUnitPart::fixedTarget ( OOModel::ReferenceExpression referenceExpression)
staticprivate

◆ fragment()

Export::SourceFragment * CppExport::CodeUnitPart::fragment ( ) const
inline

◆ isNameOnlyDependency()

bool CppExport::CodeUnitPart::isNameOnlyDependency ( OOModel::ReferenceExpression reference)
staticprivate

◆ isSourceFragmentEmpty()

bool CppExport::CodeUnitPart::isSourceFragmentEmpty ( ) const

returns whether there is at least one text fragment inside sourceFragment.

◆ nameNodes()

const QSet< Model::Node * > & CppExport::CodeUnitPart::nameNodes ( ) const
inline

◆ parent()

CodeUnit * CppExport::CodeUnitPart::parent ( ) const
inline

◆ referenceNodes()

const QSet< OOModel::ReferenceExpression * > & CppExport::CodeUnitPart::referenceNodes ( ) const
inline

◆ setFragment()

void CppExport::CodeUnitPart::setFragment ( Export::SourceFragment sourceFragment)

◆ softDependencies()

QSet< DependencyTarget > CppExport::CodeUnitPart::softDependencies ( ) const
inline

◆ stripPointerOrReference()

const OOModel::Type * CppExport::CodeUnitPart::stripPointerOrReference ( const OOModel::Type type)
staticprivate

Member Data Documentation

◆ dependencies_

QSet<CodeUnitPart*> CppExport::CodeUnitPart::dependencies_
private

◆ fragment_

Export::SourceFragment* CppExport::CodeUnitPart::fragment_ {}
private

◆ hardTargets_

QSet<DependencyTarget> CppExport::CodeUnitPart::hardTargets_
private

◆ nameNodes_

QSet<Model::Node*> CppExport::CodeUnitPart::nameNodes_
private

◆ parent_

CodeUnit* CppExport::CodeUnitPart::parent_ {}
private

◆ referenceNodes_

QSet<OOModel::ReferenceExpression*> CppExport::CodeUnitPart::referenceNodes_
private

◆ softTargets_

QSet<DependencyTarget> CppExport::CodeUnitPart::softTargets_
private