Exemplo n.º 1
0
gboolean calculator_client_send_calculate (CalculatorIf * iface, const gint32 logid, const Work * w, GError ** error)
{
  gint32 cseqid = 0;
  ThriftProtocol * protocol = SHARED_SERVICE_CLIENT (iface)->output_protocol;

  if (thrift_protocol_write_message_begin (protocol, "calculate", T_CALL, cseqid, error) < 0)
    return FALSE;

  {
    gint32 ret;
    gint32 xfer = 0;

    
    if ((ret = thrift_protocol_write_struct_begin (protocol, "calculate_args", error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_field_begin (protocol, "logid", T_I32, 1, error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_i32 (protocol, logid, error)) < 0)
      return 0;
    if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_field_begin (protocol, "w", T_STRUCT, 2, error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_struct_write (THRIFT_STRUCT (w), protocol, error)) < 0)
      return 0;
    xfer += ret;

    if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_field_stop (protocol, error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_struct_end (protocol, error)) < 0)
      return 0;
    xfer += ret;

  }

  if (thrift_protocol_write_message_end (protocol, error) < 0)
    return FALSE;
  if (!thrift_transport_flush (protocol->transport, error))
    return FALSE;
  if (!thrift_transport_write_end (protocol->transport, error))
    return FALSE;

  return TRUE;
}
Exemplo n.º 2
0
gboolean calculator_client_send_add (CalculatorIf * iface, const gint32 num1, const gint32 num2, GError ** error)
{
  gint32 cseqid = 0;
  ThriftProtocol * protocol = SHARED_SERVICE_CLIENT (iface)->output_protocol;

  if (thrift_protocol_write_message_begin (protocol, "add", T_CALL, cseqid, error) < 0)
    return FALSE;

  {
    gint32 ret;
    gint32 xfer = 0;

    
    if ((ret = thrift_protocol_write_struct_begin (protocol, "add_args", error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_field_begin (protocol, "num1", T_I32, 1, error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_i32 (protocol, num1, error)) < 0)
      return 0;
    if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_field_begin (protocol, "num2", T_I32, 2, error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_i32 (protocol, num2, error)) < 0)
      return 0;
    if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_field_stop (protocol, error)) < 0)
      return 0;
    xfer += ret;
    if ((ret = thrift_protocol_write_struct_end (protocol, error)) < 0)
      return 0;
    xfer += ret;

  }

  if (thrift_protocol_write_message_end (protocol, error) < 0)
    return FALSE;
  if (!thrift_transport_flush (protocol->transport, error))
    return FALSE;
  if (!thrift_transport_write_end (protocol->transport, error))
    return FALSE;

  return TRUE;
}
Exemplo n.º 3
0
gint32
log_entry_write (ThriftStruct *object, ThriftProtocol *protocol, GError **error)
{
  gint32 ret;
  gint32 xfer = 0;

  LogEntry * this_object = LOG_ENTRY(object);
  THRIFT_UNUSED_VAR (this_object);
  if ((ret = thrift_protocol_write_struct_begin (protocol, "LogEntry", error)) < 0)
    return -1;
  xfer += ret;
  if ((ret = thrift_protocol_write_field_begin (protocol, "category", T_STRING, 1, error)) < 0)
    return -1;
  xfer += ret;
  if ((ret = thrift_protocol_write_string (protocol, this_object->category, error)) < 0)
    return -1;
  if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
    return -1;
  xfer += ret;
  if ((ret = thrift_protocol_write_field_begin (protocol, "message", T_STRING, 2, error)) < 0)
    return -1;
  xfer += ret;
  if ((ret = thrift_protocol_write_string (protocol, this_object->message, error)) < 0)
    return -1;
  if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
    return -1;
  xfer += ret;
  if ((ret = thrift_protocol_write_field_stop (protocol, error)) < 0)
    return -1;
  xfer += ret;
  if ((ret = thrift_protocol_write_struct_end (protocol, error)) < 0)
    return -1;
  xfer += ret;

  return xfer;
}
gboolean bucket_store_mapping_client_send_get_mapping (BucketStoreMappingIf * iface, const gchar * category, GError ** error)
{
    gint32 cseqid = 0;
    ThriftProtocol * protocol = BUCKET_STORE_MAPPING_CLIENT (iface)->output_protocol;

    if (thrift_protocol_write_message_begin (protocol, "getMapping", T_CALL, cseqid, error) < 0)
        return FALSE;

    {
        gint32 ret;
        gint32 xfer = 0;


        if ((ret = thrift_protocol_write_struct_begin (protocol, "getMapping_args", error)) < 0)
            return 0;
        xfer += ret;
        if ((ret = thrift_protocol_write_field_begin (protocol, "category", T_STRING, 1, error)) < 0)
            return 0;
        xfer += ret;
        if ((ret = thrift_protocol_write_string (protocol, category, error)) < 0)
            return 0;
        if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
            return 0;
        xfer += ret;
        if ((ret = thrift_protocol_write_field_stop (protocol, error)) < 0)
            return 0;
        xfer += ret;
        if ((ret = thrift_protocol_write_struct_end (protocol, error)) < 0)
            return 0;
        xfer += ret;

    }

    if (thrift_protocol_write_message_end (protocol, error) < 0)
        return FALSE;
    if (!thrift_transport_flush (protocol->transport, error))
        return FALSE;
    if (!thrift_transport_write_end (protocol->transport, error))
        return FALSE;

    return TRUE;
}
Exemplo n.º 5
0
gboolean t_test_second_service_client_send_secondtest_string (TTestSecondServiceIf * iface, const gchar * thing, GError ** error)
{
    gint32 cseqid = 0;
    ThriftProtocol * protocol = T_TEST_SECOND_SERVICE_CLIENT (iface)->output_protocol;

    if (thrift_protocol_write_message_begin (protocol, "secondtestString", T_CALL, cseqid, error) < 0)
        return FALSE;

    {
        gint32 ret;
        gint32 xfer = 0;


        if ((ret = thrift_protocol_write_struct_begin (protocol, "secondtestString_args", error)) < 0)
            return 0;
        xfer += ret;
        if ((ret = thrift_protocol_write_field_begin (protocol, "thing", T_STRING, 1, error)) < 0)
            return 0;
        xfer += ret;
        if ((ret = thrift_protocol_write_string (protocol, thing, error)) < 0)
            return 0;
        if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
            return 0;
        xfer += ret;
        if ((ret = thrift_protocol_write_field_stop (protocol, error)) < 0)
            return 0;
        xfer += ret;
        if ((ret = thrift_protocol_write_struct_end (protocol, error)) < 0)
            return 0;
        xfer += ret;

    }

    if (thrift_protocol_write_message_end (protocol, error) < 0)
        return FALSE;
    if (!thrift_transport_flush (protocol->transport, error))
        return FALSE;
    if (!thrift_transport_write_end (protocol->transport, error))
        return FALSE;

    return TRUE;
}