blob: edf9984266a8c86d4bb2b4203eaa2262f7cc567f [file] [log] [blame]
Roger Meierc1010922010-11-26 10:17:48 +00001/*
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
Roger Meier213a6642010-10-27 12:30:11 +000020#ifndef THRIFT_STRUCT_H
21#define THRIFT_STRUCT_H
22
23#include <glib-object.h>
24
25#include "protocol/thrift_protocol.h"
26
Roger Meierc1010922010-11-26 10:17:48 +000027G_BEGIN_DECLS
28
Roger Meier213a6642010-10-27 12:30:11 +000029#define THRIFT_TYPE_STRUCT (thrift_struct_get_type ())
Roger Meierc1010922010-11-26 10:17:48 +000030#define THRIFT_STRUCT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_STRUCT, ThriftStruct))
31#define THRIFT_STRUCT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_STRUCT, ThriftStructClass))
32#define THRIFT_IS_STRUCT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_STRUCT))
33#define THRIFT_IS_STRUCT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_STRUCT))
34#define THRIFT_STRUCT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_STRUCT, ThriftStructClass))
Roger Meier213a6642010-10-27 12:30:11 +000035
36/* struct */
37struct _ThriftStruct
38{
39 GObject parent;
40
41 /* private */
42};
43typedef struct _ThriftStruct ThriftStruct;
44
45struct _ThriftStructClass
46{
47 GObjectClass parent;
48
49 /* public */
50 gint32 (*read) (ThriftStruct *object, ThriftProtocol *protocol,
51 GError **error);
52 gint32 (*write) (ThriftStruct *object, ThriftProtocol *protocol,
53 GError **error);
54};
55typedef struct _ThriftStructClass ThriftStructClass;
56
57GType thrift_struct_get_type (void);
58
59gint32 thrift_struct_read (ThriftStruct *object, ThriftProtocol *protocol,
60 GError **error);
61
62gint32 thrift_struct_write (ThriftStruct *object, ThriftProtocol *protocol,
63 GError **error);
Roger Meierc1010922010-11-26 10:17:48 +000064G_END_DECLS
Roger Meier213a6642010-10-27 12:30:11 +000065
66#endif