]>
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_TRANSPORT_FACTORY_H | |
21 | #define _THRIFT_TRANSPORT_FACTORY_H | |
22 | ||
23 | #include <glib-object.h> | |
24 | ||
25 | #include "thrift_transport.h" | |
26 | ||
27 | G_BEGIN_DECLS | |
28 | ||
29 | /*! \file thrift_transport_factory.h | |
30 | * \brief Base class for Thrift Transport Factories. Used by Thrift Servers | |
31 | * to obtain a client transport from an existing transport. The default | |
32 | * implementation simply clones the provided transport. | |
33 | */ | |
34 | ||
35 | /* type macros */ | |
36 | #define THRIFT_TYPE_TRANSPORT_FACTORY (thrift_transport_factory_get_type ()) | |
37 | #define THRIFT_TRANSPORT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_TRANSPORT_FACTORY, ThriftTransportFactory)) | |
38 | #define THRIFT_IS_TRANSPORT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_TRANSPORT_FACTORY)) | |
39 | #define THRIFT_TRANSPORT_FACTORY_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_TRANSPORT_FACTORY, ThriftTransportFactoryClass)) | |
40 | #define THRIFT_IS_TRANSPORT_FACTORY_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_TRANSPORT_FACTORY)) | |
41 | #define THRIFT_TRANSPORT_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_TRANSPORT_FACTORY, ThriftTransportFactoryClass)) | |
42 | ||
43 | typedef struct _ThriftTransportFactory ThriftTransportFactory; | |
44 | ||
45 | /* Thrift Transport Factory instance */ | |
46 | struct _ThriftTransportFactory | |
47 | { | |
48 | GObject parent; | |
49 | }; | |
50 | ||
51 | typedef struct _ThriftTransportFactoryClass ThriftTransportFactoryClass; | |
52 | ||
53 | /* Thrift Transport Factory class */ | |
54 | struct _ThriftTransportFactoryClass | |
55 | { | |
56 | GObjectClass parent; | |
57 | ||
58 | /* vtable */ | |
59 | ThriftTransport *(*get_transport) (ThriftTransportFactory *factory, | |
60 | ThriftTransport *transport); | |
61 | }; | |
62 | ||
63 | /* used by THRIFT_TYPE_TRANSPORT_FACTORY */ | |
64 | GType thrift_transport_factory_get_type (void); | |
65 | ||
66 | /* virtual public methods */ | |
67 | ThriftTransport *thrift_transport_factory_get_transport (ThriftTransportFactory *factory, ThriftTransport *transport); | |
68 | ||
69 | G_END_DECLS | |
70 | ||
71 | #endif /* _THRIFT_TRANSPORT_FACTORY_H */ |