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

Public Types

using UpdateFlags = QFlags< UpdateType >
 
enum  UpdateType { NoFlags = 0 , Label = 1 , Value = 2 , Type = 4 , Structure = 8 }
 

Public Member Functions

 ChangeDescription (GenericNode *nodeA, GenericNode *nodeB)
 
 ~ChangeDescription ()=default
 
void computeFlags ()
 
std::shared_ptr< ChangeDescriptioncopy (std::shared_ptr< GenericTree > &tree, bool force=false) const
 If force is true then no check for ID uniqueness is performed. More...
 
bool debugHasNodes ()
 This is only used for debugging. More...
 
const UpdateFlags flags () const
 
bool hasFlags (const UpdateFlags flags) const
 
bool isFake () const
 Returns true for changes that are stationary and have no flags set. More...
 
GenericNodenodeA () const
 
GenericNodenodeB () const
 
Model::NodeIdType nodeId () const
 
bool onlyLabelChange () const
 
bool onlyStructureChange () const
 
void print () const
 
void setStructureChangeFlag (bool value)
 
QString summary () const
 
const ChangeTypetype () const
 

Static Public Member Functions

static std::shared_ptr< ChangeDescriptionnewStructChange (Model::NodeIdType nodeId, std::shared_ptr< ChangeDescription > causingChange, std::shared_ptr< GenericTree > treeA, std::shared_ptr< GenericTree > treeB)
 

Private Member Functions

 ChangeDescription ()=default
 

Private Attributes

GenericNodenodeA_ {}
 If pointsToChildA_ is true, this is a pointer to a node with parent whose ID is nodeId_. More...
 
GenericNodenodeB_ {}
 
Model::NodeIdType nodeId_ {}
 
bool pointsToChildA_
 
bool pointsToChildB_
 
ChangeType type_ {}
 
UpdateFlags updateFlags_ {}
 

Member Typedef Documentation

◆ UpdateFlags

Member Enumeration Documentation

◆ UpdateType

Enumerator
NoFlags 
Label 
Value 
Type 
Structure 

Constructor & Destructor Documentation

◆ ChangeDescription() [1/2]

FilePersistence::ChangeDescription::ChangeDescription ( GenericNode nodeA,
GenericNode nodeB 
)

◆ ~ChangeDescription()

FilePersistence::ChangeDescription::~ChangeDescription ( )
default

◆ ChangeDescription() [2/2]

FilePersistence::ChangeDescription::ChangeDescription ( )
privatedefault

Member Function Documentation

◆ computeFlags()

void FilePersistence::ChangeDescription::computeFlags ( )

◆ copy()

std::shared_ptr< ChangeDescription > FilePersistence::ChangeDescription::copy ( std::shared_ptr< GenericTree > &  tree,
bool  force = false 
) const

If force is true then no check for ID uniqueness is performed.

◆ debugHasNodes()

bool FilePersistence::ChangeDescription::debugHasNodes ( )
inline

This is only used for debugging.

Do NOT use for other things.

◆ flags()

const ChangeDescription::UpdateFlags FilePersistence::ChangeDescription::flags ( ) const
inline

◆ hasFlags()

bool FilePersistence::ChangeDescription::hasFlags ( const UpdateFlags  flags) const
inline

◆ isFake()

bool FilePersistence::ChangeDescription::isFake ( ) const
inline

Returns true for changes that are stationary and have no flags set.

◆ newStructChange()

std::shared_ptr< ChangeDescription > FilePersistence::ChangeDescription::newStructChange ( Model::NodeIdType  nodeId,
std::shared_ptr< ChangeDescription causingChange,
std::shared_ptr< GenericTree treeA,
std::shared_ptr< GenericTree treeB 
)
static

◆ nodeA()

GenericNode * FilePersistence::ChangeDescription::nodeA ( ) const

◆ nodeB()

GenericNode * FilePersistence::ChangeDescription::nodeB ( ) const

◆ nodeId()

Model::NodeIdType FilePersistence::ChangeDescription::nodeId ( ) const
inline

◆ onlyLabelChange()

bool FilePersistence::ChangeDescription::onlyLabelChange ( ) const
inline

◆ onlyStructureChange()

bool FilePersistence::ChangeDescription::onlyStructureChange ( ) const
inline

◆ print()

void FilePersistence::ChangeDescription::print ( ) const

◆ setStructureChangeFlag()

void FilePersistence::ChangeDescription::setStructureChangeFlag ( bool  value)

◆ summary()

QString FilePersistence::ChangeDescription::summary ( ) const

◆ type()

const ChangeType & FilePersistence::ChangeDescription::type ( ) const
inline

Member Data Documentation

◆ nodeA_

GenericNode* FilePersistence::ChangeDescription::nodeA_ {}
private

If pointsToChildA_ is true, this is a pointer to a node with parent whose ID is nodeId_.

Otherwise, this points to a node with ID = nodeId_. This is a lazy loading mechanic.

◆ nodeB_

GenericNode* FilePersistence::ChangeDescription::nodeB_ {}
private

◆ nodeId_

Model::NodeIdType FilePersistence::ChangeDescription::nodeId_ {}
private

◆ pointsToChildA_

bool FilePersistence::ChangeDescription::pointsToChildA_
private

◆ pointsToChildB_

bool FilePersistence::ChangeDescription::pointsToChildB_
private

◆ type_

ChangeType FilePersistence::ChangeDescription::type_ {}
private

◆ updateFlags_

UpdateFlags FilePersistence::ChangeDescription::updateFlags_ {}
private