~ubuntu-branches/ubuntu/natty/xmlrpc-c/natty

« back to all changes in this revision

Viewing changes to include/xmlrpc-c/server_pstream.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-01-06 18:56:02 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20110106185602-09og2x3suqlzbf6s
Tags: 1.16.32-0ubuntu1
* New upstream version (stable release). LP: #659591.
  - No unresolved symbols in the shared libraries. LP: #690779.
  - Builds with --no-add-needed and --as-needed.
* Rename shared library packages.
* Add symbols files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SERVER_PSTREAM_HPP_INCLUDED
 
2
#define SERVER_PSTREAM_HPP_INCLUDED
 
3
 
 
4
#ifdef WIN32
 
5
#include <winsock.h>  /* For XMLRPC_SOCKET (= SOCKET) */
 
6
#endif
 
7
 
 
8
#include <xmlrpc-c/config.h>  /* For XMLRPC_SOCKET */
 
9
#include <xmlrpc-c/registry.hpp>
 
10
#include <xmlrpc-c/packetsocket.hpp>
 
11
 
 
12
namespace xmlrpc_c {
 
13
 
 
14
class serverPstreamConn {
 
15
 
 
16
public:
 
17
 
 
18
    class constrOpt {
 
19
    public:
 
20
        constrOpt();
 
21
 
 
22
        constrOpt & registryPtr       (xmlrpc_c::registryPtr      const& arg);
 
23
        constrOpt & registryP         (const xmlrpc_c::registry * const& arg);
 
24
        constrOpt & socketFd          (XMLRPC_SOCKET  const& arg);
 
25
 
 
26
        struct value {
 
27
            xmlrpc_c::registryPtr      registryPtr;
 
28
            const xmlrpc_c::registry * registryP;
 
29
            XMLRPC_SOCKET              socketFd;
 
30
        } value;
 
31
        struct {
 
32
            bool registryPtr;
 
33
            bool registryP;
 
34
            bool socketFd;
 
35
        } present;
 
36
    };
 
37
 
 
38
    serverPstreamConn(constrOpt const& opt);
 
39
 
 
40
    ~serverPstreamConn();
 
41
 
 
42
    void
 
43
    runOnce(volatile const int * const interruptP,
 
44
            bool *               const eofP);
 
45
 
 
46
    void
 
47
    runOnce(bool * const eofP);
 
48
 
 
49
private:
 
50
 
 
51
    // 'registryP' is what we actually use; 'registryHolder' just holds a
 
52
    // reference to 'registryP' so the registry doesn't disappear while
 
53
    // this server exists.  But note that if the creator doesn't supply
 
54
    // a registryPtr, 'registryHolder' is just a placeholder variable and
 
55
    // the creator is responsible for making sure the registry doesn't
 
56
    // go anywhere while the server exists.
 
57
 
 
58
    registryPtr registryHolder;
 
59
    const registry * registryP;
 
60
 
 
61
    packetSocket * packetSocketP;
 
62
        // The packet socket over which we received RPCs.
 
63
        // This is permanently connected to our fixed client.
 
64
 
 
65
    void
 
66
    establishRegistry(constrOpt const& opt);
 
67
 
 
68
    void
 
69
    establishPacketSocket(constrOpt const& opt);
 
70
};
 
71
 
 
72
 
 
73
} // namespace
 
74
 
 
75
#endif