Generic Storage Manager. More...
#include <gstorage.h>
Public Member Functions | |
GStorage (GSession *session, GPlugInFactory *fac) | |
virtual | ~GStorage (void) |
Suggestions Methods | |
virtual void | SaveSugs (const GSugs &sugs, size_t max=R::cNoRef)=0 |
virtual void | LoadSugs (GSugs &sugs)=0 |
Public Member Functions inherited from GPlugIn | |
GPlugIn (GSession *session, GPlugInFactory *fac) | |
virtual void | ApplyConfig (void) |
void | InsertParam (R::RParam *param) |
template<class T > | |
T * | FindParam (const R::RString &name) |
R::RCursor< R::RParam > | GetParams (const R::RString &cat=R::RString::Null) |
void | GetCategories (R::RContainer< R::RString, true, false > &cats) |
virtual void | Init (void) |
virtual void | CreateConfig (void) |
virtual void | Reset (void) |
GPlugInFactory * | GetFactory (void) const |
int | Compare (const GPlugIn &plugin) const |
int | Compare (const R::RString &plugin) const |
R::RString | GetName (void) const |
R::RString | GetDesc (void) const |
GSession * | GetSession (void) const |
virtual void | Done (void) |
virtual | ~GPlugIn (void) |
Protected Attributes | |
bool | LoadAll |
R::RDate | Filter |
bool | Filtering |
bool | AllMemory |
Protected Attributes inherited from GPlugIn | |
GPlugInFactory * | Factory |
GSession * | Session |
size_t | Id |
Private Member Functions | |
Documents Methods | |
virtual void | AssignId (GDoc *doc)=0 |
virtual void | LoadObj (GDoc *&doc, size_t docid)=0 |
virtual void | LoadObj (GDoc *&doc, const R::RString &url)=0 |
virtual void | LoadObjs (const GDoc *obj)=0 |
virtual void | SaveObj (GDoc *doc)=0 |
Users/Profiles Methods | |
virtual void | LoadObjs (const GUser *obj)=0 |
virtual void | LoadObj (GUser *&user, size_t userid)=0 |
virtual void | LoadObj (GUser *&user, const R::RString &name)=0 |
virtual void | LoadObj (GProfile *&profile, size_t profileid)=0 |
virtual void | LoadObj (GProfile *&profile, const R::RString &name)=0 |
virtual void | UpdateProfiles (size_t docid)=0 |
virtual void | AssignId (GUser *user)=0 |
virtual void | AssignId (GProfile *p)=0 |
virtual void | SaveObj (GUser *user)=0 |
virtual void | SaveObj (GProfile *prof)=0 |
virtual void | UpdateFdbk (GProfile *prof, GDoc *doc, tFdbkType fdbk, R::RDate done)=0 |
Topics Methods | |
virtual void | LoadObjs (const GTopic *topic)=0 |
virtual void | LoadObj (GTopic *&topic, size_t topicid)=0 |
virtual void | UpdateTopics (size_t docid)=0 |
virtual void | AssignId (GTopic *top)=0 |
virtual void | SaveObj (GTopic *grp)=0 |
General Methods | |
virtual void | ApplyParams (void) |
virtual size_t | GetNbSaved (tObjType type)=0 |
virtual void * | GetInfos (void) |
bool | IsAllInMemory (void) const |
bool | UseFiltering (void) const |
R::RDate | GetFilter (void) const |
virtual void | ExecuteData (const R::RString &filename)=0 |
virtual void | LoadObjs (const GSubject *)=0 |
virtual void | SaveObj (GSubject *subject)=0 |
virtual void | Clear (tObjType objtype)=0 |
Knowledge Methods | |
virtual R::RString | LoadObj (const GConcept *obj, size_t id)=0 |
virtual size_t | LoadObj (const GConcept *obj, const R::RString name, GConceptType *type)=0 |
virtual void | LoadObjs (const GConceptType *obj)=0 |
virtual void | AssignId (GConceptType *type)=0 |
virtual void | LoadObjs (const GConcept *obj)=0 |
virtual void | AssignId (GConcept *concept)=0 |
virtual void | DeleteObj (GConcept *concept)=0 |
virtual void | SaveObj (GConcept *concept)=0 |
virtual void | SaveIndex (const GConcept *concept, tObjType what, size_t index)=0 |
virtual void | ClearIndex (tObjType what)=0 |
virtual void | SaveRefs (GConceptType *type, tObjType what, size_t refs)=0 |
virtual void | ClearRefs (tObjType what)=0 |
virtual void | LoadObjs (const GStatement *obj)=0 |
virtual void | AssignId (GStatement *statement)=0 |
virtual void | LoadObj (GClass *&classp, size_t classid)=0 |
virtual void | LoadObj (GClass *&classp, const R::RString &name)=0 |
virtual void | LoadObjs (const GClass *obj)=0 |
virtual void | AssignId (GClass *theclass)=0 |
virtual void | SaveObj (GClass *theclass)=0 |
Communities Methods | |
virtual void | SaveDocs (const GCommunityDocs &docs)=0 |
virtual void | LoadDocs (GCommunityDocs &docs)=0 |
virtual void | LoadObjs (const GCommunity *obj)=0 |
virtual void | LoadObj (GCommunity *&community, size_t groupid)=0 |
virtual void | UpdateCommunities (size_t profid)=0 |
virtual void | AssignId (GCommunity *grp)=0 |
virtual void | SaveObj (GCommunity *grp)=0 |
Detailed Description
Generic Storage Manager.
The GStorage provides a representation for a storage manager. This storage manager is responsible to load and save data.
Most methods are private because they are automatically called by the managing classes (GSession, GObjects, etc.).
See the documentation related to GPlugIn for more general information.
Constructor & Destructor Documentation
GStorage | ( | GSession * | session, |
GPlugInFactory * | fac | ||
) |
Constructor.
- Parameters
-
session Session. fac Factory of the plug-in.
|
virtual |
Destruct.
Member Function Documentation
|
virtual |
Configurations were applied from the factory.
|
pure virtual |
Compute the number of objects of a given type which are saved.
- Parameters
-
type Type of the objects.
- Returns
- Number of objects.
|
virtual |
Get a pointer to a structure that should represent the storage. It can be used to give access to some internal methods specific to a given storage. It should be used carefully.
bool IsAllInMemory | ( | void | ) | const |
Are all the object loaded or just some of them (modified or because filters).
bool UseFiltering | ( | void | ) | const |
Using a date for filtering.
R::RDate GetFilter | ( | void | ) | const |
Get the filtering date.
|
pure virtual |
Execute a sequence of steps needed to construct data. Typically, this can be a SQL file.
- Parameters
-
filename Name of the file.
|
privatepure virtual |
Load the Subjects.
|
privatepure virtual |
Save the subject, including the information on the documents (and which ones are used) and the profiles assigned to them.
- Parameters
-
subject Subject to save.
|
privatepure virtual |
Clear the information of a given object type from the storage.
- Parameters
-
objtype Type of the object.
|
privatepure virtual |
Load the concept types from the database.
- Parameters
-
obj Pseudo-parameter.
|
privatepure virtual |
Assign an identifier to a new concept type.
- Parameters
-
type Concept type.
|
privatepure virtual |
Loading all concepts.
- Parameters
-
obj Pseudo-parameter.
|
privatepure virtual |
Assign an identifier to a new concept of a given type.
- Parameters
-
concept Concept.
|
privatepure virtual |
Delete a concept.
- Parameters
-
concept Concept.
|
pure virtual |
Load the name of specific concept.
- Parameters
-
obj Pseudo-parameter. id Identifier of the concept.
|
pure virtual |
Load the identifier of a specific concept.
- Parameters
-
obj Pseudo-parameter. name Name of the concept. type Type of the concept.
|
privatepure virtual |
Save a concept in the database.
- Parameters
-
concept Concept.
|
privatepure virtual |
Save the index information of a given object type for a given concept.
- Parameters
-
concept Concept. what Type of the object. index Identifier of the block containing the index.
|
privatepure virtual |
Clear all the index information of a given object type.
- Parameters
-
what Type of the object.
|
privatepure virtual |
Save the references of a given object type for a given concept type.
- Parameters
-
type Type of the concept. what Type of the object. refs Number of references.
|
privatepure virtual |
Clear the references of a given object type.
- Parameters
-
what Type of the object.
|
privatepure virtual |
Load the statements from the database.
- Parameters
-
obj Pseudo-parameter.
|
privatepure virtual |
Assign an identifier to a new statement.
- Parameters
-
statement Statement.
|
privatepure virtual |
Method that load a class that is stored.
- Parameters
-
classp Pointer to the class that will be created. classid Identifier of the class.
|
privatepure virtual |
Method that load a class that is stored.
- Parameters
-
classp Pointer to the class that will be created. name Name of the class.
|
privatepure virtual |
Method that load the classes from where they are stored. This method is called once by the session.
- Parameters
-
obj Pseudo-parameter.
|
privatepure virtual |
Assign an identifier to a new class.
- Parameters
-
theclass Class.
|
privatepure virtual |
Save a class.
- Parameters
-
theclass Class.
|
privatepure virtual |
Assign an identifier to a new document.
- Parameters
-
doc Document.
|
privatepure virtual |
Method that load a document that is stored.
- Parameters
-
doc Pointer to the document that will be created. docid Identifier of the document.
|
privatepure virtual |
Method that load a document that is stored.
- Parameters
-
doc Pointer to the document to create. url URL of the document
|
privatepure virtual |
Method that load the documents from where they are stored. This method is called once by the session.
- Parameters
-
obj Pseudo-parameter.
|
privatepure virtual |
Save a document where it is stored. This method is called after an analysis of a document if the result has to be saved. This method must be overloaded.
- Parameters
-
doc Document to save.
|
privatepure virtual |
Load the profiles and the users. This method is called once by the session.
- Parameters
-
obj Pseudo-parameter.
|
privatepure virtual |
Method that load a user that is stored.
- Parameters
-
user Pointer to the user that will be created. userid Identifier of the user.
|
privatepure virtual |
Method that load a user that is stored.
- Parameters
-
user Pointer to the user that will be created. name Name of the user.
|
privatepure virtual |
Method that load a profile that is stored.
- Parameters
-
profile Pointer to the profile that will be created. profileid Identifier of the profile.
|
privatepure virtual |
Method that load a profile that is stored.
- Parameters
-
profile Pointer to the profile that will be created. name Name of the profile.
|
privatepure virtual |
A document was updated and the profiles that have made a feedback on it must be updated.
- Parameters
-
docid Identifier of the document.
|
privatepure virtual |
Assign an identifier to a new user.
- Parameters
-
user Pointer to the user.
|
privatepure virtual |
Assign an identifier to a new profile.
- Parameters
-
p Pointer to the profile.
|
privatepure virtual |
Save a user.
- Parameters
-
user User to save.
|
privatepure virtual |
Save a profile.
- Parameters
-
prof Profile to save.
|
privatepure virtual |
Update a feedback for a given profile and document. If it is a new one, it must be created in the storage.
- Parameters
-
prof Profile. doc Document. fdbk Feedback type. done Date on the last feedback.
|
privatepure virtual |
Load the groups. This method is called once by the session.
- Parameters
-
obj Pseudo-parameter.
|
privatepure virtual |
Method that load a group that is stored.
- Parameters
-
community Pointer to the community that will be created. groupid Identifier of the group.
|
privatepure virtual |
A profile was updated and the corresponding communities must be updated.
- Parameters
-
profid Identifier of the profile.
|
privatepure virtual |
Assign an identifier to a new community.
- Parameters
-
grp Community.
|
privatepure virtual |
Save a community.
- Parameters
-
grp Community.
|
pure virtual |
Save the relevant documents associated with a given community.
- Parameters
-
docs List of relevant.
|
pure virtual |
Load the relevant documents associated with a given community.
- Parameters
-
docs List of relevant.
|
privatepure virtual |
Load the topics. This method is called once by the session.
- Parameters
-
topic Topic to load.
|
privatepure virtual |
Method that load a topic that is stored.
- Parameters
-
topic Pointer to the topic that will be created. topicid Identifier of the topic.
|
privatepure virtual |
A document was updated and the corresponding topics must be updated.
- Parameters
-
docid Identifier of the document.
|
privatepure virtual |
Assign an identifier to a new topic.
- Parameters
-
top Topic.
|
privatepure virtual |
Save a topic.
- Parameters
-
grp Topic.
Save a list of suggestions.
- Parameters
-
sugs Suggestions. max Maximum number of suggestions to save.
|
pure virtual |
Load a list of suggestions.
- Parameters
-
sugs Suggestions.
Member Data Documentation
|
protected |
All the objects must be loaded (true) or only those which are modified (false).
|
protected |
Date used to filter when load from the storage.
|
protected |
Is there a filter (Filter date is not the current one).
|
protected |
All objects are in memory.