CCommunicationHandler Class Reference
[CADIHash.h Index] [CADIHash.h Hierarchy]
a helper class for use with expat, which also handles the socket stuff More...
#include <../GIFTServer/CCommunicationHandler.h>
Public Members
- void setSocket (int inSocket)
- string preamble ()
- string frame (const string& inSession, const string& inString)
- string toAttribute (string inName, string inString)
- string toAttribute (string inName, int inInt)
- string toAttribute (string inName, double inFloat)
- int sendError (const string& inSession, const string& inMessage)
- void openSession (const string& inUserName, const string& inSessionName)
- void renameSession (const string& inSessionID, const string& inNewName)
- void deleteSession (const string& inName)
- void getPropertySheet (const string& inSessionID, const string& inAlgorithmID)
- int sendHandshake (const string& inUser)
- void getSessions (const string& inUser)
- void getCollections ()
- void getAlgorithms ()
- int sendResult (const string& inSession, const CXMLElement& inRLL)
- int sendRandomImages (const string& inSession, const string& inAlgorithm,
const string& inCollection,
const string& inNumberOfImages)
- CXMLElement* gQueryImages
- string mSessionID
- int mResultSize
- double mCutoff
- string mCollection
- string mAlgorithm
- void setResultSize (int inResultSize)
- void setResultCutoff (const string& inCutoff)
- void setResultCutoff (double inCutoff)
- void setCollectionID (const string& inID)
- void setAlgorithmID (const string& inID)
- void startTreeBuilding (const char* inElementName, const char*const*const inAttributes)
- void addToCurrentTree (const char* inElementName, const char*const*const inAttributes)
- void moveUpCurrentTree ()
- bool isBuildingTree ()
- void parseString (const string& inMessage)
- void clearAlgorithmElement ()
- void startAlgorithmElement (const char* inName, const char* const* const inAttributes)
- void endAlgorithmElement ()
- void initAlgorithmElement ()
- CAlgorithm* readAlgorithmElement ()
- void endConfiguration ()
- bool mParsingFinished
- void clearParsingFinished ()
- void setParsingFinished ()
- bool isParsingFinished ()
- bool readAndParse ()
- void makeParser ()
- void startMultiRequest (const string& inSessionID)
- void endMultiRequest ()
- void addToMultiResponse (CXMLElement* inElement)
- CSessionManager& getSessionManager ()
- void incrementQueryAtRandomCount ()
- int getQueryAtRandomCount ()
- CCommunicationHandler (const string& inBaseDir)
- ~CCommunicationHandler ()
Protected Members
a helper class for use with expat, which also handles the socket stuff.@author: Wolfgang Müller
void setSocket(int inSocket)
setting the communication socket for this session
the preamble for a session
string frame(const string& inSession, const string& inString)
Frame: this is for all messages the same
string toAttribute(string inName, string inString)
making attributes out of name/value pairs
int sendError(const string& inSession, const string& inMessage)
Error message
void openSession(const string& inUserName, const string& inSessionName)
Opening a session
void renameSession(const string& inSessionID, const string& inNewName)
renaming the current session
void deleteSession(const string& inName)
renaming the current session
void getPropertySheet(const string& inSessionID, const string& inAlgorithmID)
Gets the property sheet contained in the algorithm
the handshake message (old MRML)
void getSessions(const string& inUser)
getting the sessions for one user (new MRML)
getting collections available on a system
getting algorithms available on a system
int sendResult(const string& inSession, const CXMLElement& inRLL)
the result of a query
int sendRandomImages(const string& inSession, const string& inAlgorithm,
const string& inCollection,
const string& inNumberOfImages)
random images
processing a query
setting properties of the query
void startTreeBuilding(const char* inElementName, const char*const*const inAttributes)
Start building a tree by successive adding
void addToCurrentTree(const char* inElementName, const char*const*const inAttributes)
Start building a tree by successive adding
move up in the tree
is this building a tree at present?
void parseString(const string& inMessage)
parse XML using expat
Clear the algorithm tree element.
We do not assume destruction responsability here
This responsability is transferred to the
containing session.
FIXME do something cleaner for the case of failure
void startAlgorithmElement(const char* inName, const char* const* const inAttributes)
start of an element in the tree of configured
algorithms.
If mAlgorithm=0 then generate a new
XML element with the content given
by inName and inAttributes
- Parameters:
-
inName |
The name like given by expat |
inAttributes |
an attributes list like given byexpat
|
end of an element in the tree of configured
clear the pointer to the algorithm tree
read the pointer to the algorithm tree
End the configuration i.e. make out
of the algorithm structure a query
processing structure.
parsing from a stream: read each character
If we process multiple queries which are part of one message,
we have to first collect the answers from the requests, and then
send the whole message.
startMultiRequest and endMultiRequest
are the functions which administer this process.
startMultiRequest clears the message which is going to be built.
sends the message which has been built
adds an XMLElement to the multi-response which is built
of this for other purposes
incrementing the QueryAtRandomCount flag
reading this flag
constructor/destructor
We have said, that the user can tell, if he wants a queryin the normal sense or rather a collection of random images,
in which case the inner parts of the query are ignored.
The flag used to perform this is this variable.
The socket, which is used for this communication
ofstream mLog
The logfile which logs all communication. *thiswill APPEND NEW DATA to the logfile, as you would expect
Documentation generated by muellerw@pc7170 on Son Okt 8 16:04:40 CEST 2000
|
Kdoc
|