| 117 | } |
| 118 | |
| 119 | FieldInfo::FieldInfo(AST_Field& field) |
| 120 | : type_(field.field_type()) |
| 121 | , name_(field.local_name()->get_string()) |
| 122 | , scoped_type_(scoped_type(*type_, name_)) |
| 123 | , underscored_(underscore(scoped_type_)) |
| 124 | , type_name_(scoped_type_.substr(scoped_type_.rfind(scope_op) + 2)) |
| 125 | , act_(resolveActualType(type_)) |
| 126 | , cls_(classify(act_)) |
| 127 | , arr_(dynamic_cast<AST_Array*>(type_)) |
| 128 | , seq_(dynamic_cast<AST_Sequence*>(type_)) |
| 129 | , map_(dynamic_cast<AST_Map*>(type_)) |
| 130 | , as_base_(seq_or_arr_base_type(type_)) |
| 131 | , as_act_(as_base_ ? resolveActualType(as_base_) : 0) |
| 132 | , as_cls_(as_act_ ? classify(as_act_) : CL_UNKNOWN) |
| 133 | , scoped_elem_(as_base_ ? scoped(as_base_->name()) : "") |
| 134 | , underscored_elem_(as_base_ ? underscore(scoped_elem_) : "") |
| 135 | , elem_ref_(as_base_ ? ref(scoped_elem_, "") : "") |
| 136 | , elem_const_ref_(as_base_ ? ref(scoped_elem_) : "") |
| 137 | , n_elems_(container_element_limit(type_)) |
| 138 | , is_optional_(be_global->is_optional(&field)) |
| 139 | { |
| 140 | if (arr_) { |
| 141 | std::ostringstream os; |
| 142 | os << n_elems_; |
| 143 | length_ = os.str(); |
| 144 | arg_ = "arr"; |
| 145 | } else if (seq_) { |
| 146 | length_ = "length"; |
| 147 | arg_ = "seq"; |
| 148 | } else if (map_) { |
| 149 | arg_ = "map"; |
| 150 | } |
| 151 | |
| 152 | if (cxx11()) { |
| 153 | unwrap_ = scoped_type_ + "& " + arg_ + " = wrap;\n ACE_UNUSED_ARG(" + arg_ + ");\n"; |
| 154 | const_unwrap_ = " const " + unwrap_; |
| 155 | unwrap_ = " " + unwrap_; |
| 156 | arg_ = "wrap"; |
| 157 | ref_ = ref(scoped_type_, ""); |
| 158 | const_ref_ = ref(scoped_type_); |
| 159 | ptr_ = ref_ + '*'; |
| 160 | } else { |
| 161 | ref_ = scoped_type_ + (arr_ ? "_forany&" : "&"); |
| 162 | const_ref_ = "const " + ref_; |
| 163 | ptr_ = scoped_type_ + (arr_ ? "_forany*" : "*"); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | bool FieldInfo::is_new(EleLenSet& el_set) const |
| 168 | { |
nothing calls this directly
no test coverage detected