compiler/cpp/src/generate/t_go_generator.cc
/**
 * Generates a struct and helpers for a function.
 *
 * @param tfunction The function
 */
Generates a struct and helpers for a function.
@param tfunction The function
Generates a struct and helpers for a function . @param tfunction The function
void t_go_generator::generate_go_function_helpers(t_function* tfunction) {
  if (true || !tfunction->is_oneway()) {
    t_struct result(program_, tfunction->get_name() + "_result");
    t_field success(tfunction->get_returntype(), "success", 0);
    if (!tfunction->get_returntype()->is_void()) {
      result.append(&success);
    }
    t_struct* xs = tfunction->get_xceptions();
    const vector<t_field*>& fields = xs->get_members();
    vector<t_field*>::const_iterator f_iter;
    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
      result.append(*f_iter);
    }
    generate_go_struct_definition(f_service_, &result, false, true);
  }
}
void t_go_generator :: generate_go_function_helpers ( t_function * tfunction ) { if ( true || ! tfunction -> is_oneway ( ) ) { t_struct result ( program_ , tfunction -> get_name ( ) + " " ) ; t_field success ( tfunction -> get_returntype ( ) , " " , 0 ) ; if ( ! tfunction -> get_returntype ( ) -> is_void ( ) ) { result . append ( & success ) ; } t_struct * xs = tfunction -> get_xceptions ( ) ; const vector < t_field * > & fields = xs -> get_members ( ) ; vector < t_field * > :: const_iterator f_iter ; for ( f_iter = fields . begin ( ) ; f_iter != fields . end ( ) ; ++ f_iter ) { result . append ( * f_iter ) ; } generate_go_struct_definition ( f_service_ , & result , false , true ) ; } }
Generates a struct and helpers for a function.
Generates a struct and helpers for a function .