Concepts Class. More...

#include <gclass.h>

Inheritance diagram for GClass:
[legend]

Public Member Functions

 GClass (GSession *session, const R::RString &name)
 
 GClass (GSession *session, size_t id, size_t blockid, const R::RString &name, const R::RDate &c)
 
virtual R::RCString GetClassName (void) const
 
int Compare (const GClass &theclass) const
 
R::RDate GetComputed (void) const
 
void Update (GDescription &desc)
 
virtual double GetUpOperationCost (void) const
 
virtual ~GClass (void)
 
- Public Member Functions inherited from GDescriptionObject< GClass >
 GDescriptionObject (GSession *session, size_t id, size_t blockid, tObjType objtype, const R::RString &name)
 
void ReleaseVectors (void)
 
const GDescriptionoperator() (void) const
 
R::RConstCursor< GVectorGetVectors (void) const
 
const GVectorGetVector (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
 
GSessionGetSession (void) const
 
size_t GetId (void) const
 
void SetId (size_t id)
 
tObjType GetObjType (void) const
 
R::RCursor< GStatementGetObjs (const GStatement *obj, tStatementElement what)
 
virtual void HandlerNotFound (const R::RNotification &notification)
 
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 tObjType GetType (void)
 
- Static Public Member Functions inherited from GDescriptionObject< GClass >
static bool HasDesc (void)
 
- Static Public Member Functions inherited from GObject
static bool HasDesc (void)
 
static bool HasTree (void)
 

Private Member Functions

virtual void Clear (bool disk)
 

Private Attributes

R::RDate Computed
 

Additional Inherited Members

- Protected Member Functions inherited from GDescriptionObject< GClass >
virtual bool LoadVectors (void)
 
- Protected Attributes inherited from GDescriptionObject< GClass >
tObjState State
 
- Protected Attributes inherited from GObject
GSessionSession
 
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
 

Detailed Description

Concepts Class.

The GClass provides a representation for a group of concepts. All the classes are part of tree.

Constructor & Destructor Documentation

GClass ( GSession session,
const R::RString name 
)

Construct a new class.

Parameters
sessionSession.
nameName of the class.
GClass ( GSession session,
size_t  id,
size_t  blockid,
const R::RString name,
const R::RDate c 
)

Construct a class with a specific identifier.

Parameters
sessionSession.
idIdentifier.
blockidIdentifier of the block.
nameName of the class.
cDate of the last computation.
virtual ~GClass ( void  )
virtual

Destruct the group.

Member Function Documentation

virtual R::RCString GetClassName ( void  ) const
virtual
Returns
the class name.

Reimplemented from GObject.

static tObjType GetType ( void  )
static

Give the type of the object.

Returns
otClass
virtual void Clear ( bool  disk)
privatevirtual

Clear the class.

Parameters
diskClear the reference to the corresponding block on disk.
int Compare ( const GClass theclass) const

Compare two classes by comparing their identifier.

See also
R::RContainer
Parameters
theclassClass.
Returns
int
R::RDate GetComputed ( void  ) const

Get the date of the last analysis of the document.

Returns
the date.
void Update ( GDescription desc)

Update the representation of the class once a computation was done. The computed date and the status are updated.

If the class is an internal one, the following steps are done:

  • -# An 'hClasses[oeAboutToBeUpdated]' notification is send.
  1. The references are updated.
  2. Existing in memory description is replaced.
  3. If necessary, the class and its description are saved.
  4. An 'hClasses[oeUpdated]' notification is send.

If the topic is an external one, its description is replaced.

Parameters
descDescription to assign.
Warning
The description is cleared by this method.
virtual double GetUpOperationCost ( void  ) const
virtual

Get the cost of an Up operation of the current node. The method adds a cost computed for each vector. The cost of one vector is :

  1. The number of concept references if the class has no parent.
  2. The difference of the number of concept references between the parent and the current class.

In their paper TreeRank: A Similarity Measure for Nearest Neighbor Searching in Phylogenetic Databases, Wang, Shan, Shasha and Piel define the up operation as the operation that moves a token from one node to its parent.

Returns
Cost of the up operation.

Member Data Documentation

R::RDate Computed
private

Date of last class computation.