Generic Object. More...
#include <gobject.h>
Public Member Functions | |
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 bool | HasTree (void) |
Protected Attributes | |
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 | InsertObj (tStatementElement what, GStatement *statement) |
void | DeleteObj (tStatementElement what, GStatement *statement) |
Detailed Description
Generic Object.
The GObject provides a class for a generic object in GALILEI. In particular, each object can be part of a statement.
The object maintains containers of statements where it appears as subject, predicate or values. By default, these containers are not suppose to be large. But for certain objects, for example those who are predicates, one of these containers can be used. It is then more efficient to verify that it can hold a large number of statements with the method GObject::VerifyStatements.
Constructor & Destructor Documentation
GObject | ( | GSession * | session, |
size_t | id, | ||
const R::RString & | name, | ||
tObjType | type | ||
) |
Construct a object.
- Parameters
-
session Session. id Identifier. name Name. type Type.
|
virtual |
Destruct the object.
Member Function Documentation
void VerifyStatements | ( | tStatementElement | what, |
size_t | size | ||
) |
Verify that a given container can hold a given number of statements.
- Parameters
-
what Type of container to verify. size Size of the container.
int Compare | ( | const GObject & | obj | ) | const |
Compare method used by R::RContainer.
- Parameters
-
obj Object to compare with.
int Compare | ( | size_t | id | ) | const |
Compare method used by R::RContainer.
- Parameters
-
id Identifier to compare with.
int Search | ( | const GObject & | obj | ) | const |
Compare method used by R::RObjectContainer.
- Parameters
-
obj Object to compare with.
int Search | ( | const R::RString & | name | ) | const |
Compare method used by R::RContainer.
- Parameters
-
name Name to compare with.
|
virtual |
- Returns
- the class name.
Reimplemented from RObject.
Reimplemented in GDoc, GProfile, GConcept, GConceptType, GClass, GCommunity, GTopic, and GUser.
|
static |
Defines if the objects have a description.
- Returns
- false.
|
static |
Defines of the objects have a concept tree.
- Returns
- false.
GSession* GetSession | ( | void | ) | const |
- Returns
- the session of the object.
size_t GetId | ( | void | ) | const |
- Returns
- the identifier of the object.
void SetId | ( | size_t | id | ) |
Set the identifier of the object. It can only be called if the current identifier is undefined.
- Parameters
-
id Identifier.
tObjType GetObjType | ( | void | ) | const |
- Returns
- the type of the object.
R::RCursor<GStatement> GetObjs | ( | const GStatement * | obj, |
tStatementElement | what | ||
) |
Get a given list of statements involving the object.
- Parameters
-
obj Pseudo-parameter. what Role that the object plays in the statement.
- Returns
- a cursor.
|
private |
Insert a new statement.
- Parameters
-
what Role that the object plays in the statement. statement Statement to insert.
|
private |
Delete a statement.
- Parameters
-
what Role that the object plays in the statement. statement Statement to delete.
|
virtual |
Member Data Documentation
|
protected |
Session of the object.
|
protected |
Identifier of the object.
|
protected |
Type of the object.
|
protected |
Statements where the object is a subject.
It is ordered to allow the verification that a given statement doesn't already exist.
|
protected |
Statements where the object is a predicate.
|
protected |
Statements where the object is a value.