Subjects. More...
#include <gsubjects.h>
Public Member Functions | |
size_t | GetMaxDepth (void) const |
size_t | GetNbObjs (const GSubject *obj) const |
R::RCursor< GSubject > | GetObjs (const GSubject *obj) const |
R::RNodeCursor< GSubjects, GSubject > | GetObjs (const GSubject *obj, const GSubject *parent) const |
size_t | GetObjs (GSubject **subjects) |
GSubject * | GetObj (const GSubject *obj, size_t id) const |
GSubject * | GetObj (const GSubject *obj, const R::RString &name) const |
void | InsertObj (GSubject *to, GSubject *subject) |
size_t | GetNbUsedObjs (tObjType type) const |
size_t | GetNbObjs (const GSubject *obj, GDoc *doc) const |
R::RCursor< GSubject > | GetObjs (const GSubject *obj, const GDoc *doc) const |
const GSubject * | GetObj (const GSubject *obj, const GDoc *doc, bool one=true) const |
void | SetUsed (GSubject *subject, bool select) |
bool | IsUsed (const GDoc *doc) const |
size_t | GetUsedObjs (GDoc **docs) |
R::RCursor< GDoc > | GetUsedObjs (const GDoc *obj) const |
bool | IsFromParentSubject (const GDoc *doc, const GSubject *subject) const |
bool | IsFromSubject (const GDoc *doc, const GSubject *subject) const |
void | InsertObj (GSubject *subject, GDoc *doc) |
void | SetUsed (GDoc *doc, GSubject *subject, bool select) |
const GSubject * | GetObj (const GSubject *obj, const GProfile *profile) const |
void | InsertObj (GSubject *subject, GProfile *profile) |
const GSubject * | GetObj (const GSubject *obj, const GCommunity *com) const |
void | SetDescType (tSubjectDesc type) |
void | Repair (void) |
Public Member Functions inherited from RTree< T, N, bAlloc > | |
RTree (void) | |
void | ClearNode (N *node) |
N * | GetFirst (void) const |
N * | GetLast (void) const |
size_t | GetMaxDepth (void) const |
N * | GetTop (void) |
const N * | GetTop (void) const |
size_t | GetNbNodes (void) const |
size_t | GetNbTopNodes (void) const |
size_t | GetTab (N **tab, N *node, bool children=false) |
void | InsertNode (N *to, N *node) |
void | DeleteNodes (N *node, bool del=bAlloc) |
void | DeleteNode (N *node, bool del=bAlloc) |
void | UpdateDepth (N *node) |
void | MoveNode (N *to, N *node) |
void | Copy (const RTree< T, N, a > &src) |
void | DeepCopy (N *src, N *newparent) |
N * | GetNode (const TUse &tag) const |
double | GetUpOperationsCost (const N *u, const N *v) const |
virtual | ~RTree (void) |
Protected Member Functions | |
GSubjects (GSession *session) | |
virtual void | Clear (void) |
void | ReInit (void) |
void | LoadObjs (const GSubject *obj) |
Protected Attributes | |
R::RContainer< GSubject, false, true > | Subjects |
R::RContainer< GSubject, false, true > | UsedSubjects |
R::RContainer< GDoc, false, true > | UsedDocs |
R::RBoolVector | DocsStatus |
R::RContainer< R::RContainer < GSubject, false, false > , true, false > | DocsSubjects |
R::RContainer< GSubject, false, false > | ProfilesSubject |
bool | MustLoad |
tSubjectDesc | DescType |
Protected Attributes inherited from RTree< T, N, bAlloc > | |
N * | First |
N * | Last |
size_t | NbTopNodes |
size_t | NbNodes |
size_t | MaxDepth |
Detailed Description
Subjects.
The GSubjects provides a representation for a hierarchy of subjects (GSubject).
This class is used for validation purposes. It allows to associate documents and profiles to ideal groups and to compare them to computed groups (topics for documents and communities for profiles).
It is possible to use some documents and subjects only.
Constructor & Destructor Documentation
Member Function Documentation
|
protectedvirtual |
Clear the tree.
Reimplemented from RTree< T, N, bAlloc >.
|
protected |
Re-initialize the subjects.
|
protected |
Load the subjects.
- Parameters
-
obj Pseudo-parameter.
size_t GetMaxDepth | ( | void | ) | const |
Get the depth of the tree formed by all the subjects.
size_t GetNbObjs | ( | const GSubject * | obj | ) | const |
Get the total number of subjects.
- Parameters
-
obj Pseudo-parameter.
R::RCursor<GSubject> GetObjs | ( | const GSubject * | obj | ) | const |
Get a cursor over all the nodes of the tree.
- Parameters
-
obj Pseudo-parameter.
Get a cursor over the child subjects of a given subject.
- Parameters
-
obj Pseudo-parameter. parent Parent subject. If null, the top subjects are returned.
size_t GetObjs | ( | GSubject ** | subjects | ) |
Fill a given array with all the subjects. The array must be created and must be large enough to hold all the subjects.
- See also
- This method is used in GSimulator to create assessments for profiles during a simulation of a real system.
- Parameters
-
subjects Pointer to the array.
- Returns
- Size of the data copied in the array.
Get a subject.
- Parameters
-
obj Pseudo-parameter. id Identifier of the subject.
- Returns
- Pointer to GSubject.
GSubject* GetObj | ( | const GSubject * | obj, |
const R::RString & | name | ||
) | const |
Get a pointer to a given subject.
- Parameters
-
obj Pseudo-parameter. name Name of the subject.
- Returns
- Return the pointer or 0 if the element is not in the tree.
Insert a subject and attached it to a parent. If the parent is null, the subject is considered as one of the top subject of the tree.
- Parameters
-
to Parent where the subject is to attached. subject Subject to insert.
size_t GetNbUsedObjs | ( | tObjType | type | ) | const |
Compute the number of used object of a given type (otProfile or otDoc).
- Parameters
-
obj Pseudo-parameter. type Type.
Get the number of subjects associated with a given document.
- Parameters
-
obj Pseudo-parameter. doc Document.
R::RCursor<GSubject> GetObjs | ( | const GSubject * | obj, |
const GDoc * | doc | ||
) | const |
Get a Cursor on the subjects of a given document.
- Parameters
-
obj Pseudo-parameter. doc Document.
Get the first subject of a given document.
- Parameters
-
obj Pseudo-parameter. doc Document. only Suppose the document is associated with only one subject. If true, and if there are multiple subjects associated, an exception is generated.
void SetUsed | ( | GSubject * | subject, |
bool | select | ||
) |
Select or deselect a subject.
- Parameters
-
subject Subject. selected Must the document be selected.
If a subject is deselected, all the documents attached are automatically deselected. The inverse is not true.
bool IsUsed | ( | const GDoc * | doc | ) | const |
Look if a document is selected or not.
- Parameters
-
doc Document.
- Returns
- true if the document is selected.
size_t GetUsedObjs | ( | GDoc ** | docs | ) |
Fill a given array with all the selected documents. The array must be created and must be large enough to hold all the documents.
- See also
- This method is used in GSimulator to create assessments for profiles during a simulation of a real system.
- Parameters
-
docs Pointer to the array.
- Returns
- Size of the data copied in the array.
R::RCursor<GDoc> GetUsedObjs | ( | const GDoc * | obj | ) | const |
Get a cursor over the selected documents.
- Parameters
-
obj Pseudo-parameter.
Look if a document is in the parent subject.
- Parameters
-
doc Pointer to the document. subject Subject.
- Returns
- true if it is the case.
Look if a document is from a given subject.
- Parameters
-
doc Pointer to the document. subject Subject.
- Returns
- true if it is the case.
Add a given document to a subject. The document is consider as deselected.
- Parameters
-
subject Subject. doc Document.
Select or deselect an document in relation with a given subject.
- Parameters
-
doc Document. subject Subject. selected Must the document be selected.
A notification eSelectDoc is generated if the document is not already selected (a notification is therefore never emitted while the subjects are loaded). A notification oeDeselected is generated for the document if it isn't selected anymore.
Get the subject of a given profile.
- Parameters
-
obj Pseudo-parameter. profile Profile.
Add a given profile to a subject.
- Parameters
-
subject Subject. profile Profile.
const GSubject* GetObj | ( | const GSubject * | obj, |
const GCommunity * | com | ||
) | const |
Get the subject of a given community.
- Parameters
-
obj Pseudo-parameter. com Pointer to the community.
void SetDescType | ( | tSubjectDesc | type | ) |
Set the descriptions of the subjects.
- Parameters
-
type TYpe of the subjects.
void Repair | ( | void | ) |
Repair the subjects. It practice, it performs the following modifications:
- All leaf subjects without document associated are removed.
- If a subject has associated documents and child subjects, a new child subject is created and the documents are transfered to it.
Member Data Documentation
|
protected |
Container of subjects ordered by identifier.
|
protected |
Container of selected subjects ordered by identifier.
|
protected |
Container of used documents.
|
protected |
Document status (selected or not).
|
protected |
Subjects for the documents (the identifier of the document provides the index in the container).
|
protected |
Subjects for the profiles (the identifier of the profile provides the index in the container).
|
protected |
Specify if the subjects must be loaded.
|
protected |
Type of the description.