#include "metaclass_generator.h"
#include "be_extern.h"
#include "utl_identifier.h"
Go to the source code of this file.
Functions | |
static std::string | func (const std::string &, AST_Type *br_type, const std::string &, std::string &, const std::string &) |
static std::string func | ( | const std::string & | , | |
AST_Type * | br_type, | |||
const std::string & | , | |||
std::string & | , | |||
const std::string & | ||||
) | [static] |
Definition at line 544 of file metaclass_generator.cpp.
References AstTypeClassification::classify(), and scoped().
Referenced by metaclass_generator::gen_union().
00549 { 00550 std::stringstream ss; 00551 const Classification br_cls = classify(br_type); 00552 if (br_cls & CL_STRING) { 00553 ss << 00554 " ACE_CDR::ULong len;\n" 00555 " if (!(ser >> len)) return false;\n" 00556 " if (!ser.skip(static_cast<ACE_UINT16>(len))) return false;\n"; 00557 } else if (br_cls & CL_WIDE) { 00558 ss << 00559 " ACE_CDR::Octet len;\n" 00560 " if (!(ser >> ACE_InputCDR::to_octet(len))) return false;\n" 00561 " if (!ser.skip(len)) return false;\n"; 00562 } else if (br_cls & CL_SCALAR) { 00563 int sz = 1; 00564 to_cxx_type(br_type, sz); 00565 ss << 00566 " if (!ser.skip(1, " << sz << ")) return false;\n"; 00567 } else { 00568 ss << 00569 " if (!gen_skip_over(ser, static_cast<" << scoped(br_type->name()) << 00570 ((br_cls & CL_ARRAY) ? "_forany" : "") << "*>(0))) return false;\n"; 00571 } 00572 00573 ss << 00574 " return true;\n"; 00575 return ss.str(); 00576 }