Generic Vector Object. More...
#include <galilei.h>
Public Member Functions | |
GDescriptionObject (GSession *session, size_t id, size_t blockid, tObjType objtype, const R::RString &name) | |
void | ReleaseVectors (void) |
const GDescription & | operator() (void) const |
R::RConstCursor< GVector > | GetVectors (void) const |
const GVector * | GetVector (GConcept *metaconcept) const |
bool | IsIn (const GConcept *concept) const |
bool | IsDefined (void) const |
tObjState | GetState (void) const |
size_t | GetId (void) const |
size_t | GetBlockId (void) const |
virtual | ~GDescriptionObject (void) |
Public Member Functions inherited from GObject | |
GObject (GSession *session, size_t id, const R::RString &name, tObjType type) | |
GObject (const GObject &obj) | |
void | VerifyStatements (tStatementElement what, size_t size) |
int | Compare (const GObject &obj) const |
int | Compare (size_t id) const |
int | Search (const GObject &obj) const |
int | Search (const R::RString &name) const |
virtual R::RCString | GetClassName (void) const |
GSession * | GetSession (void) const |
size_t | GetId (void) const |
void | SetId (size_t id) |
tObjType | GetObjType (void) const |
R::RCursor< GStatement > | GetObjs (const GStatement *obj, tStatementElement what) |
virtual void | HandlerNotFound (const R::RNotification ¬ification) |
virtual | ~GObject (void) |
Public Member Functions inherited from RObject | |
RObject (const RString &name=RString::Null) | |
int | Compare (const RObject &obj) const |
RString | GetName (void) const |
void | PostNotification (const hNotification handle) |
void | PostNotification (const RCString &name) |
void | PostNotification (const hNotification handle, T data) |
void | PostNotification (const RCString &name, T data) |
void | InsertObserver (tNotificationHandler handler, const hNotification handle, RObject *object) |
void | InsertObserver (tNotificationHandler handler, const RCString &name, RObject *object) |
void | InsertObserver (tNotificationHandler handler, const hNotification handle) |
void | InsertObserver (tNotificationHandler handler, const RCString &name) |
void | InsertObserver (tNotificationHandler handler, RObject *object) |
void | InsertObserver (tNotificationHandler handler) |
void | DeleteObserver (void) |
void | DeleteObserver (const hNotification handle, RObject *object) |
void | DeleteObserver (const RCString &name, RObject *object) |
hNotification | GetNotificationHandle (const RCString &name) const |
RCString | GetNotificationName (const hNotification handle) const |
virtual | ~RObject (void) |
Static Public Member Functions | |
static bool | HasDesc (void) |
Static Public Member Functions inherited from GObject | |
static bool | HasDesc (void) |
static bool | HasTree (void) |
Protected Member Functions | |
virtual bool | LoadVectors (void) |
Protected Attributes | |
tObjState | State |
Protected Attributes inherited from GObject | |
GSession * | Session |
size_t | Id |
tObjType | ObjType |
R::RContainer< GStatement, false, true > * | Subjects |
R::RContainer< GStatement, false, false > * | Predicates |
R::RContainer< GStatement, false, false > * | Values |
Protected Attributes inherited from RObject | |
RString | Name |
Private Member Functions | |
void | Clear (bool disk=false) |
Private Member Functions inherited from GDescription | |
GDescription (void) | |
GDescription (const GDescription &src) | |
int | Compare (const GDescription &) const |
void | ReleaseVectors (void) |
R::RConstCursor< GVector > | GetVectors (void) const |
R::RCursor< GVector > | GetVectors (void) |
const GVector * | GetVector (GConcept *metaconcept) const |
GVector * | GetVector (GConcept *metaconcept) |
GVector * | GetInsertVector (GConcept *metaconcept) |
void | DeleteVector (GConcept *metaconcept) |
bool | IsDefined (void) const |
bool | IsIn (const GConcept *concept) const |
void | Clear (void) |
void | Normalize (void) |
template<class S > | |
void | Print (S &stream, const R::RString &name, const char *format="%E", size_t colsize=12) const |
GDescription & | operator= (const GDescription &desc) |
GDescription & | operator+= (const GDescription &desc) |
GDescription & | operator-= (const GDescription &desc) |
GDescription & | operator*= (const double nb) |
GDescription & | operator/= (const double nb) |
virtual | ~GDescription (void) |
void | Copy (GConcept *metaconcept, const R::RContainer< GConceptRef, false, true > &list) |
Private Attributes | |
size_t | BlockId |
Private Attributes inherited from GDescription | |
R::RContainer< GVector, true, true > * | Vectors |
Detailed Description
template<class C>
singleton GALILEI::GDescriptionObject< C >
Generic Vector Object.
The GDescriptionObject provides a generic class for a object of a given type with a specific identifier that is represented by a description.
Each object can be either selected (the default) or unselected. When unselected, the object is not taken into account for computation. For example, the document clustering treats only the selected documents.
- Template Parameters
-
C Class of the object.
Constructor & Destructor Documentation
GDescriptionObject | ( | GSession * | session, |
size_t | id, | ||
size_t | blockid, | ||
tObjType | objtype, | ||
const R::RString & | name | ||
) |
Construct a object.
- Parameters
-
session Session. id Identifier of the object. blockid Identifier of the block. objtype ObjType. name Name of the object.
|
virtual |
Destruct the object.
Member Function Documentation
|
protectedvirtual |
Load the vectors from the disk.
- Returns
- true if the vectors was loaded.
Reimplemented from GDescription.
|
static |
Defines if the objects have descriptions.
- Returns
- true.
void ReleaseVectors | ( | void | ) |
Release the vectors from memory.
const GDescription& operator() | ( | void | ) | const |
- Returns
- a const pointer to the description.
R::RConstCursor<GVector> GetVectors | ( | void | ) | const |
Get the vectors associated to the object. The whole description is loaded if necessary.
- Returns
- a cursor of GVector.
Get the vector associated to a meta-concept. The whole description is loaded if necessary.
- Parameters
-
metaconcept Meta-concept.
- Returns
- a pointer to a GVector (may be null if the meta-concept isn't found).
bool IsIn | ( | const GConcept * | concept | ) | const |
Verify if a given concept is in one of the vectors.
- Parameters
-
concept Concept.
- Returns
- true if the concept is contained.
bool IsDefined | ( | void | ) | const |
Verify if the object has a description in memory or on the disk.
- Returns
- true if the object is defined.
tObjState GetState | ( | void | ) | const |
- Returns
- the state of the object.
size_t GetId | ( | void | ) | const |
Get the identifier of the document.
size_t GetBlockId | ( | void | ) | const |
Get the identifier of the block containing the description. If null, it means that the object is not defined.
- Returns
- Identifier of the block.
|
private |
Clear the vectors corresponding to the object. The corresponding file is not removed from the disk.
- Parameters
-
disk Clear the reference to the corresponding block on disk.
Member Data Documentation
|
protected |
State of the object.
|
private |
Identifier of the block containing the description of the object. If null, the object has no description.