]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
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_FRAMED_TRANSPORT_H | |
21 | #define _THRIFT_FRAMED_TRANSPORT_H | |
22 | ||
23 | #include <glib.h> | |
24 | #include <glib-object.h> | |
25 | ||
26 | #include <thrift/c_glib/transport/thrift_transport.h> | |
27 | ||
28 | G_BEGIN_DECLS | |
29 | ||
30 | /*! \file thrift_framed_transport.h | |
31 | * \brief Implementation of a Thrift framed transport. Subclasses | |
32 | * the ThriftTransport class. | |
33 | */ | |
34 | ||
35 | /* type macros */ | |
36 | #define THRIFT_TYPE_FRAMED_TRANSPORT (thrift_framed_transport_get_type ()) | |
37 | #define THRIFT_FRAMED_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_FRAMED_TRANSPORT, ThriftFramedTransport)) | |
38 | #define THRIFT_IS_FRAMED_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_FRAMED_TRANSPORT)) | |
39 | #define THRIFT_FRAMED_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_FRAMED_TRANSPORT, ThriftFramedTransportClass)) | |
40 | #define THRIFT_IS_FRAMED_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_FRAMED_TRANSPORT) | |
41 | #define THRIFT_FRAMED_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_FRAMED_TRANSPORT, ThriftFramedTransportClass)) | |
42 | ||
43 | typedef struct _ThriftFramedTransport ThriftFramedTransport; | |
44 | ||
45 | /*! | |
46 | * ThriftFramedTransport instance. | |
47 | */ | |
48 | struct _ThriftFramedTransport | |
49 | { | |
50 | ThriftTransport parent; | |
51 | ||
52 | /* protected */ | |
53 | ThriftTransport *transport; | |
54 | ||
55 | /* private */ | |
56 | GByteArray *r_buf; | |
57 | GByteArray *w_buf; | |
58 | guint32 r_buf_size; | |
59 | guint32 w_buf_size; | |
60 | }; | |
61 | ||
62 | typedef struct _ThriftFramedTransportClass ThriftFramedTransportClass; | |
63 | ||
64 | /*! | |
65 | * ThriftFramedTransport class. | |
66 | */ | |
67 | struct _ThriftFramedTransportClass | |
68 | { | |
69 | ThriftTransportClass parent; | |
70 | }; | |
71 | ||
72 | /* used by THRIFT_TYPE_FRAMED_TRANSPORT */ | |
73 | GType thrift_framed_transport_get_type (void); | |
74 | ||
75 | G_END_DECLS | |
76 | ||
77 | #endif |