HGA Node. More...
#include <rnodega.h>
Public Member Functions | |
RNodeGA (size_t id, size_t max) | |
bool | Verify (size_t &nbobjs) |
const RAttrList & | GetAttr (void) const |
void | SetAttr (const RAttrList &attr) |
virtual bool | CanAttach (const RAttrList &attr) const |
virtual bool | IsSame (const RAttrList &attr) const |
size_t | GetNbCommon (const RAttrList &attr) const |
bool | IsSameObjs (const cNode *node) const |
RCursor< cObj > | GetObjs (void) const |
virtual void | PostInsert (const cNode *node) |
virtual void | PostDelete (const cNode *node) |
virtual void | PostInsert (const cObj *obj) |
virtual void | PostDelete (const cObj *obj) |
virtual void | Clear (void) |
void | ConstructAllObjects (cObj **objs, size_t &nbobjs) |
void | GetAllObjects (RNumContainer< size_t, true > &objs) const |
virtual void | CopyInfos (const cNode &node) |
size_t | GetId (void) const |
size_t * | GetNodesId (void) const |
size_t | GetNbObjs (void) const |
size_t * | GetObjectsId (void) const |
bool | HasSomeObjects (RNumContainer< size_t, true > *objs) const |
void | PrintNode (RTextFile &file, int depth) |
virtual | ~RNodeGA (void) |
Protected Attributes | |
cNodes * | Owner |
size_t | Id |
RAttrList | Attr |
size_t | SubObjects |
size_t | NbSubObjects |
bool | Reserved |
Detailed Description
template<class cNode, class cObj, class cNodes>
class R::RNodeGA< cNode, cObj, cNodes >
HGA Node.
The RNodeGA class provides a representation of a node in a HGA.
- See also
- R::RNodesGA
Constructor & Destructor Documentation
RNodeGA | ( | size_t | id, |
size_t | max | ||
) |
Construct the node.
- Parameters
-
id Identifier of the node. max Maximum number of attributes.
|
virtual |
Destruct the node.
Member Function Documentation
bool Verify | ( | size_t & | nbobjs | ) |
Verify if the node is not violating the integrity of the system.
- Parameters
-
nbobjs Increase the number of objects attached.
- Returns
- true if the node is correct, false else.
const RAttrList& GetAttr | ( | void | ) | const |
Return a reference of the attributes.
void SetAttr | ( | const RAttrList & | attr | ) |
Assign a given list of attributes to the current node.
- Parameters
-
attr List of attributes.
|
virtual |
Verify if a given set of attributes can be attached.
- Parameters
-
attr List of attributes.
|
virtual |
Verify if an given set of attributes has the exactly the same attributes.
- Parameters
-
attr List of attributes.
size_t GetNbCommon | ( | const RAttrList & | attr | ) | const |
Count the number of attributes in common in the node and a list of attributes.
- Parameters
-
attr List of attributes.
bool IsSameObjs | ( | const cNode * | node | ) | const |
test if two nodes have the same objects attached.
- Parameters
-
node Node to compare with.
- Returns
- always true.
RCursor<cObj> GetObjs | ( | void | ) | const |
Copy all the objects and the nodes of a node except one node if it exists. The two nodes have to be of two different owners.
- Parameters
-
from Node to copy from. copyobjs Must the objects of from be copied? objs Objects which nodes must not be copied. excluded Node that must (eventually) not be copied.
This method can be used to copy a whole tree "from" into another "to":
- Returns
- Pointer to the node that was supposed to have the node excluded (or 0 if not found). Method call to insert an object.
- Parameters
-
obj Object to insert. Method call to delete an object. obj Object to delete. Return a cursor over the objects attached to the node.
|
virtual |
Method called after a node is attach.
- Parameters
-
node Node attached.
|
virtual |
Method called after a node is detach.
- Parameters
-
node Node detached.
|
virtual |
Method called after an object is attach.
- Parameters
-
obj Object attached.
|
virtual |
Method called after an object is detach.
- Parameters
-
obj Object attached.
|
virtual |
Method that clears a node.
void ConstructAllObjects | ( | cObj ** | objs, |
size_t & | nbobjs | ||
) |
Construct a list of all objects contained in the node or its child nodes. This list is ordered by object id.
- Parameters
-
objs The list that will hold the objects. Must be created by the caller. nbobjs The number of objects contained in the list.
void GetAllObjects | ( | RNumContainer< size_t, true > & | objs | ) | const |
Put the identifiers of all objects contained in the node or its child nodes).
- Parameters
-
objs Vector that will hold the objects' identifiers.
|
virtual |
Copy the information related to a node.
- Parameters
-
node The node used as source.
size_t GetId | ( | void | ) | const |
Return the identifier of the node.
size_t* GetNodesId | ( | void | ) | const |
Return the list of the nodes. The list is created by RNode, but must be deleted by the caller. The list is ended by a NoNode value.
size_t GetNbObjs | ( | void | ) | const |
Return the number of the objects attached.
size_t* GetObjectsId | ( | void | ) | const |
Return the list of the objects. The list is created by RNode, but must be deleted by the caller. The list is ended by a cNoRef value.
bool HasSomeObjects | ( | RNumContainer< size_t, true > * | objs | ) | const |
Look if the current node has some objects attached to it.
- Parameters
-
objs Objects to verify.
void PrintNode | ( | RTextFile & | file, |
int | depth | ||
) |
Print the current node in a file.
- Parameters
-
file File. depth Depth.
Member Data Documentation
|
protected |
Owner of the node.
|
protected |
Identifier of the Node
|
protected |
The list of attributes for the node.
|
protected |
Index of the first object attached to the node.
|
protected |
Number of objects attached to the node.
|
protected |
Is the node reserved?