compiler/cpp/src/generate/t_hs_generator.cc
void t_hs_generator::generate_hs_function_helpers(t_function* tfunction) {
  t_struct result(program_, decapitalize(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_hs_struct_definition(f_service_,&result, false);
}
/**
 * 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_hs_generator::generate_hs_function_helpers(t_function* tfunction) {
  t_struct result(program_, decapitalize(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_hs_struct_definition(f_service_,&result, false);
}
void t_hs_generator :: generate_hs_function_helpers ( t_function * tfunction ) { t_struct result ( program_ , decapitalize ( 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_hs_struct_definition ( f_service_ , & result , false ) ; }
Generates a struct and helpers for a function.
Generates a struct and helpers for a function .