示例#1
0
gboolean t_test_second_service_client_send_blah_blah (TTestSecondServiceIf * iface, GError ** error)
{
    gint32 cseqid = 0;
    ThriftProtocol * protocol = T_TEST_SECOND_SERVICE_CLIENT (iface)->output_protocol;

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

    {
        gint32 ret;
        gint32 xfer = 0;


        if ((ret = thrift_protocol_write_struct_begin (protocol, "blahBlah_args", 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;
}
示例#2
0
gboolean calculator_client_send_ping (CalculatorIf * iface, GError ** error)
{
  gint32 cseqid = 0;
  ThriftProtocol * protocol = SHARED_SERVICE_CLIENT (iface)->output_protocol;

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

  {
    gint32 ret;
    gint32 xfer = 0;

    
    if ((ret = thrift_protocol_write_struct_begin (protocol, "ping_args", 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;
}
示例#3
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;
}
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;
}
示例#5
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;
}