26 #ifndef _CSESSIONMANAGER 27 #define _CSESSIONMANAGER 28 #include "libMRML/include/uses-declarations.h" 33 #include "libMRML/include/CXMLElement.h" 34 #include "libMRML/include/CAccessorAdminCollection.h" 35 #include "libMRML/include/CI18nTranslator.h" 36 #include "libMRML/include/CAlgorithm.h" 37 #include "libMRML/include/CPropertySheetList.h" 38 #include "libMRML/include/CAccessorElement.h" 39 #include "libMRML/include/CAlgorithmCollection.h" 40 #include "libMRML/include/CQueryTreeBuilder.h" 41 #include "libMRML/include/CMutex.h" 108 ostream&
write(ostream& outStream)
const;
110 istream&
read(istream& inStream);
115 void setUser(
const string& inUser);
119 void setID(
const string& inID);
154 const string& inAlgorithm,
172 bool rename(
const string& inName);
190 string toXML(
bool isPrivate)
const;
213 CMutex mMutexSessionManager;
228 typedef map<string,CSession*> CIDToSession;
230 mutable CUserToSessions mUserToSessions;
232 mutable CIDToSession mIDToSession;
250 string inConfiguration,
251 string inI18nFileName);
257 CQuery* makeQuery(
const string& inBaseType,
262 istream&
read(istream&);
264 ostream&
write(ostream&);
271 string inSessionName);
277 string inSessionName);
307 const string& inAlgorithm,
311 list<CAccessorElement>* getAllAccessorElements(
const string& inSessionID,
312 const string& inAlgorithm
316 list<TID>* getAllIDs(
const string& inSessionID,
317 const string& inAlgorithm
327 bool setAlgorithm(
const string& inSessionID,
330 string newSession(
const string& inUser,
331 const string& inSessionName);
333 string newSession(
const string& inID,
334 const string& inUser,
335 const string& inSessionName);
339 const string& inNewSessionName);
369 string toXML(
bool isPrivate=
false)
const;
377 string toXMLSessions(
const string& inUser,
378 bool isPrivate=
false)
const;
380 string toXMLSessionConfiguration()
const;
382 pair<string,string> toXMLHandshake(
const string& inUser);
389 string inAlgorithmID)
const;
399 void startPropertySheetSubtree();
406 void endPropertySheetSubtree();
414 bool clearSessionLanguages(
const string& inSessionID);
416 bool addSessionLanguage(
const string& inSessionID,
417 const string& inLanguageCode);
419 bool commitSessionLanguages(
const string& inSessionID);
421 list<string> getSessionLanguages(
const string& inSessionID)
const;
423 void translate(
string inSessionID,
string getID() const
set ID of this session
bool rename(const string &inName)
Renaming this session (calls setSessionName, at present)
A class containing a session.
Definition: CSessionManager.h:63
ostream & write(ostream &outStream) const
Read the state.
string mPreferredLanguage
the language to be used in this session
Definition: CSessionManager.h:66
void setUser(const string &inUser)
set user of this session
The algorithm collection is kind of a factory for CQuery structures:
Definition: CAlgorithmCollection.h:58
CI18nTranslator mI18nTranslator
The Translator for this.
Definition: CSessionManager.h:222
CAlgorithm * mActiveAlgorithm
The algorithm used for the next query At present this fully describes a session.
Definition: CSessionManager.h:86
CStaticQueryFactory * mBaseTypeFactory
The base type factory is a factory for query base types.
Definition: CSessionManager.h:243
This class captures the structure of an XML element.
Definition: CXMLElement.h:51
This class builds and maintains a query tree.
Definition: CQueryTreeBuilder.h:30
takes the information contained in the list of properties, which is given in the config.mrml file.
Definition: CPropertySheetList.h:41
string mSessionName
the name of this session
Definition: CSessionManager.h:82
string getUser() const
get user of this session
This class does nothing but wrap the current query interface in a way, that it can be used with CORBA...
Definition: CQueryTreeNode.h:24
CXMLElement * mPropertySheetSubtree
The subtree from which the mPropertySheets will be built.
Definition: CSessionManager.h:240
list< string > getLanguages() const
get the preferred languages of this session
An algorithm is a CXMLElement which is linked to a CSessionManager together they are able to build CQ...
Definition: CAlgorithm.h:43
CPropertySheetList * mPropertySheetList
These are the building blocks of the property sheets to be generated by *this.
Definition: CSessionManager.h:237
This class offers runtime translation of strings.
Definition: CI18nTranslator.h:38
bool open()
opening this session.
The Query manager for Queries on inverted Files.
Definition: CQuery.h:73
A factory for base types of algorithms.
Definition: CStaticQueryFactory.h:38
void addLanguage(string inLanguageCode)
one language code is added at the back of the list of preferred languages
string getPreferredLanguage() const
get the preferred languages of this session
bool close()
Closing this session.
map< string, list< CSession > > CUserToSessions
point the user to all the sessions
Definition: CSessionManager.h:226
CMutex mMutexSession
the mutex for this session
Definition: CSessionManager.h:72
This structure handles the sessions; by this, it encapsulates the current state of the server...
Definition: CSessionManager.h:209
This is in fact a collection of collections.
Definition: CAccessorAdminCollection.h:39
CAccessorAdminCollection mAccessorAdminCollection
The accessor collection is needed for constructing queries.
Definition: CSessionManager.h:218
pair< CQueryContainer *, CQueryTreeNode * > mQueryTree
The information about the current query tree.
Definition: CSessionManager.h:88
void commitLanguages(const CI18nTranslator &inTranslator)
commit the list of languages.
CXMLElement * getRandomImages(CSessionManager &inCaller, const string &inAlgorithm, int inResultSize)
retrieving random images as seeds
void setID(const string &inID)
get ID of this session
istream & read(istream &inStream)
Write the state.
This class offers an abstraction from the locking method used.
Definition: CMutex.h:40
string getSessionName() const
get the displayname of this session
bool setActiveAlgorithm(CAccessorAdminCollection &inCaller, CAlgorithmCollection &inAlgorithmCollection, CAlgorithm *inActiveAlgorithm, CStaticQueryFactory &inBaseTypeFactory)
set the algorithm of this session.
CAlgorithm * getActiveAlgorithm()
get the algorithm of this session
void clearLanguages()
the list of preferred languages of this is cleared
string toXML(bool isPrivate) const
generating XML output for configuration/shandshake
~CSession()
destroys all members
CLanguageList mLanguages
the list of languages to be used
Definition: CSessionManager.h:70
CXMLElement * query(CSessionManager &inCaller, const CXMLElement &inQuery)
set the collection of this session
void setSessionName(const string &inSessionName)
set the displayname of this session
list< string > CLanguageList
the list of languages to be used
Definition: CSessionManager.h:68