Envision
A visual programming IDE for object-oriented languages
|
Public Types | |
enum | ValueType { NO_VALUE , STRING_VALUE , INT_VALUE , DOUBLE_VALUE } |
Public Member Functions | |
bool | areAllChildrenLoaded () const |
Returns true if the return value of this.children() is valid. More... | |
GenericNode * | attachChild (GenericNode *child) |
void | attachToParent () |
Links this node to the parent according to the parentId if the parent is loaded. More... | |
GenericNode * | child (const QString &label) |
const QList< GenericNode * > & | children () const |
void | copy (const GenericNode *other) |
Sets id, parentId, label, value and type of this node equal to other. More... | |
void | detachFromParent () |
bool | equalTo (const GenericNode *other) |
bool | hasDoubleValue () const |
bool | hasIntValue () const |
bool | hasStringValue () const |
bool | hasValue () const |
Model::NodeIdType | id () const |
const QString & | label () const |
void | linkNode (bool recursiveLink=false) |
GenericNode * | parent () const |
Model::NodeIdType | parentId () const |
GenericPersistentUnit * | persistentUnit () const |
const QString & | rawValue () const |
void | remove (bool recursive=false) |
Removes the node from the tree. More... | |
void | resetValue (ValueType type, const QString &value) |
void | setChildren (QList< GenericNode * > children) |
void | setId (Model::NodeIdType id) |
void | setLabel (const QString &label) |
void | setParent (GenericNode *parent) |
void | setParentId (Model::NodeIdType parentId) |
void | setType (const QString &type) |
void | setValue (const QString &value) |
void | setValue (double value) |
void | setValue (long value) |
void | setValue (ValueType type, const QString &value) |
This method must only be called if no value has been set yet. More... | |
const QString & | type () const |
double | valueAsDouble () const |
long | valueAsLong () const |
const QString & | valueAsString () const |
ValueType | valueType () const |
Static Public Attributes | |
static const QString | PERSISTENT_UNIT_TYPE = "persistencenewunit" |
Private Member Functions | |
GenericNode () | |
void | ensureDataRead () const |
void | reset (GenericPersistentUnit *persistentUnit) |
void | reset (GenericPersistentUnit *persistentUnit, const char *dataLine, int dataLineLength, bool lazy) |
Loads all the properties of this node using the provided dataLine. More... | |
void | reset (GenericPersistentUnit *persistentUnit, const GenericNode *nodeToCopy) |
void | reset (GenericPersistentUnit *persistentUnit, Model::NodeIdType id, Model::NodeIdType parentId, const QString &label, const QString &type, const QString &value, ValueType valueType) |
bool | sameTree (const GenericNode *other) |
GenericTree * | tree () const |
Private Attributes | |
bool | areAllChildrenLoaded_ = false |
QList< GenericNode * > | children_ |
const char * | dataLine_ {} |
The text line from which this node should be created. More... | |
int | dataLineLength_ {} |
Model::NodeIdType | id_ {} |
QString | label_ |
!!! When adding new members, make sure to reset them in the various reset() methods !!! More... | |
GenericNode * | parent_ {} |
Model::NodeIdType | parentId_ {} |
GenericPersistentUnit * | persistentUnit_ {} |
QString | type_ |
QString | value_ |
ValueType | valueType_ {} |
Friends | |
class | GenericPersistentUnit |
class | GenericTree |
class | PiecewiseLoader |
|
private |
|
inline |
Returns true if the return value of this.children() is valid.
GenericNode * FilePersistence::GenericNode::attachChild | ( | GenericNode * | child | ) |
void FilePersistence::GenericNode::attachToParent | ( | ) |
Links this node to the parent according to the parentId if the parent is loaded.
GenericNode * FilePersistence::GenericNode::child | ( | const QString & | label | ) |
const QList< GenericNode * > & FilePersistence::GenericNode::children | ( | ) | const |
void FilePersistence::GenericNode::copy | ( | const GenericNode * | other | ) |
Sets id, parentId, label, value and type of this node equal to other.
If the parent changes, this node must first be detached from its parent.
void FilePersistence::GenericNode::detachFromParent | ( | ) |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void FilePersistence::GenericNode::linkNode | ( | bool | recursiveLink = false | ) |
GenericNode * FilePersistence::GenericNode::parent | ( | ) | const |
|
inline |
|
inline |
|
inline |
void FilePersistence::GenericNode::remove | ( | bool | recursive = false | ) |
Removes the node from the tree.
If recursive is false, this node must not have any children. If recursive is true, all children of this node are also removed.
|
private |
|
private |
Loads all the properties of this node using the provided dataLine.
Any old content of this node will be removed. If this node did not belong to an allocator, it's children will be deleted.
dataLine should start with the indenting tabs and should end with the last content character of the node. The line should not include the final line break characters.
Set lazy to true when loading with an allocator. In this case dataLine will be saved and only parsed on demand. If lazy is false, then the node will be immediately initialized with the provided data.
Balz writes: This method should only be called from a persistent unit and that persistent unit should pass itself as the persistenUnit argument. Before it is called, the values of the members of this are undefined.
|
private |
|
private |
void FilePersistence::GenericNode::resetValue | ( | ValueType | type, |
const QString & | value | ||
) |
|
private |
|
inline |
|
inline |
|
inline |
void FilePersistence::GenericNode::setParent | ( | GenericNode * | parent | ) |
void FilePersistence::GenericNode::setParentId | ( | Model::NodeIdType | parentId | ) |
|
inline |
void FilePersistence::GenericNode::setValue | ( | const QString & | value | ) |
void FilePersistence::GenericNode::setValue | ( | double | value | ) |
void FilePersistence::GenericNode::setValue | ( | long | value | ) |
void FilePersistence::GenericNode::setValue | ( | ValueType | type, |
const QString & | value | ||
) |
This method must only be called if no value has been set yet.
|
private |
|
inline |
double FilePersistence::GenericNode::valueAsDouble | ( | ) | const |
long FilePersistence::GenericNode::valueAsLong | ( | ) | const |
const QString & FilePersistence::GenericNode::valueAsString | ( | ) | const |
|
inline |
|
friend |
|
friend |
|
friend |
|
private |
|
private |
|
private |
The text line from which this node should be created.
|
private |
|
private |
|
private |
!!! When adding new members, make sure to reset them in the various reset() methods !!!
|
private |
|
private |
|
static |
|
private |
|
private |
|
private |
|
private |