diff --git a/compiler2/record_of.c b/compiler2/record_of.c index 5661ea006feb0d2eaf0ce15e0d816ccc38904268..eab0e0def7b9caabc4717bcb3d3b68a6d46221d1 100644 --- a/compiler2/record_of.c +++ b/compiler2/record_of.c @@ -4686,16 +4686,12 @@ void defRecordOfTemplate2(const struct_of_def *sdef, output_struct *output) "const %s_template& right_template);\n", name, name); def = mputprintf(def, "friend %s_template operator+(const %s& left_value, " "const %s_template& right_template);\n", name, name, name); - def = mputprintf(def, "friend %s_template operator+(const OPTIONAL<%s>& left_value, " - "const %s_template& right_template);\n", name, name, name); def = mputprintf(def, "friend %s_template operator+(template_sel left_template, " "const %s& right_value);\n", name, name); def = mputprintf(def, "friend %s_template operator+(template_sel left_template, " "const OPTIONAL<%s>& right_value);\n", name, name); def = mputprintf(def, "friend %s_template operator+(const %s& left_value, " "template_sel right_template);\n", name, name); - def = mputprintf(def, "friend %s_template operator+(const OPTIONAL<%s>& left_value, " - "template_sel right_template);\n", name, name); /* public member functions */ def = mputstr(def, "\npublic:\n"); @@ -4822,18 +4818,6 @@ void defRecordOfTemplate2(const struct_of_def *sdef, output_struct *output) "return ret_val;\n" "}\n\n", name, name, name, name); - def = mputprintf(def, "%s_template operator+(" - "const OPTIONAL<%s>& other_value) const;\n", name, name); - src = mputprintf(src, - "%s_template %s_template::operator+(const OPTIONAL<%s>& other_value) const\n" - "{\n" - "if (other_value.is_present()) {\n" - "return *this + (const %s&)other_value;\n" - "}\n" - "TTCN_error(\"Operand of %s of template concatenation is an unbound or " - "omitted record/set field.\");\n" - "}\n\n", name, name, name, name, sdef->kind == RECORD_OF ? "record" : "set"); - def = mputprintf(def, "%s_template operator+(template_sel other_value) const;\n", name); src = mputprintf(src, @@ -5018,22 +5002,6 @@ void defRecordOfTemplate2(const struct_of_def *sdef, output_struct *output) "return ret_val;\n" "}\n\n", name, name, name, name, name); - output->header.function_prototypes = - mputprintf(output->header.function_prototypes, - "extern %s_template operator+(const OPTIONAL<%s>& left_value, " - "const %s_template& right_template);\n", name, name, name); - output->source.function_bodies = - mputprintf(output->source.function_bodies, - "%s_template operator+(const OPTIONAL<%s>& left_value, " - "const %s_template& right_template)\n" - "{\n" - "if (left_value.is_present()) {\n" - "return (const %s&)left_value + right_template;\n" - "}\n" - "TTCN_error(\"Operand of %s of template concatenation is an unbound or " - "omitted record/set field.\");\n" - "}\n\n", name, name, name, name, sdef->kind == RECORD_OF ? "record" : "set"); - output->header.function_prototypes = mputprintf(output->header.function_prototypes, "extern %s_template operator+(template_sel left_template, " @@ -5055,22 +5023,6 @@ void defRecordOfTemplate2(const struct_of_def *sdef, output_struct *output) "return ret_val;\n" "}\n\n", name, name, name, name, name); - output->header.function_prototypes = - mputprintf(output->header.function_prototypes, - "extern %s_template operator+(template_sel left_template, " - "const OPTIONAL<%s>& right_value);\n", name, name); - output->source.function_bodies = - mputprintf(output->source.function_bodies, - "%s_template operator+(template_sel left_template, " - "const OPTIONAL<%s>& right_value)\n" - "{\n" - "if (right_value.is_present()) {\n" - "return left_template + (const %s&)right_value;\n" - "}\n" - "TTCN_error(\"Operand of %s template concatenation is an unbound or " - "omitted record/set field.\");\n" - "}\n\n", name, name, name, sdef->kind == RECORD_OF ? "record" : "set"); - output->header.function_prototypes = mputprintf(output->header.function_prototypes, "extern %s_template operator+(const %s& left_value, " @@ -5091,20 +5043,4 @@ void defRecordOfTemplate2(const struct_of_def *sdef, output_struct *output) "ret_val.concat(pos);\n" "return ret_val;\n" "}\n\n", name, name, name, name, name); - - output->header.function_prototypes = - mputprintf(output->header.function_prototypes, - "extern %s_template operator+(const OPTIONAL<%s>& left_value, " - "template_sel right_template);\n", name, name); - output->source.function_bodies = - mputprintf(output->source.function_bodies, - "%s_template operator+(const OPTIONAL<%s>& left_value, " - "template_sel right_template)\n" - "{\n" - "if (left_value.is_present()) {\n" - "return (const %s&)left_value + right_template;\n" - "}\n" - "TTCN_error(\"Operand of %s template concatenation is an unbound or " - "omitted record/set field.\");\n" - "}\n\n", name, name, name, sdef->kind == RECORD_OF ? "record" : "set"); } diff --git a/compiler2/ttcn3/PatternString.cc b/compiler2/ttcn3/PatternString.cc index f136d39768fe440746f0e81f96f511b9f8750b1a..c506f1b2e9e44c18d056e1b62c4615ec05d578a6 100644 --- a/compiler2/ttcn3/PatternString.cc +++ b/compiler2/ttcn3/PatternString.cc @@ -504,8 +504,8 @@ namespace Ttcn { string PatternString::create_charstring_literals(Common::Module *p_mod, string& preamble) { /* The cast is there for the benefit of OPTIONAL<CHARSTRING>, because - * it doesn't have operator+(). Only the first member needs the cast - * (the others will be automagically converted to satisfy + * it doesn't have operator+(). In most cases only the first member needs + * the cast (the others will be automagically converted to satisfy * CHARSTRING::operator+(const CHARSTRING&) ) */ string s; if (pattern_type == CSTR_PATTERN) @@ -612,13 +612,19 @@ namespace Ttcn { break; } // Not known in compile time case ps_elem_t::PSE_REF: { + Common::Assignment* assign = pse->ref->get_refd_assignment(); + if (use_runtime_2 && i > 0 && + assign->get_Type()->field_is_optional(pse->ref->get_subrefs())) { + // in RT2 convert all operands of type OPTIONAL<CHARSTRING> to + // CHARSTRING, not just the first one + s += "(CHARSTRING)"; + } expression_struct expr; Code::init_expr(&expr); pse->ref->generate_code(&expr); if (expr.preamble || expr.postamble) FATAL_ERROR("PatternString::create_charstring_literals()"); s += expr.expr; - Common::Assignment* assign = pse->ref->get_refd_assignment(); char* str = NULL; // TODO: these checks will generated each time a reference is referenced in a pattern diff --git a/compiler2/ttcn3/TtcnTemplate.cc b/compiler2/ttcn3/TtcnTemplate.cc index 2334861ef6037dfd2afd87db266358cf983719ca..b8018db2110d06ec4d0dbb4b641c762c25dac845 100644 --- a/compiler2/ttcn3/TtcnTemplate.cc +++ b/compiler2/ttcn3/TtcnTemplate.cc @@ -1733,6 +1733,17 @@ namespace Ttcn { return first ? u.concat.op1 : u.concat.op2; } + bool Template::is_optional_value_ref() const + { + if (templatetype != SPECIFIC_VALUE || + u.specific_value->get_valuetype() != Common::Value::V_REFD) { + return false; + } + Common::Reference* ref = u.specific_value->get_reference(); + return ref->get_refd_assignment()->get_Type()->field_is_optional( + ref->get_subrefs()); + } + Template* Template::get_template_refd(ReferenceChain *refch) { unsigned int const prev_err_count = get_error_count(); @@ -5006,7 +5017,7 @@ compile_time: string left_expr; string right_expr; if (u.concat.op1->has_single_expr()) { - left_expr = u.concat.op1->get_single_expr(false); + left_expr = u.concat.op1->get_single_expr(u.concat.op1->is_optional_value_ref()); } else { left_expr = my_scope->get_scope_mod_gen()->get_temporary_id(); @@ -5015,7 +5026,7 @@ compile_time: str = u.concat.op1->generate_code_init(str, left_expr.c_str()); } if (u.concat.op2->has_single_expr()) { - right_expr = u.concat.op2->get_single_expr(false); + right_expr = u.concat.op2->get_single_expr(u.concat.op2->is_optional_value_ref()); } else { right_expr = my_scope->get_scope_mod_gen()->get_temporary_id(); @@ -5326,8 +5337,8 @@ compile_time: if (!use_runtime_2) { FATAL_ERROR("Template::get_single_expr()"); } - ret_val = u.concat.op1->get_single_expr(false) + " + " + - u.concat.op2->get_single_expr(false); + ret_val = u.concat.op1->get_single_expr(u.concat.op1->is_optional_value_ref()) + " + " + + u.concat.op2->get_single_expr(u.concat.op2->is_optional_value_ref()); break; default: FATAL_ERROR("Template::get_single_expr()"); diff --git a/compiler2/ttcn3/TtcnTemplate.hh b/compiler2/ttcn3/TtcnTemplate.hh index 4053e1cfad79d957959202348ba8e78972247a13..a45168e51ccdae735c78c2e9f64eb8c8922abdd9 100644 --- a/compiler2/ttcn3/TtcnTemplate.hh +++ b/compiler2/ttcn3/TtcnTemplate.hh @@ -310,6 +310,7 @@ namespace Ttcn { Value* get_string_encoding() const; TemplateInstance* get_decode_target() const; Template* get_concat_operand(bool first) const; + bool is_optional_value_ref() const; private: Template* get_template_refd(ReferenceChain *refch); Template* get_refd_field_template(const Identifier& field_id, diff --git a/core/Bitstring.cc b/core/Bitstring.cc index 44ec48d7d9f4a37c0f169ea06c06634a2f2fb823..b4d030699198b335ad8dc7fb08b3d66d02859dcc 100644 --- a/core/Bitstring.cc +++ b/core/Bitstring.cc @@ -257,16 +257,6 @@ BITSTRING BITSTRING::operator+(const BITSTRING_ELEMENT& other_value) const return ret_val; } -#ifdef TITAN_RUNTIME_2 -BITSTRING BITSTRING::operator+(const OPTIONAL<BITSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const BITSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of bitstring concatenation."); -} -#endif - BITSTRING BITSTRING::operator~() const { must_bound("Unbound bitstring operand of operator not4b."); @@ -1417,17 +1407,6 @@ BITSTRING BITSTRING_ELEMENT::operator+(const BITSTRING_ELEMENT& other_value) return BITSTRING(2, &result); } -#ifdef TITAN_RUNTIME_2 -BITSTRING BITSTRING_ELEMENT::operator+( - const OPTIONAL<BITSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const BITSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of bitstring concatenation."); -} -#endif - BITSTRING BITSTRING_ELEMENT::operator~() const { must_bound("Unbound bitstring element operand of operator not4b."); @@ -1905,16 +1884,6 @@ BITSTRING_template BITSTRING_template::operator+( return *this + BITSTRING(other_value); } -BITSTRING_template BITSTRING_template::operator+( - const OPTIONAL<BITSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const BITSTRING&)other_value; - } - TTCN_error("Operand of bitstring template concatenation is an " - "unbound or omitted record/set field."); -} - BITSTRING_template BITSTRING_template::operator+( template_sel other_template_sel) const { @@ -1950,16 +1919,6 @@ BITSTRING_template operator+(const BITSTRING_ELEMENT& left_value, return BITSTRING(left_value) + right_template; } -BITSTRING_template operator+(const OPTIONAL<BITSTRING>& left_value, - const BITSTRING_template& right_template) -{ - if (left_value.is_present()) { - return (const BITSTRING&)left_value + right_template; - } - TTCN_error("Operand of bitstring template concatenation is an " - "unbound or omitted record/set field."); -} - BITSTRING_template operator+(template_sel left_template_sel, const BITSTRING_template& right_template) { @@ -1993,16 +1952,6 @@ BITSTRING_template operator+(const BITSTRING_ELEMENT& left_value, return BITSTRING(left_value) + right_template_sel; } -BITSTRING_template operator+(const OPTIONAL<BITSTRING>& left_value, - template_sel right_template_sel) -{ - if (left_value.is_present()) { - return (const BITSTRING&)left_value + right_template_sel; - } - TTCN_error("Operand of bitstring template concatenation is an " - "unbound or omitted record/set field."); -} - BITSTRING_template operator+(template_sel left_template_sel, const BITSTRING& right_value) { @@ -2018,16 +1967,6 @@ BITSTRING_template operator+(template_sel left_template_sel, { return left_template_sel + BITSTRING(right_value); } - -BITSTRING_template operator+(template_sel left_template_sel, - const OPTIONAL<BITSTRING>& right_value) -{ - if (right_value.is_present()) { - return left_template_sel + (const BITSTRING&)right_value; - } - TTCN_error("Operand of bitstring template concatenation is an " - "unbound or omitted record/set field."); -} #endif // TITAN_RUNTIME_2 BITSTRING_ELEMENT BITSTRING_template::operator[](int index_value) diff --git a/core/Bitstring.hh b/core/Bitstring.hh index 2191baf7bf89f981a4c656a577b92669a9b674cd..fa779b07f9c3769f7e61b4c53163d945753683bc 100644 --- a/core/Bitstring.hh +++ b/core/Bitstring.hh @@ -112,9 +112,6 @@ public: BITSTRING operator+(const BITSTRING& other_value) const; BITSTRING operator+(const BITSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - BITSTRING operator+(const OPTIONAL<BITSTRING>& other_value) const; -#endif BITSTRING operator~() const; BITSTRING operator&(const BITSTRING& other_value) const; @@ -241,9 +238,6 @@ public: BITSTRING operator+(const BITSTRING& other_value) const; BITSTRING operator+(const BITSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - BITSTRING operator+(const OPTIONAL<BITSTRING>& other_value) const; -#endif BITSTRING operator~() const; BITSTRING operator&(const BITSTRING& other_value) const; @@ -278,22 +272,16 @@ private: const BITSTRING_template& right_template); friend BITSTRING_template operator+(const BITSTRING_ELEMENT& left_value, const BITSTRING_template& right_template); - friend BITSTRING_template operator+(const OPTIONAL<BITSTRING>& left_value, - const BITSTRING_template& right_template); friend BITSTRING_template operator+(template_sel left_template_sel, const BITSTRING_template& right_template); friend BITSTRING_template operator+(const BITSTRING& left_value, template_sel right_template_sel); friend BITSTRING_template operator+(const BITSTRING_ELEMENT& left_value, template_sel right_template_sel); - friend BITSTRING_template operator+(const OPTIONAL<BITSTRING>& left_value, - template_sel right_template_sel); friend BITSTRING_template operator+(template_sel left_template_sel, const BITSTRING& right_value); friend BITSTRING_template operator+(template_sel left_template_sel, const BITSTRING_ELEMENT& right_value); - friend BITSTRING_template operator+(template_sel left_template_sel, - const OPTIONAL<BITSTRING>& right_value); #endif BITSTRING single_value; @@ -338,7 +326,6 @@ public: BITSTRING_template operator+(const BITSTRING_template& other_value) const; BITSTRING_template operator+(const BITSTRING& other_value) const; BITSTRING_template operator+(const BITSTRING_ELEMENT& other_value) const; - BITSTRING_template operator+(const OPTIONAL<BITSTRING>& other_value) const; BITSTRING_template operator+(template_sel other_template_sel) const; #endif @@ -389,22 +376,16 @@ extern BITSTRING_template operator+(const BITSTRING& left_value, const BITSTRING_template& right_template); extern BITSTRING_template operator+(const BITSTRING_ELEMENT& left_value, const BITSTRING_template& right_template); -extern BITSTRING_template operator+(const OPTIONAL<BITSTRING>& left_value, - const BITSTRING_template& right_template); extern BITSTRING_template operator+(template_sel left_template_sel, const BITSTRING_template& right_template); extern BITSTRING_template operator+(const BITSTRING& left_value, template_sel right_template_sel); extern BITSTRING_template operator+(const BITSTRING_ELEMENT& left_value, template_sel right_template_sel); -extern BITSTRING_template operator+(const OPTIONAL<BITSTRING>& left_value, - template_sel right_template_sel); extern BITSTRING_template operator+(template_sel left_template_sel, const BITSTRING& right_value); extern BITSTRING_template operator+(template_sel left_template_sel, const BITSTRING_ELEMENT& right_value); -extern BITSTRING_template operator+(template_sel left_template_sel, - const OPTIONAL<BITSTRING>& right_value); #endif #endif diff --git a/core/Charstring.cc b/core/Charstring.cc index a97c7844c3bedcf450802544a436944c8bb10484..c66f885d03926f34e60848029c3e8b610644e2b4 100644 --- a/core/Charstring.cc +++ b/core/Charstring.cc @@ -324,16 +324,6 @@ CHARSTRING CHARSTRING::operator+(const CHARSTRING_ELEMENT& other_value) const return ret_val; } -#ifdef TITAN_RUNTIME_2 -CHARSTRING CHARSTRING::operator+(const OPTIONAL<CHARSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const CHARSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of charstring concatenation."); -} -#endif - UNIVERSAL_CHARSTRING CHARSTRING::operator+ (const UNIVERSAL_CHARSTRING& other_value) const { @@ -388,18 +378,6 @@ UNIVERSAL_CHARSTRING CHARSTRING::operator+ } } -#ifdef TITAN_RUNTIME_2 -UNIVERSAL_CHARSTRING CHARSTRING::operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const UNIVERSAL_CHARSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of universal charstring " - "concatenation."); -} -#endif - CHARSTRING& CHARSTRING::operator+=(char other_value) { must_bound("Appending a character to an unbound charstring value."); @@ -1998,17 +1976,6 @@ CHARSTRING CHARSTRING_ELEMENT::operator+(const CHARSTRING_ELEMENT& return CHARSTRING(2, result); } -#ifdef TITAN_RUNTIME_2 -CHARSTRING CHARSTRING_ELEMENT::operator+( - const OPTIONAL<CHARSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const CHARSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of charstring concatenation."); -} -#endif - UNIVERSAL_CHARSTRING CHARSTRING_ELEMENT::operator+ (const UNIVERSAL_CHARSTRING& other_value) const { @@ -2049,18 +2016,6 @@ UNIVERSAL_CHARSTRING CHARSTRING_ELEMENT::operator+ return UNIVERSAL_CHARSTRING(2, result); } -#ifdef TITAN_RUNTIME_2 -UNIVERSAL_CHARSTRING CHARSTRING_ELEMENT::operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const UNIVERSAL_CHARSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of universal charstring " - "concatenation."); -} -#endif - char CHARSTRING_ELEMENT::get_char() const { return str_val.val_ptr->chars_ptr[char_pos]; @@ -2126,62 +2081,6 @@ CHARSTRING operator+(const char* string_value, return ret_val; } -#ifdef TITAN_RUNTIME_2 -CHARSTRING operator+(const OPTIONAL<CHARSTRING>& left_value, - const CHARSTRING& right_value) -{ - if (left_value.is_present()) { - return (const CHARSTRING&)left_value + right_value; - } - TTCN_error("Unbound or omitted left operand of charstring " - "concatenation."); -} - -CHARSTRING operator+(const OPTIONAL<CHARSTRING>& left_value, - const CHARSTRING_ELEMENT& right_value) -{ - if (left_value.is_present()) { - return (const CHARSTRING&)left_value + right_value; - } - TTCN_error("Unbound or omitted left operand of charstring " - "concatenation."); -} - -UNIVERSAL_CHARSTRING operator+(const OPTIONAL<CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING& right_value) -{ - if (left_value.is_present()) { - return (const CHARSTRING&)left_value + right_value; - } - TTCN_error("Unbound or omitted left operand of universal charstring " - "concatenation."); -} - -UNIVERSAL_CHARSTRING operator+(const OPTIONAL<CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING_ELEMENT& right_value) -{ - if (left_value.is_present()) { - return (const CHARSTRING&)left_value + right_value; - } - TTCN_error("Unbound or omitted left operand of universal charstring " - "concatenation."); -} - -UNIVERSAL_CHARSTRING operator+(const OPTIONAL<CHARSTRING>& left_value, - const OPTIONAL<UNIVERSAL_CHARSTRING>& right_value) -{ - if (!left_value.is_present()) { - TTCN_error("Unbound or omitted left operand of universal charstring " - "concatenation."); - } - if (!right_value.is_present()) { - TTCN_error("Unbound or omitted right operand of universal charstring " - "concatenation."); - } - return (const CHARSTRING&)left_value + (const UNIVERSAL_CHARSTRING&)right_value; -} -#endif // TITAN_RUNTIME_2 - CHARSTRING operator<<=(const char *string_value, const INTEGER& rotate_count) { return CHARSTRING(string_value) <<= rotate_count; @@ -2411,20 +2310,6 @@ CHARSTRING_template CHARSTRING_template::operator+( "uninitialized or unsupported template."); } -CHARSTRING_template CHARSTRING_template::operator+( - const OPTIONAL<CHARSTRING>& other_value) const -{ - if (template_selection != SPECIFIC_VALUE) { - TTCN_error("Operand of charstring template concatenation is an " - "uninitialized or unsupported template."); - } - if (!other_value.is_present()) { - TTCN_error("Operand of charstring template concatenation is an " - "unbound or omitted record/set field."); - } - return single_value + (const CHARSTRING&)other_value; -} - UNIVERSAL_CHARSTRING_template CHARSTRING_template::operator+( const UNIVERSAL_CHARSTRING& other_value) const { @@ -2445,20 +2330,6 @@ UNIVERSAL_CHARSTRING_template CHARSTRING_template::operator+( return single_value + other_value; } -UNIVERSAL_CHARSTRING_template CHARSTRING_template::operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const -{ - if (template_selection != SPECIFIC_VALUE) { - TTCN_error("Operand of universal charstring template concatenation is an " - "uninitialized or unsupported template."); - } - if (!other_value.is_present()) { - TTCN_error("Operand of universal charstring template concatenation is an " - "unbound or omitted record/set field."); - } - return single_value + (const UNIVERSAL_CHARSTRING&)other_value; -} - CHARSTRING_template operator+(const CHARSTRING& left_value, const CHARSTRING_template& right_template) { @@ -2479,20 +2350,6 @@ CHARSTRING_template operator+(const CHARSTRING_ELEMENT& left_value, "uninitialized or unsupported template."); } -CHARSTRING_template operator+(const OPTIONAL<CHARSTRING>& left_value, - const CHARSTRING_template& right_template) -{ - if (!left_value.is_present()) { - TTCN_error("Operand of charstring template concatenation is an " - "unbound or omitted record/set field."); - } - if (right_template.template_selection != SPECIFIC_VALUE) { - TTCN_error("Operand of charstring template concatenation is an " - "uninitialized or unsupported template."); - } - return (const CHARSTRING&)left_value + right_template.single_value; -} - UNIVERSAL_CHARSTRING_template operator+(const UNIVERSAL_CHARSTRING& left_value, const CHARSTRING_template& right_template) { @@ -2513,21 +2370,6 @@ UNIVERSAL_CHARSTRING_template operator+( } return left_value + right_template.single_value; } - -UNIVERSAL_CHARSTRING_template operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const CHARSTRING_template& right_template) -{ - if (!left_value.is_present()) { - TTCN_error("Operand of universal charstring template concatenation is an " - "unbound or omitted record/set field."); - } - if (right_template.template_selection != SPECIFIC_VALUE) { - TTCN_error("Operand of universal charstring template concatenation is an " - "uninitialized or unsupported template."); - } - return (const UNIVERSAL_CHARSTRING&)left_value + right_template.single_value; -} #endif // TITAN_RUNTIME_2 CHARSTRING_ELEMENT CHARSTRING_template::operator[](int index_value) diff --git a/core/Charstring.hh b/core/Charstring.hh index 8134ed8a0d6e9e51e32231c94b207122e133e814..a5630972ca8db83571997538b9ec46adb393ff32 100644 --- a/core/Charstring.hh +++ b/core/Charstring.hh @@ -161,16 +161,9 @@ public: CHARSTRING operator+(const char* other_value) const; CHARSTRING operator+(const CHARSTRING& other_value) const; CHARSTRING operator+(const CHARSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - CHARSTRING operator+(const OPTIONAL<CHARSTRING>& other_value) const; -#endif UNIVERSAL_CHARSTRING operator+(const UNIVERSAL_CHARSTRING& other_value) const; UNIVERSAL_CHARSTRING operator+ (const UNIVERSAL_CHARSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - UNIVERSAL_CHARSTRING operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const; -#endif CHARSTRING& operator+=(char other_value); CHARSTRING& operator+=(const char *other_value); @@ -322,16 +315,9 @@ public: CHARSTRING operator+(const char *other_value) const; CHARSTRING operator+(const CHARSTRING& other_value) const; CHARSTRING operator+(const CHARSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - CHARSTRING operator+(const OPTIONAL<CHARSTRING>& other_value) const; -#endif UNIVERSAL_CHARSTRING operator+(const UNIVERSAL_CHARSTRING& other_value) const; UNIVERSAL_CHARSTRING operator+ (const UNIVERSAL_CHARSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - UNIVERSAL_CHARSTRING operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const; -#endif inline boolean is_bound() const { return bound_flag; } inline boolean is_present() const { return bound_flag; } @@ -365,18 +351,6 @@ extern CHARSTRING operator+(const char* string_value, const CHARSTRING& other_value); extern CHARSTRING operator+(const char* string_value, const CHARSTRING_ELEMENT& other_value); -#ifdef TITAN_RUNTIME_2 -extern CHARSTRING operator+(const OPTIONAL<CHARSTRING>& left_value, - const CHARSTRING& right_value); -extern CHARSTRING operator+(const OPTIONAL<CHARSTRING>& left_value, - const CHARSTRING_ELEMENT& right_value); -extern UNIVERSAL_CHARSTRING operator+(const OPTIONAL<CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING& right_value); -extern UNIVERSAL_CHARSTRING operator+(const OPTIONAL<CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING_ELEMENT& right_value); -extern UNIVERSAL_CHARSTRING operator+(const OPTIONAL<CHARSTRING>& left_value, - const OPTIONAL<UNIVERSAL_CHARSTRING>& right_value); -#endif extern CHARSTRING operator<<=(const char *string_value, const INTEGER& rotate_count); @@ -396,17 +370,12 @@ class CHARSTRING_template : public Restricted_Length_Template { const CHARSTRING_template& right_template); friend CHARSTRING_template operator+(const CHARSTRING_ELEMENT& left_value, const CHARSTRING_template& right_template); - friend CHARSTRING_template operator+(const OPTIONAL<CHARSTRING>& left_value, - const CHARSTRING_template& right_template); friend UNIVERSAL_CHARSTRING_template operator+( const UNIVERSAL_CHARSTRING& left_value, const CHARSTRING_template& right_template); friend UNIVERSAL_CHARSTRING_template operator+( const UNIVERSAL_CHARSTRING_ELEMENT& left_value, const CHARSTRING_template& right_template); - friend UNIVERSAL_CHARSTRING_template operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const CHARSTRING_template& right_template); friend UNIVERSAL_CHARSTRING_template operator+( const CHARSTRING_template& left_template, const UNIVERSAL_CHARSTRING_template& right_template); @@ -479,13 +448,10 @@ public: CHARSTRING_template operator+(const CHARSTRING_template& other_value) const; CHARSTRING_template operator+(const CHARSTRING& other_value) const; CHARSTRING_template operator+(const CHARSTRING_ELEMENT& other_value) const; - CHARSTRING_template operator+(const OPTIONAL<CHARSTRING>& other_value) const; UNIVERSAL_CHARSTRING_template operator+( const UNIVERSAL_CHARSTRING& other_value) const; UNIVERSAL_CHARSTRING_template operator+( const UNIVERSAL_CHARSTRING_ELEMENT& other_value) const; - UNIVERSAL_CHARSTRING_template operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const; #endif CHARSTRING_ELEMENT operator[](int index_value); @@ -544,17 +510,12 @@ extern CHARSTRING_template operator+(const CHARSTRING& left_value, const CHARSTRING_template& right_template); extern CHARSTRING_template operator+(const CHARSTRING_ELEMENT& left_value, const CHARSTRING_template& right_template); -extern CHARSTRING_template operator+(const OPTIONAL<CHARSTRING>& left_value, - const CHARSTRING_template& right_template); extern UNIVERSAL_CHARSTRING_template operator+( const UNIVERSAL_CHARSTRING& left_value, const CHARSTRING_template& right_template); extern UNIVERSAL_CHARSTRING_template operator+( const UNIVERSAL_CHARSTRING_ELEMENT& left_value, const CHARSTRING_template& right_template); -extern UNIVERSAL_CHARSTRING_template operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const CHARSTRING_template& right_template); #endif typedef CHARSTRING NumericString; diff --git a/core/Hexstring.cc b/core/Hexstring.cc index dcb7ed3966127eff3e0a6dab6ebf58be712a90f5..d73d4271cd1b3497e175352f12f16f3411cb77e2 100644 --- a/core/Hexstring.cc +++ b/core/Hexstring.cc @@ -263,16 +263,6 @@ HEXSTRING HEXSTRING::operator+(const HEXSTRING_ELEMENT& other_value) const return ret_val; } -#ifdef TITAN_RUNTIME_2 -HEXSTRING HEXSTRING::operator+(const OPTIONAL<HEXSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const HEXSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of hexstring concatenation."); -} -#endif - HEXSTRING HEXSTRING::operator~() const { must_bound("Unbound hexstring operand of operator not4b."); @@ -1236,17 +1226,6 @@ HEXSTRING HEXSTRING_ELEMENT::operator+(const HEXSTRING_ELEMENT& other_value) con return HEXSTRING(2, &result); } -#ifdef TITAN_RUNTIME_2 -HEXSTRING HEXSTRING_ELEMENT::operator+( - const OPTIONAL<HEXSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const HEXSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of hexstring concatenation."); -} -#endif - HEXSTRING HEXSTRING_ELEMENT::operator~() const { must_bound("Unbound hexstring element operand of operator not4b."); @@ -1721,16 +1700,6 @@ HEXSTRING_template HEXSTRING_template::operator+( return *this + HEXSTRING(other_value); } -HEXSTRING_template HEXSTRING_template::operator+( - const OPTIONAL<HEXSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const HEXSTRING&)other_value; - } - TTCN_error("Operand of hexstring template concatenation is an " - "unbound or omitted record/set field."); -} - HEXSTRING_template HEXSTRING_template::operator+( template_sel other_template_sel) const { @@ -1766,16 +1735,6 @@ HEXSTRING_template operator+(const HEXSTRING_ELEMENT& left_value, return HEXSTRING(left_value) + right_template; } -HEXSTRING_template operator+(const OPTIONAL<HEXSTRING>& left_value, - const HEXSTRING_template& right_template) -{ - if (left_value.is_present()) { - return (const HEXSTRING&)left_value + right_template; - } - TTCN_error("Operand of hexstring template concatenation is an " - "unbound or omitted record/set field."); -} - HEXSTRING_template operator+(template_sel left_template_sel, const HEXSTRING_template& right_template) { @@ -1809,16 +1768,6 @@ HEXSTRING_template operator+(const HEXSTRING_ELEMENT& left_value, return HEXSTRING(left_value) + right_template_sel; } -HEXSTRING_template operator+(const OPTIONAL<HEXSTRING>& left_value, - template_sel right_template_sel) -{ - if (left_value.is_present()) { - return (const HEXSTRING&)left_value + right_template_sel; - } - TTCN_error("Operand of hexstring template concatenation is an " - "unbound or omitted record/set field."); -} - HEXSTRING_template operator+(template_sel left_template_sel, const HEXSTRING& right_value) { @@ -1834,16 +1783,6 @@ HEXSTRING_template operator+(template_sel left_template_sel, { return left_template_sel + HEXSTRING(right_value); } - -HEXSTRING_template operator+(template_sel left_template_sel, - const OPTIONAL<HEXSTRING>& right_value) -{ - if (right_value.is_present()) { - return left_template_sel + (const HEXSTRING&)right_value; - } - TTCN_error("Operand of hexstring template concatenation is an " - "unbound or omitted record/set field."); -} #endif // TITAN_RUNTIME_2 HEXSTRING_ELEMENT HEXSTRING_template::operator[](int index_value) diff --git a/core/Hexstring.hh b/core/Hexstring.hh index 023a7c5caeddc4ae2aeb2e6766b9df4dcc3494a0..d9d8ac0cd1c2e153849fe2cd3d9afedad241ca88 100644 --- a/core/Hexstring.hh +++ b/core/Hexstring.hh @@ -85,9 +85,6 @@ public: HEXSTRING operator+(const HEXSTRING& other_value) const; HEXSTRING operator+(const HEXSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - HEXSTRING operator+(const OPTIONAL<HEXSTRING>& other_value) const; -#endif HEXSTRING operator~() const; HEXSTRING operator&(const HEXSTRING& other_value) const; @@ -186,9 +183,6 @@ public: HEXSTRING operator+(const HEXSTRING& other_value) const; HEXSTRING operator+(const HEXSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - HEXSTRING operator+(const OPTIONAL<HEXSTRING>& other_value) const; -#endif HEXSTRING operator~() const; HEXSTRING operator&(const HEXSTRING& other_value) const; @@ -224,22 +218,16 @@ private: const HEXSTRING_template& right_template); friend HEXSTRING_template operator+(const HEXSTRING_ELEMENT& left_value, const HEXSTRING_template& right_template); - friend HEXSTRING_template operator+(const OPTIONAL<HEXSTRING>& left_value, - const HEXSTRING_template& right_template); friend HEXSTRING_template operator+(template_sel left_template_sel, const HEXSTRING_template& right_template); friend HEXSTRING_template operator+(const HEXSTRING& left_value, template_sel right_template_sel); friend HEXSTRING_template operator+(const HEXSTRING_ELEMENT& left_value, template_sel right_template_sel); - friend HEXSTRING_template operator+(const OPTIONAL<HEXSTRING>& left_value, - template_sel right_template_sel); friend HEXSTRING_template operator+(template_sel left_template_sel, const HEXSTRING& right_value); friend HEXSTRING_template operator+(template_sel left_template_sel, const HEXSTRING_ELEMENT& right_value); - friend HEXSTRING_template operator+(template_sel left_template_sel, - const OPTIONAL<HEXSTRING>& right_value); #endif HEXSTRING single_value; @@ -284,7 +272,6 @@ public: HEXSTRING_template operator+(const HEXSTRING_template& other_value) const; HEXSTRING_template operator+(const HEXSTRING& other_value) const; HEXSTRING_template operator+(const HEXSTRING_ELEMENT& other_value) const; - HEXSTRING_template operator+(const OPTIONAL<HEXSTRING>& other_value) const; HEXSTRING_template operator+(template_sel other_template_sel) const; #endif @@ -335,22 +322,16 @@ extern HEXSTRING_template operator+(const HEXSTRING& left_value, const HEXSTRING_template& right_template); extern HEXSTRING_template operator+(const HEXSTRING_ELEMENT& left_value, const HEXSTRING_template& right_template); -extern HEXSTRING_template operator+(const OPTIONAL<HEXSTRING>& left_value, - const HEXSTRING_template& right_template); extern HEXSTRING_template operator+(template_sel left_template_sel, const HEXSTRING_template& right_template); extern HEXSTRING_template operator+(const HEXSTRING& left_value, template_sel right_template_sel); extern HEXSTRING_template operator+(const HEXSTRING_ELEMENT& left_value, template_sel right_template_sel); -extern HEXSTRING_template operator+(const OPTIONAL<HEXSTRING>& left_value, - template_sel right_template_sel); extern HEXSTRING_template operator+(template_sel left_template_sel, const HEXSTRING& right_value); extern HEXSTRING_template operator+(template_sel left_template_sel, const HEXSTRING_ELEMENT& right_value); -extern HEXSTRING_template operator+(template_sel left_template_sel, - const OPTIONAL<HEXSTRING>& right_value); #endif #endif diff --git a/core/Octetstring.cc b/core/Octetstring.cc index 23b206ceaf1c59f500bc4c844bfaa86b8d813ce7..b0d19840a9827832c0243085f35caa2f138041f1 100644 --- a/core/Octetstring.cc +++ b/core/Octetstring.cc @@ -186,16 +186,6 @@ OCTETSTRING OCTETSTRING::operator+(const OCTETSTRING_ELEMENT& other_value) const return ret_val; } -#ifdef TITAN_RUNTIME_2 -OCTETSTRING OCTETSTRING::operator+(const OPTIONAL<OCTETSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const OCTETSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of octetstring concatenation."); -} -#endif - OCTETSTRING& OCTETSTRING::operator+=(const OCTETSTRING& other_value) { must_bound("Appending an octetstring value to an unbound octetstring value."); @@ -1518,17 +1508,6 @@ OCTETSTRING OCTETSTRING_ELEMENT::operator+ return OCTETSTRING(2, result); } -#ifdef TITAN_RUNTIME_2 -OCTETSTRING OCTETSTRING_ELEMENT::operator+( - const OPTIONAL<OCTETSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const OCTETSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of octetstring concatenation."); -} -#endif - OCTETSTRING OCTETSTRING_ELEMENT::operator~() const { must_bound("Unbound octetstring element operand of operator not4b."); @@ -2016,16 +1995,6 @@ OCTETSTRING_template OCTETSTRING_template::operator+( return *this + OCTETSTRING(other_value); } -OCTETSTRING_template OCTETSTRING_template::operator+( - const OPTIONAL<OCTETSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const OCTETSTRING&)other_value; - } - TTCN_error("Operand of octetstring template concatenation is an " - "unbound or omitted record/set field."); -} - OCTETSTRING_template OCTETSTRING_template::operator+( template_sel other_template_sel) const { @@ -2061,16 +2030,6 @@ OCTETSTRING_template operator+(const OCTETSTRING_ELEMENT& left_value, return OCTETSTRING(left_value) + right_template; } -OCTETSTRING_template operator+(const OPTIONAL<OCTETSTRING>& left_value, - const OCTETSTRING_template& right_template) -{ - if (left_value.is_present()) { - return (const OCTETSTRING&)left_value + right_template; - } - TTCN_error("Operand of octetstring template concatenation is an " - "unbound or omitted record/set field."); -} - OCTETSTRING_template operator+(template_sel left_template_sel, const OCTETSTRING_template& right_template) { @@ -2104,16 +2063,6 @@ OCTETSTRING_template operator+(const OCTETSTRING_ELEMENT& left_value, return OCTETSTRING(left_value) + right_template_sel; } -OCTETSTRING_template operator+(const OPTIONAL<OCTETSTRING>& left_value, - template_sel right_template_sel) -{ - if (left_value.is_present()) { - return (const OCTETSTRING&)left_value + right_template_sel; - } - TTCN_error("Operand of octetstring template concatenation is an " - "unbound or omitted record/set field."); -} - OCTETSTRING_template operator+(template_sel left_template_sel, const OCTETSTRING& right_value) { @@ -2129,16 +2078,6 @@ OCTETSTRING_template operator+(template_sel left_template_sel, { return left_template_sel + OCTETSTRING(right_value); } - -OCTETSTRING_template operator+(template_sel left_template_sel, - const OPTIONAL<OCTETSTRING>& right_value) -{ - if (right_value.is_present()) { - return left_template_sel + (const OCTETSTRING&)right_value; - } - TTCN_error("Operand of octetstring template concatenation is an " - "unbound or omitted record/set field."); -} #endif // TITAN_RUNTIME_2 OCTETSTRING_ELEMENT OCTETSTRING_template::operator[](int index_value) diff --git a/core/Octetstring.hh b/core/Octetstring.hh index 0b889b899a72e2c6a802934e7de63436df995d19..86d6328147dfe39efa78d8e7e5186618cf8fc647 100644 --- a/core/Octetstring.hh +++ b/core/Octetstring.hh @@ -89,9 +89,6 @@ public: OCTETSTRING operator+(const OCTETSTRING& other_value) const; OCTETSTRING operator+(const OCTETSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - OCTETSTRING operator+(const OPTIONAL<OCTETSTRING>& other_value) const; -#endif OCTETSTRING& operator+=(const OCTETSTRING& other_value); OCTETSTRING& operator+=(const OCTETSTRING_ELEMENT& other_value); @@ -225,9 +222,6 @@ public: OCTETSTRING operator+(const OCTETSTRING& other_value) const; OCTETSTRING operator+(const OCTETSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - OCTETSTRING operator+(const OPTIONAL<OCTETSTRING>& other_value) const; -#endif OCTETSTRING operator~() const; OCTETSTRING operator&(const OCTETSTRING& other_value) const; @@ -264,22 +258,16 @@ private: const OCTETSTRING_template& right_template); friend OCTETSTRING_template operator+(const OCTETSTRING_ELEMENT& left_value, const OCTETSTRING_template& right_template); - friend OCTETSTRING_template operator+(const OPTIONAL<OCTETSTRING>& left_value, - const OCTETSTRING_template& right_template); friend OCTETSTRING_template operator+(template_sel left_template_sel, const OCTETSTRING_template& right_template); friend OCTETSTRING_template operator+(const OCTETSTRING& left_value, template_sel right_template_sel); friend OCTETSTRING_template operator+(const OCTETSTRING_ELEMENT& left_value, template_sel right_template_sel); - friend OCTETSTRING_template operator+(const OPTIONAL<OCTETSTRING>& left_value, - template_sel right_template_sel); friend OCTETSTRING_template operator+(template_sel left_template_sel, const OCTETSTRING& right_value); friend OCTETSTRING_template operator+(template_sel left_template_sel, const OCTETSTRING_ELEMENT& right_value); - friend OCTETSTRING_template operator+(template_sel left_template_sel, - const OPTIONAL<OCTETSTRING>& right_value); #endif OCTETSTRING single_value; @@ -324,7 +312,6 @@ public: OCTETSTRING_template operator+(const OCTETSTRING_template& other_value) const; OCTETSTRING_template operator+(const OCTETSTRING& other_value) const; OCTETSTRING_template operator+(const OCTETSTRING_ELEMENT& other_value) const; - OCTETSTRING_template operator+(const OPTIONAL<OCTETSTRING>& other_value) const; OCTETSTRING_template operator+(template_sel other_template_sel) const; #endif @@ -375,22 +362,16 @@ extern OCTETSTRING_template operator+(const OCTETSTRING& left_value, const OCTETSTRING_template& right_template); extern OCTETSTRING_template operator+(const OCTETSTRING_ELEMENT& left_value, const OCTETSTRING_template& right_template); -extern OCTETSTRING_template operator+(const OPTIONAL<OCTETSTRING>& left_value, - const OCTETSTRING_template& right_template); extern OCTETSTRING_template operator+(template_sel left_template_sel, const OCTETSTRING_template& right_template); extern OCTETSTRING_template operator+(const OCTETSTRING& left_value, template_sel right_template_sel); extern OCTETSTRING_template operator+(const OCTETSTRING_ELEMENT& left_value, template_sel right_template_sel); -extern OCTETSTRING_template operator+(const OPTIONAL<OCTETSTRING>& left_value, - template_sel right_template_sel); extern OCTETSTRING_template operator+(template_sel left_template_sel, const OCTETSTRING& right_value); extern OCTETSTRING_template operator+(template_sel left_template_sel, const OCTETSTRING_ELEMENT& right_value); -extern OCTETSTRING_template operator+(template_sel left_template_sel, - const OPTIONAL<OCTETSTRING>& right_value); #endif #endif diff --git a/core/Universal_charstring.cc b/core/Universal_charstring.cc index af01d980a2dc9435dd360772e7e6d2d5e391baa6..b80efdc390b06d3aeed345f34efc0194b01484a3 100644 --- a/core/Universal_charstring.cc +++ b/core/Universal_charstring.cc @@ -543,18 +543,6 @@ UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING::operator+ return ret_val; } -#ifdef TITAN_RUNTIME_2 -UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING::operator+( - const OPTIONAL<CHARSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const CHARSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of universal charstring " - "concatenation."); -} -#endif - UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING::operator+ (const UNIVERSAL_CHARSTRING& other_value) const { @@ -656,18 +644,6 @@ UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING::operator+ } } -#ifdef TITAN_RUNTIME_2 -UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING::operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const UNIVERSAL_CHARSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of universal charstring " - "concatenation."); -} -#endif - UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING::operator<<= (int rotate_count) const { @@ -3532,18 +3508,6 @@ UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING_ELEMENT::operator+ } } -#ifdef TITAN_RUNTIME_2 -UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING_ELEMENT::operator+( - const OPTIONAL<CHARSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const CHARSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of universal charstring " - "concatenation."); -} -#endif - UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING_ELEMENT::operator+ (const UNIVERSAL_CHARSTRING& other_value) const { @@ -3633,18 +3597,6 @@ UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING_ELEMENT::operator+ } } -#ifdef TITAN_RUNTIME_2 -UNIVERSAL_CHARSTRING UNIVERSAL_CHARSTRING_ELEMENT::operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const -{ - if (other_value.is_present()) { - return *this + (const UNIVERSAL_CHARSTRING&)other_value; - } - TTCN_error("Unbound or omitted right operand of universal charstring " - "concatenation."); -} -#endif - const universal_char& UNIVERSAL_CHARSTRING_ELEMENT::get_uchar() const { if (str_val.charstring) @@ -3761,62 +3713,6 @@ UNIVERSAL_CHARSTRING operator+(const universal_char& uchar_value, } } -#ifdef TITAN_RUNTIME_2 -UNIVERSAL_CHARSTRING operator+(const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING& right_value) -{ - if (left_value.is_present()) { - return (const UNIVERSAL_CHARSTRING&)left_value + right_value; - } - TTCN_error("Unbound or omitted left operand of universal charstring " - "concatenation."); -} - -UNIVERSAL_CHARSTRING operator+(const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING_ELEMENT& right_value) -{ - if (left_value.is_present()) { - return (const UNIVERSAL_CHARSTRING&)left_value + right_value; - } - TTCN_error("Unbound or omitted left operand of universal charstring " - "concatenation."); -} - -UNIVERSAL_CHARSTRING operator+(const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const CHARSTRING& right_value) -{ - if (left_value.is_present()) { - return (const UNIVERSAL_CHARSTRING&)left_value + right_value; - } - TTCN_error("Unbound or omitted left operand of universal charstring " - "concatenation."); -} - -UNIVERSAL_CHARSTRING operator+(const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const CHARSTRING_ELEMENT& right_value) -{ - if (left_value.is_present()) { - return (const UNIVERSAL_CHARSTRING&)left_value + right_value; - } - TTCN_error("Unbound or omitted left operand of universal charstring " - "concatenation."); -} - -UNIVERSAL_CHARSTRING operator+(const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const OPTIONAL<CHARSTRING>& right_value) -{ - if (!left_value.is_present()) { - TTCN_error("Unbound or omitted left operand of universal charstring " - "concatenation."); - } - if (!right_value.is_present()) { - TTCN_error("Unbound or omitted right operand of universal charstring " - "concatenation."); - } - return (const UNIVERSAL_CHARSTRING&)left_value + (const CHARSTRING&)right_value; -} -#endif // TITAN_RUNTIME_2 - boolean operator==(const char *string_value, const UNIVERSAL_CHARSTRING& other_value) { @@ -4276,20 +4172,6 @@ UNIVERSAL_CHARSTRING_template UNIVERSAL_CHARSTRING_template::operator+( "uninitialized or unsupported template."); } -UNIVERSAL_CHARSTRING_template UNIVERSAL_CHARSTRING_template::operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const -{ - if (template_selection != SPECIFIC_VALUE) { - TTCN_error("Operand of universal charstring template concatenation is an " - "uninitialized or unsupported template."); - } - if (!other_value.is_present()) { - TTCN_error("Operand of universal charstring template concatenation is an " - "unbound or omitted record/set field."); - } - return single_value + (const UNIVERSAL_CHARSTRING&)other_value; -} - UNIVERSAL_CHARSTRING_template UNIVERSAL_CHARSTRING_template::operator+( const CHARSTRING& other_value) const { @@ -4310,20 +4192,6 @@ UNIVERSAL_CHARSTRING_template UNIVERSAL_CHARSTRING_template::operator+( return single_value + other_value; } -UNIVERSAL_CHARSTRING_template UNIVERSAL_CHARSTRING_template::operator+( - const OPTIONAL<CHARSTRING>& other_value) const -{ - if (template_selection != SPECIFIC_VALUE) { - TTCN_error("Operand of universal charstring template concatenation is an " - "uninitialized or unsupported template."); - } - if (!other_value.is_present()) { - TTCN_error("Operand of universal charstring template concatenation is an " - "unbound or omitted record/set field."); - } - return single_value + (const CHARSTRING&)other_value; -} - UNIVERSAL_CHARSTRING_template UNIVERSAL_CHARSTRING_template::operator+( const CHARSTRING_template& other_value) const { @@ -4359,21 +4227,6 @@ UNIVERSAL_CHARSTRING_template operator+( "uninitialized or unsupported template."); } -UNIVERSAL_CHARSTRING_template operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING_template& right_template) -{ - if (!left_value.is_present()) { - TTCN_error("Operand of universal charstring template concatenation is an " - "unbound or omitted record/set field."); - } - if (right_template.template_selection != SPECIFIC_VALUE) { - TTCN_error("Operand of universal charstring template concatenation is an " - "uninitialized or unsupported template."); - } - return (const UNIVERSAL_CHARSTRING&)left_value + right_template.single_value; -} - UNIVERSAL_CHARSTRING_template operator+(const CHARSTRING& left_value, const UNIVERSAL_CHARSTRING_template& right_template) { @@ -4394,20 +4247,6 @@ UNIVERSAL_CHARSTRING_template operator+(const CHARSTRING_ELEMENT& left_value, return left_value + right_template.single_value; } -UNIVERSAL_CHARSTRING_template operator+(const OPTIONAL<CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING_template& right_template) -{ - if (!left_value.is_present()) { - TTCN_error("Operand of universal charstring template concatenation is an " - "unbound or omitted record/set field."); - } - if (right_template.template_selection != SPECIFIC_VALUE) { - TTCN_error("Operand of universal charstring template concatenation is an " - "uninitialized or unsupported template."); - } - return (const CHARSTRING&)left_value + right_template.single_value; -} - UNIVERSAL_CHARSTRING_template operator+(const CHARSTRING_template& left_template, const UNIVERSAL_CHARSTRING_template& right_template) { diff --git a/core/Universal_charstring.hh b/core/Universal_charstring.hh index edee52623129e5a6b05258bbe2dd1e0192514b28..39531ccb190673af2f7724712d42ab5efa3dd37c 100644 --- a/core/Universal_charstring.hh +++ b/core/Universal_charstring.hh @@ -228,16 +228,9 @@ public: UNIVERSAL_CHARSTRING operator+(const char* other_value) const; UNIVERSAL_CHARSTRING operator+(const CHARSTRING& other_value) const; UNIVERSAL_CHARSTRING operator+(const CHARSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - UNIVERSAL_CHARSTRING operator+(const OPTIONAL<CHARSTRING>& other_value) const; -#endif UNIVERSAL_CHARSTRING operator+(const UNIVERSAL_CHARSTRING& other_value) const; UNIVERSAL_CHARSTRING operator+(const UNIVERSAL_CHARSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - UNIVERSAL_CHARSTRING operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const; -#endif /** @} */ /** @name Rotation @@ -482,16 +475,9 @@ public: UNIVERSAL_CHARSTRING operator+(const char* other_value) const; UNIVERSAL_CHARSTRING operator+(const CHARSTRING& other_value) const; UNIVERSAL_CHARSTRING operator+(const CHARSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - UNIVERSAL_CHARSTRING operator+(const OPTIONAL<CHARSTRING>& other_value) const; -#endif UNIVERSAL_CHARSTRING operator+(const UNIVERSAL_CHARSTRING& other_value) const; UNIVERSAL_CHARSTRING operator+(const UNIVERSAL_CHARSTRING_ELEMENT& other_value) const; -#ifdef TITAN_RUNTIME_2 - UNIVERSAL_CHARSTRING operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const; -#endif inline boolean is_bound() const { return bound_flag; } inline boolean is_present() const { return bound_flag; } @@ -530,23 +516,6 @@ extern UNIVERSAL_CHARSTRING operator+(const universal_char& uchar_value, const UNIVERSAL_CHARSTRING& other_value); extern UNIVERSAL_CHARSTRING operator+(const universal_char& uchar_value, const UNIVERSAL_CHARSTRING_ELEMENT& other_value); -#ifdef TITAN_RUNTIME_2 -extern UNIVERSAL_CHARSTRING operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING& right_value); -extern UNIVERSAL_CHARSTRING operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING_ELEMENT& right_value); -extern UNIVERSAL_CHARSTRING operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const CHARSTRING& right_value); -extern UNIVERSAL_CHARSTRING operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const CHARSTRING_ELEMENT& right_value); -extern UNIVERSAL_CHARSTRING operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const OPTIONAL<CHARSTRING>& right_value); -#endif extern boolean operator==(const char *string_value, const UNIVERSAL_CHARSTRING& other_value); @@ -583,17 +552,11 @@ private: friend UNIVERSAL_CHARSTRING_template operator+( const UNIVERSAL_CHARSTRING_ELEMENT& left_value, const UNIVERSAL_CHARSTRING_template& right_template); - friend UNIVERSAL_CHARSTRING_template operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING_template& right_template); friend UNIVERSAL_CHARSTRING_template operator+(const CHARSTRING& left_value, const UNIVERSAL_CHARSTRING_template& right_template); friend UNIVERSAL_CHARSTRING_template operator+( const CHARSTRING_ELEMENT& left_value, const UNIVERSAL_CHARSTRING_template& right_template); - friend UNIVERSAL_CHARSTRING_template operator+( - const OPTIONAL<CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING_template& right_template); friend UNIVERSAL_CHARSTRING_template operator+( const CHARSTRING_template& left_template, const UNIVERSAL_CHARSTRING_template& right_template); @@ -667,13 +630,9 @@ public: const UNIVERSAL_CHARSTRING& other_value) const; UNIVERSAL_CHARSTRING_template operator+( const UNIVERSAL_CHARSTRING_ELEMENT& other_value) const; - UNIVERSAL_CHARSTRING_template operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& other_value) const; UNIVERSAL_CHARSTRING_template operator+(const CHARSTRING& other_value) const; UNIVERSAL_CHARSTRING_template operator+( const CHARSTRING_ELEMENT& other_value) const; - UNIVERSAL_CHARSTRING_template operator+( - const OPTIONAL<CHARSTRING>& other_value) const; UNIVERSAL_CHARSTRING_template operator+( const CHARSTRING_template& other_value) const; #endif @@ -737,15 +696,10 @@ extern UNIVERSAL_CHARSTRING_template operator+( extern UNIVERSAL_CHARSTRING_template operator+( const UNIVERSAL_CHARSTRING_ELEMENT& left_value, const UNIVERSAL_CHARSTRING_template& right_template); -extern UNIVERSAL_CHARSTRING_template operator+( - const OPTIONAL<UNIVERSAL_CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING_template& right_template); extern UNIVERSAL_CHARSTRING_template operator+(const CHARSTRING& left_value, const UNIVERSAL_CHARSTRING_template& right_template); extern UNIVERSAL_CHARSTRING_template operator+(const CHARSTRING_ELEMENT& left_value, const UNIVERSAL_CHARSTRING_template& right_template); -extern UNIVERSAL_CHARSTRING_template operator+(const OPTIONAL<CHARSTRING>& left_value, - const UNIVERSAL_CHARSTRING_template& right_template); extern UNIVERSAL_CHARSTRING_template operator+(const CHARSTRING_template& left_template, const UNIVERSAL_CHARSTRING_template& right_template); #endif