12 #include "utl_identifier.h" 27 for (UTL_ScopedName* sn = name; sn && sn->tail();
28 sn =
static_cast<UTL_ScopedName*
>(sn->tail())) {
29 const string str = sn->head()->get_string();
31 be_global->header_ <<
"namespace " << str <<
" {\n";
37 "/// This structure supports use of std::map with one or more keys.\n" 38 "struct " <<
be_global->export_macro() <<
' ' <<
39 name->last_component()->get_string() <<
"_OpenDDS_KeyLessThan {\n";
46 " bool operator()(const " << cxx_name_ <<
"&, const " << cxx_name_ <<
"&) const\n" 48 " // With no keys, return false to allow use of\n" 49 " // map with just one entry\n";
56 " bool operator()(const " << cxx_name_ <<
"& v1, const " << cxx_name_ <<
"& v2) const\n" 64 " if (v1." << member <<
" < v2." << member <<
") return true;\n" 65 " if (v2." << member <<
" < v1." << member <<
") return false;\n";
74 for (
size_t i = 0; i <
n_; ++i) {
83 const std::vector<AST_Field*>&, AST_Type::SIZE_TYPE,
const char*)
87 const bool is_topic_type =
be_global->is_topic_type(node);
88 IDL_GlobalData::DCPS_Data_Type_Info* info = idl_global->is_dcps_type(name);
90 key_count = keys.
count();
92 key_count = info->key_list_.size();
101 const bool use_cxx11 =
be_global->language_mapping() == BE_GlobalData::LANGMAP_CXX11;
106 " using ::operator<; // TAO::String_Manager's operator< is " 113 string fname = i.
path();
116 }
else if (use_cxx11) {
122 IDL_GlobalData::DCPS_Data_Type_Info_Iter iter(info->key_list_);
123 for (
ACE_TString* kp = 0; iter.next(kp) != 0; iter.advance()) {
140 AST_Union* node, UTL_ScopedName*
name,
141 const std::vector<AST_UnionBranch*>&, AST_Type*,
const char*)
145 if (
be_global->union_discriminator_is_key(node)) {
bool gen_union(AST_Union *node, UTL_ScopedName *name, const std::vector< AST_UnionBranch *> &, AST_Type *, const char *)
void has_keys_signature()
bool gen_struct(AST_Structure *node, UTL_ScopedName *name, const std::vector< AST_Field *> &fields, AST_Type::SIZE_TYPE size, const char *repoid)
#define ACE_TEXT_ALWAYS_CHAR(STRING)
std::string insert_cxx11_accessor_parens(const std::string &full_var_name_, bool is_union_member=false)
std::string scoped(UTL_ScopedName *sn, EscapeContext ec=EscapeContext_Normal)
void key_compare(const string &member)
KeyLessThanWrapper(UTL_ScopedName *name)
BE_GlobalData * be_global
void has_no_keys_signature()
DDS::ReturnCode_t key_count(DDS::DynamicType_ptr type, size_t &count)