Envision
A visual programming IDE for object-oriented languages
|
Public Member Functions | |
GenericPersistentUnit (const GenericPersistentUnit &other)=delete | |
~GenericPersistentUnit () | |
QString | extractRootNodeIDFromName () const |
const QString & | name () const |
GenericNode * | newNode () |
GenericNode * | newNode (const char *data, int dataLength) |
GenericNode * | newNode (const GenericNode *nodeToCopy, bool force=false, bool deepCopy=false) |
If force is true then no check for ID uniqueness is performed. More... | |
GenericNode * | newNode (int lineStart, int lineEndEnclusive) |
GenericNode * | newNode (Model::NodeIdType id, Model::NodeIdType parentId, const QString &label, const QString &type, const QString &value, GenericNode::ValueType valueType) |
Creates and returns a new node, with the corresponding attributes. More... | |
QPair< bool, GenericNode * > | newOrExistingNode (const char *data, int dataLength) |
Returns the node according to data. More... | |
GenericNode * | nodeWithNullParent () const |
Returns the node that has no parent (parent is {000...}). More... | |
const char * | setData (const char *data, int dataSize) |
Copies the provided data to be used for initializing child GenericNode elements. More... | |
GenericTree * | tree () const |
GenericNode * | unitRootNode () const |
Returns the root node for this persistence unit under the assumption that all nodes in this unit have been loaded. More... | |
Private Member Functions | |
GenericPersistentUnit (GenericTree *tree, QString name, char *data=nullptr, int dataSize=0) | |
GenericNode * | nextNode () |
void | releaseLastNode () |
Private Attributes | |
QList< GenericNode * > | chunks_ |
char * | data_ {} |
int | dataSize_ {} |
int | lastNodeIndexInLastChunk_ {} |
QString | name_ |
GenericTree * | tree_ {} |
Friends | |
class | GenericTree |
class | PiecewiseLoader |
FilePersistence::GenericPersistentUnit::~GenericPersistentUnit | ( | ) |
|
delete |
|
private |
QString FilePersistence::GenericPersistentUnit::extractRootNodeIDFromName | ( | ) | const |
|
inline |
GenericNode * FilePersistence::GenericPersistentUnit::newNode | ( | ) |
GenericNode * FilePersistence::GenericPersistentUnit::newNode | ( | const char * | data, |
int | dataLength | ||
) |
GenericNode * FilePersistence::GenericPersistentUnit::newNode | ( | const GenericNode * | nodeToCopy, |
bool | force = false , |
||
bool | deepCopy = false |
||
) |
If force is true then no check for ID uniqueness is performed.
GenericNode * FilePersistence::GenericPersistentUnit::newNode | ( | int | lineStart, |
int | lineEndEnclusive | ||
) |
GenericNode * FilePersistence::GenericPersistentUnit::newNode | ( | Model::NodeIdType | id, |
Model::NodeIdType | parentId, | ||
const QString & | label, | ||
const QString & | type, | ||
const QString & | value, | ||
GenericNode::ValueType | valueType | ||
) |
Creates and returns a new node, with the corresponding attributes.
This method checks that a node with the same ID does not already exist.
QPair< bool, GenericNode * > FilePersistence::GenericPersistentUnit::newOrExistingNode | ( | const char * | data, |
int | dataLength | ||
) |
Returns the node according to data.
If the boolean return value is true, the node was newly created and needs to be linked; Otherwise such a node already exists in the tree and that node is returned. In this case the node does not need to be linked.
|
private |
GenericNode * FilePersistence::GenericPersistentUnit::nodeWithNullParent | ( | ) | const |
Returns the node that has no parent (parent is {000...}).
This is typically the root node of the tree.
|
private |
const char * FilePersistence::GenericPersistentUnit::setData | ( | const char * | data, |
int | dataSize | ||
) |
Copies the provided data to be used for initializing child GenericNode elements.
The copy will be destroyed with the object.
Returns a pointer to the copied data.
|
inline |
GenericNode * FilePersistence::GenericPersistentUnit::unitRootNode | ( | ) | const |
Returns the root node for this persistence unit under the assumption that all nodes in this unit have been loaded.
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |