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_SIMPLE_SERVER_H 21 #define _THRIFT_SIMPLE_SERVER_H 22 23 #include <glib-object.h> 24 25 #include <thrift/c_glib/server/thrift_server.h> 26 27 G_BEGIN_DECLS 28 29 /*! \file thrift_simple_server.h 30 * \brief A simple Thrift server, single-threaded. 31 */ 32 33 /* type macros */ 34 #define THRIFT_TYPE_SIMPLE_SERVER (thrift_simple_server_get_type ()) 35 #define THRIFT_SIMPLE_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_SIMPLE_SERVER, ThriftSimpleServer)) 36 #define THRIFT_IS_SIMPLE_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_SIMPLE_SERVER)) 37 #define THRIFT_SIMPLE_SERVER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c) THRIFT_TYPE_SIMPLE_SERVER, ThriftSimpleServerClass)) 38 #define THRIFT_IS_SIMPLE_SERVER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_SIMPLE_SERVER)) 39 #define THRIFT_SIMPLE_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_SIMPLE_SERVER, ThriftSimpleServerClass)) 40 41 typedef struct _ThriftSimpleServer ThriftSimpleServer; 42 43 /** 44 * Thrift Simple Server instance. 45 */ 46 struct _ThriftSimpleServer 47 { 48 ThriftServer parent; 49 50 /* private */ 51 volatile gboolean running; 52 }; 53 54 typedef struct _ThriftSimpleServerClass ThriftSimpleServerClass; 55 56 /** 57 * Thrift Simple Server class. 58 */ 59 struct _ThriftSimpleServerClass 60 { 61 ThriftServerClass parent; 62 }; 63 64 /* used by THRIFT_TYPE_SIMPLE_SERVER */ 65 GType thrift_simple_server_get_type (void); 66 67 G_END_DECLS 68 69 #endif /* _THRIFT_SIMPLE_SERVER_H */ 70 71