~ubuntu-branches/ubuntu/lucid/codelite/lucid

« back to all changes in this revision

Viewing changes to CodeLite/clindexerprotocol.h

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-02-10 02:27:55 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20090210022755-mxlvij3ndab1n5ty
Tags: upstream-1.0.2759+dfsg
ImportĀ upstreamĀ versionĀ 1.0.2759+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __clindexerprotocol__
 
2
#define __clindexerprotocol__
 
3
 
 
4
#include "named_pipe.h"
 
5
#include "cl_indexer_reply.h"
 
6
#include "cl_indexer_request.h"
 
7
 
 
8
 
 
9
class clIndexerProtocol {
 
10
 
 
11
public:
 
12
        clIndexerProtocol();
 
13
        ~clIndexerProtocol();
 
14
 
 
15
        /**
 
16
         * @brief send request to the server.
 
17
         * @param conn connection to use. The connection should already be connected
 
18
         * @param req request to send
 
19
         * @return true on success, false otherwise
 
20
         */
 
21
        static bool SendRequest  (clNamedPipe *conn, clIndexerRequest &req  );
 
22
        /**
 
23
         * @brief convert reply to binary and send it to the caller using named pipe.
 
24
         * @param conn [input] named pipe to use
 
25
         * @param reply [input] reply to send
 
26
         * @return true on success, false otherwise
 
27
         */
 
28
        static bool SendReply    (clNamedPipe *conn, clIndexerReply   &reply);
 
29
        /**
 
30
         * @brief read request from the named pipe. If any error occured, return false and abort the connection
 
31
         * @param conn [input] named pipe to use for reading the request
 
32
         * @param req [output] holds the received request. Should be used only if this function
 
33
         *        returns true
 
34
         * @return true on success, false otherwise
 
35
         */
 
36
        static bool ReadRequest  (clNamedPipe *conn, clIndexerRequest &req  );
 
37
        /**
 
38
         * @brief read reply from the server.
 
39
         * @param conn connection to use
 
40
         * @param reply [output]
 
41
         * @return true on success, false otherwise
 
42
         */
 
43
        static bool ReadReply    (clNamedPipe *conn, clIndexerReply   &reply);
 
44
 
 
45
};
 
46
#endif // __clindexerprotocol__