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_APPLICATION_EXCEPTION_H 21 #define _THRIFT_APPLICATION_EXCEPTION_H 22 23 #include <glib-object.h> 24 #include "thrift_struct.h" 25 26 G_BEGIN_DECLS 27 28 /*! \file thrift_application_exception.h 29 * \brief C Implementation of a TApplicationException. 30 */ 31 32 /* type macros */ 33 #define THRIFT_TYPE_APPLICATION_EXCEPTION (thrift_application_exception_get_type ()) 34 #define THRIFT_APPLICATION_EXCEPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_APPLICATION_EXCEPTION, ThriftApplicationException)) 35 #define THRIFT_IS_APPLICATION_EXCEPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_APPLICATION_EXCEPTION)) 36 #define THRIFT_APPLICATION_EXCEPTION_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_APPLICATION_EXCEPTION, ThriftApplicationExceptionClass)) 37 #define THRIFT_IS_APPLICATION_EXCEPTION_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_APPLICATION_EXCEPTION)) 38 #define THRIFT_APPLICATION_EXCEPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_APPLICATION_EXCEPTION, ThriftApplicationExceptionClass)) 39 40 typedef struct _ThriftApplicationException ThriftApplicationException; 41 42 struct _ThriftApplicationException 43 { 44 ThriftStruct parent; 45 46 /* private */ 47 gint32 type; 48 gboolean __isset_type; 49 gchar *message; 50 gboolean __isset_message; 51 }; 52 53 typedef struct _ThriftApplicationExceptionClass ThriftApplicationExceptionClass; 54 55 struct _ThriftApplicationExceptionClass 56 { 57 ThriftStructClass parent; 58 }; 59 60 GType thrift_application_exception_get_type (void); 61 62 /* gerror codes */ 63 typedef enum 64 { 65 THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN, 66 THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN_METHOD, 67 THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_MESSAGE_TYPE, 68 THRIFT_APPLICATION_EXCEPTION_ERROR_WRONG_METHOD_NAME, 69 THRIFT_APPLICATION_EXCEPTION_ERROR_BAD_SEQUENCE_ID, 70 THRIFT_APPLICATION_EXCEPTION_ERROR_MISSING_RESULT, 71 THRIFT_APPLICATION_EXCEPTION_ERROR_INTERNAL_ERROR, 72 THRIFT_APPLICATION_EXCEPTION_ERROR_PROTOCOL_ERROR, 73 THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_TRANSFORM, 74 THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_PROTOCOL, 75 THRIFT_APPLICATION_EXCEPTION_ERROR_UNSUPPORTED_CLIENT_TYPE, 76 77 THRIFT_APPLICATION_EXCEPTION_ERROR_N 78 } ThriftApplicationExceptionError; 79 80 /* define error domain for GError */ 81 GQuark thrift_application_exception_error_quark (void); 82 #define THRIFT_APPLICATION_EXCEPTION_ERROR (thrift_application_exception_error_quark ()) 83 84 G_END_DECLS 85 86 #endif /* _THRIFT_APPLICATION_EXCEPTION_H */ 87