Generic Object. More...

#include <gobject.h>

Inheritance diagram for GObject:
[legend]

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
 
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 bool HasDesc (void)
 
static bool HasTree (void)
 

Protected Attributes

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
 

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
sessionSession.
idIdentifier.
nameName.
typeType.
GObject ( const GObject obj)

Copy constructor.

Parameters
objOriginal object.
virtual ~GObject ( void  )
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
whatType of container to verify.
sizeSize of the container.
int Compare ( const GObject obj) const

Compare method used by R::RContainer.

Parameters
objObject to compare with.
int Compare ( size_t  id) const

Compare method used by R::RContainer.

Parameters
idIdentifier to compare with.
int Search ( const GObject obj) const

Compare method used by R::RObjectContainer.

Parameters
objObject to compare with.
int Search ( const R::RString name) const

Compare method used by R::RContainer.

Parameters
nameName to compare with.
virtual R::RCString GetClassName ( void  ) const
virtual
Returns
the class name.

Reimplemented from RObject.

Reimplemented in GDoc, GProfile, GConcept, GConceptType, GClass, GCommunity, GTopic, and GUser.

static bool HasDesc ( void  )
static

Defines if the objects have a description.

Returns
false.
static bool HasTree ( void  )
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
idIdentifier.
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
objPseudo-parameter.
whatRole that the object plays in the statement.
Returns
a cursor.
void InsertObj ( tStatementElement  what,
GStatement statement 
)
private

Insert a new statement.

Parameters
whatRole that the object plays in the statement.
statementStatement to insert.
void DeleteObj ( tStatementElement  what,
GStatement statement 
)
private

Delete a statement.

Parameters
whatRole that the object plays in the statement.
statementStatement to delete.
virtual void HandlerNotFound ( const R::RNotification notification)
virtual

Handler called when a notification posted is not caught. In GALILEI, this function does nothing.

Parameters
notificationNotification posted.

Reimplemented from RObject.

Member Data Documentation

GSession* Session
protected

Session of the object.

size_t Id
protected

Identifier of the object.

tObjType ObjType
protected

Type of the object.

R::RContainer<GStatement,false,true>* Subjects
protected

Statements where the object is a subject.

It is ordered to allow the verification that a given statement doesn't already exist.

R::RContainer<GStatement,false,false>* Predicates
protected

Statements where the object is a predicate.

R::RContainer<GStatement,false,false>* Values
protected

Statements where the object is a value.