Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3297

c_glib: an abstract base class is not generated

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 0.9.1
    • Fix Version/s: 0.9.3
    • Component/s: C glib - Compiler
    • Labels:
      None

      Description

      The tutorial says:

      For each service the Thrift compiler generates an abstract base
      class from which handler implementations should inherit. In our
      case TutorialCalculatorHandler inherits from CalculatorHandler,
      defined in gen-c_glib/calculator.h.

      However, when I run

      thrift -r --gen c_glib tutorial.thrift
      

      I get:

      /**
       * Autogenerated by Thrift Compiler (0.9.1)
       *
       * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
       *  @generated
       */
      #ifndef CALCULATOR_H
      #define CALCULATOR_H
      
      #include "tutorial_types.h"
      #include "shared_service.h"
      
      /* Calculator service interface */
      typedef struct _CalculatorIf CalculatorIf;  /* dummy object */
      
      struct _CalculatorIfInterface
      {
        GTypeInterface parent;
      
        gboolean (*ping) (CalculatorIf *iface, GError **error);
        gboolean (*add) (CalculatorIf *iface, gint32* _return, const gint32 num1, const gint32 num2, GError **error);
        gboolean (*calculate) (CalculatorIf *iface, gint32* _return, const gint32 logid, const Work * w, InvalidOperation ** ouch, GError **error);
        gboolean (*zip) (CalculatorIf *iface, GError **error);
      };
      typedef struct _CalculatorIfInterface CalculatorIfInterface;
      
      GType calculator_if_get_type (void);
      #define TYPE_CALCULATOR_IF (calculator_if_get_type())
      #define CALCULATOR_IF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CALCULATOR_IF, CalculatorIf))
      #define IS_CALCULATOR_IF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CALCULATOR_IF))
      #define CALCULATOR_IF_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), TYPE_CALCULATOR_IF, CalculatorIfInterface))
      
      gboolean calculator_if_ping (CalculatorIf *iface, GError **error);
      gboolean calculator_if_add (CalculatorIf *iface, gint32* _return, const gint32 num1, const gint32 num2, GError **error);
      gboolean calculator_if_calculate (CalculatorIf *iface, gint32* _return, const gint32 logid, const Work * w, InvalidOperation ** ouch, GError **error);
      gboolean calculator_if_zip (CalculatorIf *iface, GError **error);
      
      /* Calculator service client */
      struct _CalculatorClient
      {
        GObject parent;
      
        ThriftProtocol *input_protocol;
        ThriftProtocol *output_protocol;
      };
      typedef struct _CalculatorClient CalculatorClient;
      
      struct _CalculatorClientClass
      {
        GObjectClass parent;
      };
      typedef struct _CalculatorClientClass CalculatorClientClass;
      
      GType calculator_client_get_type (void);
      #define TYPE_CALCULATOR_CLIENT (calculator_client_get_type())
      #define CALCULATOR_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CALCULATOR_CLIENT, CalculatorClient))
      #define CALCULATOR_CLIENT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TYPE_CALCULATOR_CLIENT, CalculatorClientClass))
      #define CALCULATOR_IS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CALCULATOR_CLIENT))
      #define CALCULATOR_IS_CLIENT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), TYPE_CALCULATOR_CLIENT))
      #define CALCULATOR_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CALCULATOR_CLIENT, CalculatorClientClass))
      
      gboolean calculator_client_ping (CalculatorIf * iface, GError ** error);
      gboolean calculator_client_send_ping (CalculatorIf * iface, GError ** error);
      gboolean calculator_client_recv_ping (CalculatorIf * iface, GError ** error);
      gboolean calculator_client_add (CalculatorIf * iface, gint32* _return, const gint32 num1, const gint32 num2, GError ** error);
      gboolean calculator_client_send_add (CalculatorIf * iface, const gint32 num1, const gint32 num2, GError ** error);
      gboolean calculator_client_recv_add (CalculatorIf * iface, gint32* _return, GError ** error);
      gboolean calculator_client_calculate (CalculatorIf * iface, gint32* _return, const gint32 logid, const Work * w, InvalidOperation ** ouch, GError ** error);
      gboolean calculator_client_send_calculate (CalculatorIf * iface, const gint32 logid, const Work * w, GError ** error);
      gboolean calculator_client_recv_calculate (CalculatorIf * iface, gint32* _return, InvalidOperation ** ouch, GError ** error);
      gboolean calculator_client_zip (CalculatorIf * iface, GError ** error);
      gboolean calculator_client_send_zip (CalculatorIf * iface, GError ** error);
      void calculator_client_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
      void calculator_client_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
      
      #endif /* CALCULATOR_H */
      

      There is no definition in other files either:

      $ grep -iR handler gen-c_glib
      $
      

      What am I missing?

        Attachments

          Activity

            People

            • Assignee:
              simonsouth Simon South
              Reporter:
              pavel Pavel Paulau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: