]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.h
buildsys: switch source download to quincy
[ceph.git] / ceph / src / jaegertracing / thrift / lib / c_glib / src / thrift / c_glib / transport / thrift_server_transport.h
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20 #ifndef _THRIFT_SERVER_TRANSPORT_H
21 #define _THRIFT_SERVER_TRANSPORT_H
22
23 #include <glib-object.h>
24
25 #include "thrift_transport.h"
26
27 G_BEGIN_DECLS
28
29 /*! \file thrift_server_transport.h
30 * \brief Abstract class for Thrift server transports.
31 */
32
33 /* type macros */
34 #define THRIFT_TYPE_SERVER_TRANSPORT (thrift_server_transport_get_type ())
35 #define THRIFT_SERVER_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_SERVER_TRANSPORT, ThriftServerTransport))
36 #define THRIFT_IS_SERVER_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_SERVER_TRANSPORT))
37 #define THRIFT_SERVER_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_SERVER_TRANSPORT, ThriftServerTransportClass))
38 #define THRIFT_IS_SERVER_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_SERVER_TRANSPORT))
39 #define THRIFT_SERVER_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_SERVER_TRANSPORT, ThriftServerTransportClass))
40
41 typedef struct _ThriftServerTransport ThriftServerTransport;
42
43 struct _ThriftServerTransport
44 {
45 GObject parent;
46 };
47
48 typedef struct _ThriftServerTransportClass ThriftServerTransportClass;
49
50 /*!
51 * Thrift Transport class
52 */
53 struct _ThriftServerTransportClass
54 {
55 GObjectClass parent;
56
57 /* vtable */
58 gboolean (*listen) (ThriftServerTransport *transport, GError **error);
59 ThriftTransport *(*accept) (ThriftServerTransport *transport, GError **error);
60 gboolean (*close) (ThriftServerTransport *transport, GError **error);
61 };
62
63 /* used by THRIFT_TYPE_SERVER_TRANSPORT */
64 GType thrift_server_transport_get_type (void);
65
66 /*!
67 * Listen for new connections.
68 * \public \memberof ThriftServerTransportClass
69 */
70 gboolean thrift_server_transport_listen (ThriftServerTransport *transport,
71 GError **error);
72
73 /*!
74 * Accept a connection.
75 * \public \memberof ThriftServerTransportClass
76 */
77 ThriftTransport *thrift_server_transport_accept
78 (ThriftServerTransport *transport, GError **error);
79
80 /*!
81 * Close the transport.
82 * \public \memberof ThriftServerTransportClass
83 */
84 gboolean thrift_server_transport_close (ThriftServerTransport *transport,
85 GError **error);
86
87 G_END_DECLS
88
89 #endif /* _THRIFT_SERVER_TRANSPORT_H */