// This C++ source file was generated by the TTCN-3 compiler
// of the TTCN-3 Test Executor version 11.1.0
// The generation of user and time information were disabled by the -D flag.

// Copyright (c) 2000-2025 Ericsson Telecom AB

// Do not edit this file unless you know what you are doing.

/* Including header files */

#include "HTTPmsg_Types.hh"

namespace HTTPmsg__Types {

/* Literal string constants */

const unsigned char module_checksum[] = { 0xf5, 0xe8, 0x87, 0x98, 0xc5, 0xe5, 0xf3, 0x21, 0x25, 0x3f, 0xa8, 0x1c, 0x27, 0x5d, 0xa6, 0x18 };

/* Global variable definitions */

BOOLEAN modulepar_tsp__socket__debugging;
const BOOLEAN& tsp__socket__debugging = modulepar_tsp__socket__debugging;
// No XER for strict__crlf__mode
const TTCN_Typedescriptor_t strict__crlf__mode_descr_ = { "@HTTPmsg_Types.strict_crlf_mode", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
strict__crlf__mode modulepar_crlf__mode;
const strict__crlf__mode& crlf__mode = modulepar_crlf__mode;
BOOLEAN const_dec__HTTPMessage_socket__debugging_defval;
const BOOLEAN& dec__HTTPMessage_socket__debugging_defval = const_dec__HTTPMessage_socket__debugging_defval;
const XERdescriptor_t       HeaderLine_header__name_xer_ = { {"header_name>\n", "header_name>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HeaderLine_header__name_descr_ = { "@HTTPmsg_Types.HeaderLine.header_name", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HeaderLine_header__name_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HeaderLine_header__value_xer_ = { {"header_value>\n", "header_value>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HeaderLine_header__value_descr_ = { "@HTTPmsg_Types.HeaderLine.header_value", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HeaderLine_header__value_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for HeaderLine
const TTCN_Typedescriptor_t HeaderLine_descr_ = { "@HTTPmsg_Types.HeaderLine", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for HeaderLines
const TTCN_Typedescriptor_t HeaderLines_descr_ = { "@HTTPmsg_Types.HeaderLines", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &HeaderLine_descr_, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse_version__major_xer_ = { {"version_major>\n", "version_major>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse_version__major_descr_ = { "@HTTPmsg_Types.HTTPResponse.version_major", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPResponse_version__major_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse_version__minor_xer_ = { {"version_minor>\n", "version_minor>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse_version__minor_descr_ = { "@HTTPmsg_Types.HTTPResponse.version_minor", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPResponse_version__minor_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse_statuscode_xer_ = { {"statuscode>\n", "statuscode>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse_statuscode_descr_ = { "@HTTPmsg_Types.HTTPResponse.statuscode", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPResponse_statuscode_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse_statustext_xer_ = { {"statustext>\n", "statustext>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse_statustext_descr_ = { "@HTTPmsg_Types.HTTPResponse.statustext", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HTTPResponse_statustext_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse_body_xer_ = { {"body>\n", "body>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse_body_descr_ = { "@HTTPmsg_Types.HTTPResponse.body", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HTTPResponse_body_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for HTTPResponse
const TTCN_Typedescriptor_t HTTPResponse_descr_ = { "@HTTPmsg_Types.HTTPResponse", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse_client__id_descr_ = { "@HTTPmsg_Types.HTTPResponse.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPResponse_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest_method_xer_ = { {"method>\n", "method>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest_method_descr_ = { "@HTTPmsg_Types.HTTPRequest.method", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HTTPRequest_method_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest_uri_xer_ = { {"uri>\n", "uri>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest_uri_descr_ = { "@HTTPmsg_Types.HTTPRequest.uri", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HTTPRequest_uri_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest_version__major_xer_ = { {"version_major>\n", "version_major>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest_version__major_descr_ = { "@HTTPmsg_Types.HTTPRequest.version_major", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPRequest_version__major_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest_version__minor_xer_ = { {"version_minor>\n", "version_minor>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest_version__minor_descr_ = { "@HTTPmsg_Types.HTTPRequest.version_minor", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPRequest_version__minor_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest_body_xer_ = { {"body>\n", "body>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest_body_descr_ = { "@HTTPmsg_Types.HTTPRequest.body", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HTTPRequest_body_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for HTTPRequest
const TTCN_Typedescriptor_t HTTPRequest_descr_ = { "@HTTPmsg_Types.HTTPRequest", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest_client__id_descr_ = { "@HTTPmsg_Types.HTTPRequest.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPRequest_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse__binary__body_version__major_xer_ = { {"version_major>\n", "version_major>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse__binary__body_version__major_descr_ = { "@HTTPmsg_Types.HTTPResponse_binary_body.version_major", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPResponse__binary__body_version__major_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse__binary__body_version__minor_xer_ = { {"version_minor>\n", "version_minor>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse__binary__body_version__minor_descr_ = { "@HTTPmsg_Types.HTTPResponse_binary_body.version_minor", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPResponse__binary__body_version__minor_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse__binary__body_statuscode_xer_ = { {"statuscode>\n", "statuscode>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse__binary__body_statuscode_descr_ = { "@HTTPmsg_Types.HTTPResponse_binary_body.statuscode", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPResponse__binary__body_statuscode_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse__binary__body_statustext_xer_ = { {"statustext>\n", "statustext>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse__binary__body_statustext_descr_ = { "@HTTPmsg_Types.HTTPResponse_binary_body.statustext", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HTTPResponse__binary__body_statustext_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse__binary__body_body_xer_ = { {"body>\n", "body>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int HTTPResponse__binary__body_body_oer_ext_arr_[0] = {};
const int HTTPResponse__binary__body_body_oer_p_[0] = {};
const TTCN_OERdescriptor_t HTTPResponse__binary__body_body_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HTTPResponse__binary__body_body_oer_ext_arr_, 0, HTTPResponse__binary__body_body_oer_p_};
const TTCN_Typedescriptor_t HTTPResponse__binary__body_body_descr_ = { "@HTTPmsg_Types.HTTPResponse_binary_body.body", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &HTTPResponse__binary__body_body_xer_, &OCTETSTRING_json_, &HTTPResponse__binary__body_body_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for HTTPResponse__binary__body
const TTCN_Typedescriptor_t HTTPResponse__binary__body_descr_ = { "@HTTPmsg_Types.HTTPResponse_binary_body", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPResponse__binary__body_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPResponse__binary__body_client__id_descr_ = { "@HTTPmsg_Types.HTTPResponse_binary_body.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPResponse__binary__body_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest__binary__body_method_xer_ = { {"method>\n", "method>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest__binary__body_method_descr_ = { "@HTTPmsg_Types.HTTPRequest_binary_body.method", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HTTPRequest__binary__body_method_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest__binary__body_uri_xer_ = { {"uri>\n", "uri>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest__binary__body_uri_descr_ = { "@HTTPmsg_Types.HTTPRequest_binary_body.uri", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HTTPRequest__binary__body_uri_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest__binary__body_version__major_xer_ = { {"version_major>\n", "version_major>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest__binary__body_version__major_descr_ = { "@HTTPmsg_Types.HTTPRequest_binary_body.version_major", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPRequest__binary__body_version__major_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest__binary__body_version__minor_xer_ = { {"version_minor>\n", "version_minor>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest__binary__body_version__minor_descr_ = { "@HTTPmsg_Types.HTTPRequest_binary_body.version_minor", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPRequest__binary__body_version__minor_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest__binary__body_body_xer_ = { {"body>\n", "body>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int HTTPRequest__binary__body_body_oer_ext_arr_[0] = {};
const int HTTPRequest__binary__body_body_oer_p_[0] = {};
const TTCN_OERdescriptor_t HTTPRequest__binary__body_body_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HTTPRequest__binary__body_body_oer_ext_arr_, 0, HTTPRequest__binary__body_body_oer_p_};
const TTCN_Typedescriptor_t HTTPRequest__binary__body_body_descr_ = { "@HTTPmsg_Types.HTTPRequest_binary_body.body", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &HTTPRequest__binary__body_body_xer_, &OCTETSTRING_json_, &HTTPRequest__binary__body_body_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for HTTPRequest__binary__body
const TTCN_Typedescriptor_t HTTPRequest__binary__body_descr_ = { "@HTTPmsg_Types.HTTPRequest_binary_body", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTPRequest__binary__body_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTPRequest__binary__body_client__id_descr_ = { "@HTTPmsg_Types.HTTPRequest_binary_body.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTPRequest__binary__body_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTP__erronous__msg_msg_xer_ = { {"msg>\n", "msg>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTP__erronous__msg_msg_descr_ = { "@HTTPmsg_Types.HTTP_erronous_msg.msg", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HTTP__erronous__msg_msg_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for HTTP__erronous__msg
const TTCN_Typedescriptor_t HTTP__erronous__msg_descr_ = { "@HTTPmsg_Types.HTTP_erronous_msg", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTP__erronous__msg_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTP__erronous__msg_client__id_descr_ = { "@HTTPmsg_Types.HTTP_erronous_msg.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTP__erronous__msg_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for HTTPMessage
const TTCN_Typedescriptor_t HTTPMessage_descr_ = { "@HTTPmsg_Types.HTTPMessage", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Close
const TTCN_Typedescriptor_t Close_descr_ = { "@HTTPmsg_Types.Close", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Close_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Close_client__id_descr_ = { "@HTTPmsg_Types.Close.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Close_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Connect_hostname_xer_ = { {"hostname>\n", "hostname>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Connect_hostname_descr_ = { "@HTTPmsg_Types.Connect.hostname", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &Connect_hostname_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Connect_portnumber_xer_ = { {"portnumber>\n", "portnumber>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Connect_portnumber_descr_ = { "@HTTPmsg_Types.Connect.portnumber", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Connect_portnumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Connect_use__ssl_xer_ = { {"use_ssl>\n", "use_ssl>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Connect_use__ssl_oer_ext_arr_[0] = {};
const int Connect_use__ssl_oer_p_[0] = {};
const TTCN_OERdescriptor_t Connect_use__ssl_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Connect_use__ssl_oer_ext_arr_, 0, Connect_use__ssl_oer_p_};
const TTCN_Typedescriptor_t Connect_use__ssl_descr_ = { "@HTTPmsg_Types.Connect.use_ssl", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &Connect_use__ssl_xer_, &BOOLEAN_json_, &Connect_use__ssl_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Connect
const TTCN_Typedescriptor_t Connect_descr_ = { "@HTTPmsg_Types.Connect", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Connect__result_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Connect__result_client__id_descr_ = { "@HTTPmsg_Types.Connect_result.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Connect__result_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Connect__result
const TTCN_Typedescriptor_t Connect__result_descr_ = { "@HTTPmsg_Types.Connect_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Client__connected_hostname_xer_ = { {"hostname>\n", "hostname>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Client__connected_hostname_descr_ = { "@HTTPmsg_Types.Client_connected.hostname", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &Client__connected_hostname_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Client__connected_portnumber_xer_ = { {"portnumber>\n", "portnumber>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Client__connected_portnumber_descr_ = { "@HTTPmsg_Types.Client_connected.portnumber", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Client__connected_portnumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Client__connected_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Client__connected_client__id_descr_ = { "@HTTPmsg_Types.Client_connected.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Client__connected_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Client__connected
const TTCN_Typedescriptor_t Client__connected_descr_ = { "@HTTPmsg_Types.Client_connected", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Half__close
const TTCN_Typedescriptor_t Half__close_descr_ = { "@HTTPmsg_Types.Half_close", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Half__close_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Half__close_client__id_descr_ = { "@HTTPmsg_Types.Half_close.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Half__close_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Listen_portnumber_xer_ = { {"portnumber>\n", "portnumber>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Listen_portnumber_descr_ = { "@HTTPmsg_Types.Listen.portnumber", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Listen_portnumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Listen_use__ssl_xer_ = { {"use_ssl>\n", "use_ssl>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Listen_use__ssl_oer_ext_arr_[0] = {};
const int Listen_use__ssl_oer_p_[0] = {};
const TTCN_OERdescriptor_t Listen_use__ssl_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Listen_use__ssl_oer_ext_arr_, 0, Listen_use__ssl_oer_p_};
const TTCN_Typedescriptor_t Listen_use__ssl_descr_ = { "@HTTPmsg_Types.Listen.use_ssl", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &Listen_use__ssl_xer_, &BOOLEAN_json_, &Listen_use__ssl_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Listen
const TTCN_Typedescriptor_t Listen_descr_ = { "@HTTPmsg_Types.Listen", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Listen_local__hostname_xer_ = { {"local_hostname>\n", "local_hostname>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Listen_local__hostname_descr_ = { "@HTTPmsg_Types.Listen.local_hostname", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &Listen_local__hostname_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Listen__result_portnumber_xer_ = { {"portnumber>\n", "portnumber>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Listen__result_portnumber_descr_ = { "@HTTPmsg_Types.Listen_result.portnumber", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Listen__result_portnumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Listen__result
const TTCN_Typedescriptor_t Listen__result_descr_ = { "@HTTPmsg_Types.Listen_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Shutdown
const TTCN_Typedescriptor_t Shutdown_descr_ = { "@HTTPmsg_Types.Shutdown", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Send__failed_already__half__closed_xer_ = { {"already_half_closed>\n", "already_half_closed>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Send__failed_already__half__closed_oer_ext_arr_[0] = {};
const int Send__failed_already__half__closed_oer_p_[0] = {};
const TTCN_OERdescriptor_t Send__failed_already__half__closed_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Send__failed_already__half__closed_oer_ext_arr_, 0, Send__failed_already__half__closed_oer_p_};
const TTCN_Typedescriptor_t Send__failed_already__half__closed_descr_ = { "@HTTPmsg_Types.Send_failed.already_half_closed", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &Send__failed_already__half__closed_xer_, &BOOLEAN_json_, &Send__failed_already__half__closed_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Send__failed
const TTCN_Typedescriptor_t Send__failed_descr_ = { "@HTTPmsg_Types.Send_failed", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
TTCN_Module module_object("HTTPmsg_Types", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, set_module_param, NULL, log_module_param, NULL, NULL, NULL, NULL);

const RuntimeVersionChecker ver_checker(  current_runtime_version.requires_major_version_11,
  current_runtime_version.requires_minor_version_1,
  current_runtime_version.requires_patch_level_0,  current_runtime_version.requires_runtime_1);

/* Member functions of C++ classes */

strict__crlf__mode::strict__crlf__mode()
{
enum_value = UNBOUND_VALUE;
}

strict__crlf__mode::strict__crlf__mode(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @HTTPmsg_Types.strict_crlf_mode with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

strict__crlf__mode::strict__crlf__mode(enum_type other_value)
{
enum_value = other_value;
}

strict__crlf__mode::strict__crlf__mode(const strict__crlf__mode& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
enum_value = other_value.enum_value;
}

strict__crlf__mode& strict__crlf__mode::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @HTTPmsg_Types.strict_crlf_mode.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

strict__crlf__mode& strict__crlf__mode::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

strict__crlf__mode& strict__crlf__mode::operator=(const strict__crlf__mode& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
enum_value = other_value.enum_value;
return *this;
}

boolean strict__crlf__mode::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HTTPmsg_Types.strict_crlf_mode comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean strict__crlf__mode::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
return enum_value == other_value;
}

boolean strict__crlf__mode::operator==(const strict__crlf__mode& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
return enum_value == other_value.enum_value;
}

boolean strict__crlf__mode::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HTTPmsg_Types.strict_crlf_mode comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean strict__crlf__mode::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
return enum_value < other_value;
}

boolean strict__crlf__mode::operator<(const strict__crlf__mode& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
return enum_value < other_value.enum_value;
}

boolean strict__crlf__mode::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HTTPmsg_Types.strict_crlf_mode comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean strict__crlf__mode::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
return enum_value > other_value;
}

boolean strict__crlf__mode::operator>(const strict__crlf__mode& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
return enum_value > other_value.enum_value;
}

const char *strict__crlf__mode::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case ERROR_: return "ERROR";
case WARNING: return "WARNING";
case WARNING__ONCE: return "WARNING_ONCE";
case ACCEPT: return "ACCEPT";
default:
return "<unknown>";
}
}

strict__crlf__mode::enum_type strict__crlf__mode::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "ERROR")) return ERROR_;
if (!strcmp(str_par, "WARNING")) return WARNING;
if (!strcmp(str_par, "WARNING_ONCE")) return WARNING__ONCE;
if (!strcmp(str_par, "ACCEPT")) return ACCEPT;
}
return UNKNOWN_VALUE;
}

boolean strict__crlf__mode::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
return TRUE;
default:
return FALSE;
}
}

int strict__crlf__mode::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @HTTPmsg_Types.strict_crlf_mode.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int strict__crlf__mode::enum2int(const strict__crlf__mode& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @HTTPmsg_Types.strict_crlf_mode.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void strict__crlf__mode::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @HTTPmsg_Types.strict_crlf_mode.", int_val);
enum_value = (enum_type)int_val;
}

strict__crlf__mode::operator strict__crlf__mode::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
return enum_value;
}

void strict__crlf__mode::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void strict__crlf__mode::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@HTTPmsg_Types.strict_crlf_mode");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @HTTPmsg_Types.strict_crlf_mode.");
  }
}

void strict__crlf__mode::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
text_buf.push_int(enum_value);
}

void strict__crlf__mode::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @HTTPmsg_Types.strict_crlf_mode.", enum_value);
}

void strict__crlf__mode_template::copy_template(const strict__crlf__mode_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new strict__crlf__mode_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new strict__crlf__mode_template(*other_value.implication_.precondition);
implication_.implied_template = new strict__crlf__mode_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
}
}

strict__crlf__mode_template::strict__crlf__mode_template()
{
}

strict__crlf__mode_template::strict__crlf__mode_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

strict__crlf__mode_template::strict__crlf__mode_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!strict__crlf__mode::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @HTTPmsg_Types.strict_crlf_mode with unknown numeric value %d.", other_value);
single_value = (strict__crlf__mode::enum_type)other_value;
}

strict__crlf__mode_template::strict__crlf__mode_template(strict__crlf__mode::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

strict__crlf__mode_template::strict__crlf__mode_template(const strict__crlf__mode& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == strict__crlf__mode::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
single_value = other_value.enum_value;
}

strict__crlf__mode_template::strict__crlf__mode_template(const OPTIONAL<strict__crlf__mode>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (strict__crlf__mode::enum_type)(const strict__crlf__mode&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @HTTPmsg_Types.strict_crlf_mode from an unbound optional field.");
}
}

strict__crlf__mode_template::strict__crlf__mode_template(strict__crlf__mode_template* p_precondition, strict__crlf__mode_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

strict__crlf__mode_template::strict__crlf__mode_template(Dynamic_Match_Interface<strict__crlf__mode>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<strict__crlf__mode>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

strict__crlf__mode_template::strict__crlf__mode_template(const strict__crlf__mode_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

strict__crlf__mode_template::~strict__crlf__mode_template()
{
clean_up();
}

boolean strict__crlf__mode_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean strict__crlf__mode_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != strict__crlf__mode::UNBOUND_VALUE;
}

void strict__crlf__mode_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

strict__crlf__mode_template& strict__crlf__mode_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

strict__crlf__mode_template& strict__crlf__mode_template::operator=(int other_value)
{
if (!strict__crlf__mode::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @HTTPmsg_Types.strict_crlf_mode.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (strict__crlf__mode::enum_type)other_value;
return *this;
}

strict__crlf__mode_template& strict__crlf__mode_template::operator=(strict__crlf__mode::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

strict__crlf__mode_template& strict__crlf__mode_template::operator=(const strict__crlf__mode& other_value)
{
if (other_value.enum_value == strict__crlf__mode::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HTTPmsg_Types.strict_crlf_mode to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

strict__crlf__mode_template& strict__crlf__mode_template::operator=(const OPTIONAL<strict__crlf__mode>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (strict__crlf__mode::enum_type)(const strict__crlf__mode&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
}
return *this;
}

strict__crlf__mode_template& strict__crlf__mode_template::operator=(const strict__crlf__mode_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean strict__crlf__mode_template::match(strict__crlf__mode::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
}
return FALSE;
}

boolean strict__crlf__mode_template::match(const strict__crlf__mode& other_value, boolean) const
{
if (other_value.enum_value == strict__crlf__mode::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @HTTPmsg_Types.strict_crlf_mode with an unbound value.");
return match(other_value.enum_value);
}

strict__crlf__mode::enum_type strict__crlf__mode_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
return single_value;
}

void strict__crlf__mode_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new strict__crlf__mode_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
}
}

strict__crlf__mode_template& strict__crlf__mode_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
return value_list.list_value[list_index];
}

void strict__crlf__mode_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(strict__crlf__mode::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void strict__crlf__mode_template::log_match(const strict__crlf__mode& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void strict__crlf__mode_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
}
}

void strict__crlf__mode_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (strict__crlf__mode::enum_type)text_buf.pull_int().get_val();
if (!strict__crlf__mode::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @HTTPmsg_Types.strict_crlf_mode.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new strict__crlf__mode_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @HTTPmsg_Types.strict_crlf_mode.");
}
}

boolean strict__crlf__mode_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean strict__crlf__mode_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void strict__crlf__mode_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    strict__crlf__mode_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    strict__crlf__mode::enum_type enum_val = strict__crlf__mode::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!strict__crlf__mode::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @HTTPmsg_Types.strict_crlf_mode.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    strict__crlf__mode_template* precondition = new strict__crlf__mode_template;
    precondition->set_param(*m_p->get_elem(0));
    strict__crlf__mode_template* implied_template = new strict__crlf__mode_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = strict__crlf__mode_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@HTTPmsg_Types.strict_crlf_mode");
  }
  is_ifpresent = param.get_ifpresent();
}

void strict__crlf__mode_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.strict_crlf_mode");
}

HeaderLine::HeaderLine()
{
}

HeaderLine::HeaderLine(const CHARSTRING& par_header__name,
    const CHARSTRING& par_header__value)
  :   field_header__name(par_header__name),
  field_header__value(par_header__value)
{
}

HeaderLine::HeaderLine(const HeaderLine& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.HeaderLine.");
if (other_value.header__name().is_bound()) field_header__name = other_value.header__name();
else field_header__name.clean_up();
if (other_value.header__value().is_bound()) field_header__value = other_value.header__value();
else field_header__value.clean_up();
}

void HeaderLine::clean_up()
{
field_header__name.clean_up();
field_header__value.clean_up();
}

const TTCN_Typedescriptor_t* HeaderLine::get_descriptor() const { return &HeaderLine_descr_; }
HeaderLine& HeaderLine::operator=(const HeaderLine& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.HeaderLine.");
  if (other_value.header__name().is_bound()) field_header__name = other_value.header__name();
  else field_header__name.clean_up();
  if (other_value.header__value().is_bound()) field_header__value = other_value.header__value();
  else field_header__value.clean_up();
}
return *this;
}

boolean HeaderLine::operator==(const HeaderLine& other_value) const
{
return field_header__name==other_value.field_header__name
  && field_header__value==other_value.field_header__value;
}

boolean HeaderLine::is_bound() const
{
return (field_header__name.is_bound())
  || (field_header__value.is_bound());
}
boolean HeaderLine::is_value() const
{
return field_header__name.is_value()
  && field_header__value.is_value();
}
void HeaderLine::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ header_name := ");
field_header__name.log();
TTCN_Logger::log_event_str(", header_value := ");
field_header__value.log();
TTCN_Logger::log_event_str(" }");
}

void HeaderLine::set_implicit_omit()
{
if (header__name().is_bound()) header__name().set_implicit_omit();
if (header__value().is_bound()) header__value().set_implicit_omit();
}

void HeaderLine::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.HeaderLine has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) header__name().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) header__value().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header_name")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header__name().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header_value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header__value().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HeaderLine: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.HeaderLine");
  }
}

void HeaderLine::encode_text(Text_Buf& text_buf) const
{
field_header__name.encode_text(text_buf);
field_header__value.encode_text(text_buf);
}

void HeaderLine::decode_text(Text_Buf& text_buf)
{
field_header__name.decode_text(text_buf);
field_header__value.decode_text(text_buf);
}

struct HeaderLine_template::single_value_struct {
CHARSTRING_template field_header__name;
CHARSTRING_template field_header__value;
};

void HeaderLine_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_header__name = ANY_VALUE;
single_value->field_header__value = ANY_VALUE;
}
}
}

void HeaderLine_template::copy_value(const HeaderLine& other_value)
{
single_value = new single_value_struct;
if (other_value.header__name().is_bound()) {
  single_value->field_header__name = other_value.header__name();
} else {
  single_value->field_header__name.clean_up();
}
if (other_value.header__value().is_bound()) {
  single_value->field_header__value = other_value.header__value();
} else {
  single_value->field_header__value.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void HeaderLine_template::copy_template(const HeaderLine_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.header__name().get_selection()) {
single_value->field_header__name = other_value.header__name();
} else {
single_value->field_header__name.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.header__value().get_selection()) {
single_value->field_header__value = other_value.header__value();
} else {
single_value->field_header__value.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new HeaderLine_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new HeaderLine_template(*other_value.implication_.precondition);
implication_.implied_template = new HeaderLine_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.HeaderLine.");
break;
}
set_selection(other_value);
}

HeaderLine_template::HeaderLine_template()
{
}

HeaderLine_template::HeaderLine_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

HeaderLine_template::HeaderLine_template(const HeaderLine& other_value)
{
copy_value(other_value);
}

HeaderLine_template::HeaderLine_template(const OPTIONAL<HeaderLine>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HeaderLine&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.HeaderLine from an unbound optional field.");
}
}

HeaderLine_template::HeaderLine_template(HeaderLine_template* p_precondition, HeaderLine_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

HeaderLine_template::HeaderLine_template(Dynamic_Match_Interface<HeaderLine>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<HeaderLine>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

HeaderLine_template::HeaderLine_template(const HeaderLine_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

HeaderLine_template::~HeaderLine_template()
{
clean_up();
}

HeaderLine_template& HeaderLine_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

HeaderLine_template& HeaderLine_template::operator=(const HeaderLine& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

HeaderLine_template& HeaderLine_template::operator=(const OPTIONAL<HeaderLine>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HeaderLine&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.HeaderLine.");
}
return *this;
}

HeaderLine_template& HeaderLine_template::operator=(const HeaderLine_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean HeaderLine_template::match(const HeaderLine& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.header__name().is_bound()) return FALSE;
if(!single_value->field_header__name.match(other_value.header__name(), legacy))return FALSE;
if(!other_value.header__value().is_bound()) return FALSE;
if(!single_value->field_header__value.match(other_value.header__value(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.HeaderLine.");
}
return FALSE;
}

boolean HeaderLine_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_header__name.is_bound()
 || single_value->field_header__value.is_bound();
}

boolean HeaderLine_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_header__name.is_value()
 && single_value->field_header__value.is_value();
}

void HeaderLine_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

HeaderLine HeaderLine_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.HeaderLine.");
HeaderLine ret_val;
if (single_value->field_header__name.is_bound()) {
ret_val.header__name() = single_value->field_header__name.valueof();
}
if (single_value->field_header__value.is_bound()) {
ret_val.header__value() = single_value->field_header__value.valueof();
}
return ret_val;
}

void HeaderLine_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.HeaderLine.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new HeaderLine_template[list_length];
}

HeaderLine_template& HeaderLine_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.HeaderLine.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.HeaderLine.");
return value_list.list_value[list_index];
}

CHARSTRING_template& HeaderLine_template::header__name()
{
set_specific();
return single_value->field_header__name;
}

const CHARSTRING_template& HeaderLine_template::header__name() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field header_name of a non-specific template of type @HTTPmsg_Types.HeaderLine.");
return single_value->field_header__name;
}

CHARSTRING_template& HeaderLine_template::header__value()
{
set_specific();
return single_value->field_header__value;
}

const CHARSTRING_template& HeaderLine_template::header__value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field header_value of a non-specific template of type @HTTPmsg_Types.HeaderLine.");
return single_value->field_header__value;
}

int HeaderLine_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HeaderLine which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.HeaderLine containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HeaderLine containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HeaderLine containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HeaderLine containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HeaderLine containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HeaderLine containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HeaderLine containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HeaderLine containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.HeaderLine.");
  }
  return 0;
}

void HeaderLine_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ header_name := ");
single_value->field_header__name.log();
TTCN_Logger::log_event_str(", header_value := ");
single_value->field_header__value.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void HeaderLine_template::log_match(const HeaderLine& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_header__name.match(match_value.header__name(), legacy)){
TTCN_Logger::log_logmatch_info(".header_name");
single_value->field_header__name.log_match(match_value.header__name(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_header__value.match(match_value.header__value(), legacy)){
TTCN_Logger::log_logmatch_info(".header_value");
single_value->field_header__value.log_match(match_value.header__value(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ header_name := ");
single_value->field_header__name.log_match(match_value.header__name(), legacy);
TTCN_Logger::log_event_str(", header_value := ");
single_value->field_header__value.log_match(match_value.header__value(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void HeaderLine_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (header__name().is_bound()) header__name().set_implicit_omit();
if (header__value().is_bound()) header__value().set_implicit_omit();
}

void HeaderLine_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_header__name.encode_text(text_buf);
single_value->field_header__value.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.HeaderLine.");
}
}

void HeaderLine_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_header__name.decode_text(text_buf);
single_value->field_header__value.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new HeaderLine_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.HeaderLine.");
}
}

void HeaderLine_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    HeaderLine_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.HeaderLine has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) header__name().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) header__value().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header_name")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header__name().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header_value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header__value().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HeaderLine: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    HeaderLine_template* precondition = new HeaderLine_template;
    precondition->set_param(*param.get_elem(0));
    HeaderLine_template* implied_template = new HeaderLine_template;
    implied_template->set_param(*param.get_elem(1));
    *this = HeaderLine_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.HeaderLine");
  }
  is_ifpresent = param.get_ifpresent();
}

void HeaderLine_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_header__name.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HeaderLine");
single_value->field_header__value.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HeaderLine");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.HeaderLine");
}

boolean HeaderLine_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean HeaderLine_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


const HeaderLine HeaderLines::UNBOUND_ELEM;
HeaderLines::HeaderLines()
{
val_ptr = NULL;
}

HeaderLines::HeaderLines(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

HeaderLines::HeaderLines(const HeaderLines& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.HeaderLines.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

HeaderLines::~HeaderLines()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void HeaderLines::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

HeaderLines& HeaderLines::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

HeaderLines& HeaderLines::operator=(const HeaderLines& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HTTPmsg_Types.HeaderLines.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean HeaderLines::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @HTTPmsg_Types.HeaderLines.");
return val_ptr->n_elements == 0 ;
}

boolean HeaderLines::operator==(const HeaderLines& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HTTPmsg_Types.HeaderLines.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HTTPmsg_Types.HeaderLines.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

HeaderLine& HeaderLines::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @HTTPmsg_Types.HeaderLines using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (HeaderLine**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new HeaderLine(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new HeaderLine;
}
return *val_ptr->value_elements[index_value];
}

HeaderLine& HeaderLines::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @HTTPmsg_Types.HeaderLines.");
return (*this)[(int)index_value];
}

const HeaderLine& HeaderLines::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @HTTPmsg_Types.HeaderLines.");
if (index_value < 0) TTCN_error("Accessing an element of type @HTTPmsg_Types.HeaderLines using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HTTPmsg_Types.HeaderLines: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const HeaderLine& HeaderLines::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @HTTPmsg_Types.HeaderLines.");
return (*this)[(int)index_value];
}

HeaderLines HeaderLines::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

HeaderLines HeaderLines::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

HeaderLines HeaderLines::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

HeaderLines HeaderLines::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HTTPmsg_Types.HeaderLines.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
HeaderLines ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new HeaderLine(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

HeaderLines HeaderLines::operator+(const HeaderLines& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HTTPmsg_Types.HeaderLines concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
HeaderLines ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new HeaderLine(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new HeaderLine(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

HeaderLines HeaderLines::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HTTPmsg_Types.HeaderLines.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@HTTPmsg_Types.HeaderLines","element");
HeaderLines ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new HeaderLine(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

HeaderLines HeaderLines::replace(int index, int len, const HeaderLines& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HTTPmsg_Types.HeaderLines.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HTTPmsg_Types.HeaderLines.");
check_replace_arguments(val_ptr->n_elements, index, len, "@HTTPmsg_Types.HeaderLines","element");
HeaderLines ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new HeaderLine(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new HeaderLine(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new HeaderLine(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

HeaderLines HeaderLines::replace(int index, int len, const HeaderLines_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void HeaderLines::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HTTPmsg_Types.HeaderLines.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (HeaderLine**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new HeaderLine(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (HeaderLine**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @HTTPmsg_Types.HeaderLines: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (HeaderLine**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean HeaderLines::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int HeaderLines::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HTTPmsg_Types.HeaderLines.");
return val_ptr->n_elements;
}

int HeaderLines::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HTTPmsg_Types.HeaderLines.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void HeaderLines::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void HeaderLines::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void HeaderLines::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@HTTPmsg_Types.HeaderLines");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@HTTPmsg_Types.HeaderLines");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void HeaderLines::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HTTPmsg_Types.HeaderLines.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void HeaderLines::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @HTTPmsg_Types.HeaderLines.");
val_ptr->value_elements = (HeaderLine**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new HeaderLine;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void HeaderLines_template::copy_value(const HeaderLines& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HTTPmsg_Types.HeaderLines with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (HeaderLine_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new HeaderLine_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new HeaderLine_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void HeaderLines_template::copy_template(const HeaderLines_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (HeaderLine_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new HeaderLine_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new HeaderLine_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new HeaderLines_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new HeaderLines_template(*other_value.implication_.precondition);
implication_.implied_template = new HeaderLines_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.HeaderLines.");
break;
}
set_selection(other_value);
}

boolean HeaderLines_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const HeaderLines_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const HeaderLines*)value_ptr)[value_index], legacy);
else return ((const HeaderLines_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

HeaderLines_template::HeaderLines_template()
{
}

HeaderLines_template::HeaderLines_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

HeaderLines_template::HeaderLines_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

HeaderLines_template::HeaderLines_template(const HeaderLines& other_value)
{
copy_value(other_value);
}

HeaderLines_template::HeaderLines_template(const OPTIONAL<HeaderLines>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HeaderLines&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.HeaderLines from an unbound optional field.");
}
}

HeaderLines_template::HeaderLines_template(HeaderLines_template* p_precondition, HeaderLines_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

HeaderLines_template::HeaderLines_template(Dynamic_Match_Interface<HeaderLines>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<HeaderLines>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

HeaderLines_template::HeaderLines_template(const HeaderLines_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

HeaderLines_template::~HeaderLines_template()
{
clean_up();
}

void HeaderLines_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

HeaderLines_template& HeaderLines_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

HeaderLines_template& HeaderLines_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

HeaderLines_template& HeaderLines_template::operator=(const HeaderLines& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

HeaderLines_template& HeaderLines_template::operator=(const OPTIONAL<HeaderLines>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HeaderLines&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.HeaderLines.");
}
return *this;
}

HeaderLines_template& HeaderLines_template::operator=(const HeaderLines_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

HeaderLine_template& HeaderLines_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @HTTPmsg_Types.HeaderLines using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @HTTPmsg_Types.HeaderLines.");
    break;
}
return *single_value.value_elements[index_value];
}

HeaderLine_template& HeaderLines_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @HTTPmsg_Types.HeaderLines.");
return (*this)[(int)index_value];
}

const HeaderLine_template& HeaderLines_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @HTTPmsg_Types.HeaderLines using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HTTPmsg_Types.HeaderLines.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HTTPmsg_Types.HeaderLines: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const HeaderLine_template& HeaderLines_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @HTTPmsg_Types.HeaderLines.");
return (*this)[(int)index_value];
}

void HeaderLines_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HTTPmsg_Types.HeaderLines.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (HeaderLine_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new HeaderLine_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new HeaderLine_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (HeaderLine_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int HeaderLines_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int HeaderLines_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @HTTPmsg_Types.HeaderLines which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @HTTPmsg_Types.HeaderLines containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @HTTPmsg_Types.HeaderLines containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @HTTPmsg_Types.HeaderLines containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @HTTPmsg_Types.HeaderLines containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @HTTPmsg_Types.HeaderLines containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.HeaderLines.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HTTPmsg_Types.HeaderLines");
}

boolean HeaderLines_template::match(const HeaderLines& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @HTTPmsg_Types.HeaderLines.");
}
return FALSE;
}

boolean HeaderLines_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

HeaderLines HeaderLines_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.HeaderLines.");
HeaderLines ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

HeaderLines HeaderLines_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

HeaderLines HeaderLines_template::replace(int index, int len, const HeaderLines_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

HeaderLines HeaderLines_template::replace(int index, int len, const HeaderLines& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void HeaderLines_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new HeaderLines_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @HTTPmsg_Types.HeaderLines.");
}
set_selection(template_type);
}

HeaderLines_template& HeaderLines_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @HTTPmsg_Types.HeaderLines.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HTTPmsg_Types.HeaderLines.");
return value_list.list_value[list_index];
}

void HeaderLines_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void HeaderLines_template::log_match(const HeaderLines& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void HeaderLines_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.HeaderLines.");
}
}

void HeaderLines_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @HTTPmsg_Types.HeaderLines.");
single_value.value_elements = (HeaderLine_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new HeaderLine_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new HeaderLines_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @HTTPmsg_Types.HeaderLines.");
}
}

boolean HeaderLines_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean HeaderLines_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void HeaderLines_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void HeaderLines_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    HeaderLines_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    HeaderLines_template* precondition = new HeaderLines_template;
    precondition->set_param(*param.get_elem(0));
    HeaderLines_template* implied_template = new HeaderLines_template;
    implied_template->set_param(*param.get_elem(1));
    *this = HeaderLines_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@HTTPmsg_Types.HeaderLines");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void HeaderLines_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HeaderLines");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.HeaderLines");
}

boolean HeaderLines_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
HTTPResponse::HTTPResponse()
{
}

HTTPResponse::HTTPResponse(const OPTIONAL< INTEGER >& par_client__id,
    const INTEGER& par_version__major,
    const INTEGER& par_version__minor,
    const INTEGER& par_statuscode,
    const CHARSTRING& par_statustext,
    const HeaderLines& par_header,
    const CHARSTRING& par_body)
  :   field_client__id(par_client__id),
  field_version__major(par_version__major),
  field_version__minor(par_version__minor),
  field_statuscode(par_statuscode),
  field_statustext(par_statustext),
  field_header(par_header),
  field_body(par_body)
{
}

HTTPResponse::HTTPResponse(const HTTPResponse& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.HTTPResponse.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.version__major().is_bound()) field_version__major = other_value.version__major();
else field_version__major.clean_up();
if (other_value.version__minor().is_bound()) field_version__minor = other_value.version__minor();
else field_version__minor.clean_up();
if (other_value.statuscode().is_bound()) field_statuscode = other_value.statuscode();
else field_statuscode.clean_up();
if (other_value.statustext().is_bound()) field_statustext = other_value.statustext();
else field_statustext.clean_up();
if (other_value.header().is_bound()) field_header = other_value.header();
else field_header.clean_up();
if (other_value.body().is_bound()) field_body = other_value.body();
else field_body.clean_up();
}

void HTTPResponse::clean_up()
{
field_client__id.clean_up();
field_version__major.clean_up();
field_version__minor.clean_up();
field_statuscode.clean_up();
field_statustext.clean_up();
field_header.clean_up();
field_body.clean_up();
}

const TTCN_Typedescriptor_t* HTTPResponse::get_descriptor() const { return &HTTPResponse_descr_; }
HTTPResponse& HTTPResponse::operator=(const HTTPResponse& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.HTTPResponse.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.version__major().is_bound()) field_version__major = other_value.version__major();
  else field_version__major.clean_up();
  if (other_value.version__minor().is_bound()) field_version__minor = other_value.version__minor();
  else field_version__minor.clean_up();
  if (other_value.statuscode().is_bound()) field_statuscode = other_value.statuscode();
  else field_statuscode.clean_up();
  if (other_value.statustext().is_bound()) field_statustext = other_value.statustext();
  else field_statustext.clean_up();
  if (other_value.header().is_bound()) field_header = other_value.header();
  else field_header.clean_up();
  if (other_value.body().is_bound()) field_body = other_value.body();
  else field_body.clean_up();
}
return *this;
}

boolean HTTPResponse::operator==(const HTTPResponse& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_version__major==other_value.field_version__major
  && field_version__minor==other_value.field_version__minor
  && field_statuscode==other_value.field_statuscode
  && field_statustext==other_value.field_statustext
  && field_header==other_value.field_header
  && field_body==other_value.field_body;
}

boolean HTTPResponse::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound())
  || (field_version__major.is_bound())
  || (field_version__minor.is_bound())
  || (field_statuscode.is_bound())
  || (field_statustext.is_bound())
  || (field_header.is_bound())
  || (field_body.is_bound());
}
boolean HTTPResponse::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value())
  && field_version__major.is_value()
  && field_version__minor.is_value()
  && field_statuscode.is_value()
  && field_statustext.is_value()
  && field_header.is_value()
  && field_body.is_value();
}
int HTTPResponse::size_of() const
{
  int ret_val = 6;
  if (field_client__id.ispresent()) ret_val++;
  return ret_val;
}

void HTTPResponse::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", version_major := ");
field_version__major.log();
TTCN_Logger::log_event_str(", version_minor := ");
field_version__minor.log();
TTCN_Logger::log_event_str(", statuscode := ");
field_statuscode.log();
TTCN_Logger::log_event_str(", statustext := ");
field_statustext.log();
TTCN_Logger::log_event_str(", header := ");
field_header.log();
TTCN_Logger::log_event_str(", body := ");
field_body.log();
TTCN_Logger::log_event_str(" }");
}

void HTTPResponse::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (version__major().is_bound()) version__major().set_implicit_omit();
if (version__minor().is_bound()) version__minor().set_implicit_omit();
if (statuscode().is_bound()) statuscode().set_implicit_omit();
if (statustext().is_bound()) statustext().set_implicit_omit();
if (header().is_bound()) header().set_implicit_omit();
if (body().is_bound()) body().set_implicit_omit();
}

void HTTPResponse::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.HTTPResponse has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) version__major().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) version__minor().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) statuscode().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) statustext().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) header().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) body().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_major")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__major().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_minor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__minor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statuscode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statuscode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statustext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statustext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "body")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          body().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HTTPResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.HTTPResponse");
  }
}

void HTTPResponse::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_version__major.encode_text(text_buf);
field_version__minor.encode_text(text_buf);
field_statuscode.encode_text(text_buf);
field_statustext.encode_text(text_buf);
field_header.encode_text(text_buf);
field_body.encode_text(text_buf);
}

void HTTPResponse::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_version__major.decode_text(text_buf);
field_version__minor.decode_text(text_buf);
field_statuscode.decode_text(text_buf);
field_statustext.decode_text(text_buf);
field_header.decode_text(text_buf);
field_body.decode_text(text_buf);
}

struct HTTPResponse_template::single_value_struct {
INTEGER_template field_client__id;
INTEGER_template field_version__major;
INTEGER_template field_version__minor;
INTEGER_template field_statuscode;
CHARSTRING_template field_statustext;
HeaderLines_template field_header;
CHARSTRING_template field_body;
};

void HTTPResponse_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_client__id = ANY_OR_OMIT;
single_value->field_version__major = ANY_VALUE;
single_value->field_version__minor = ANY_VALUE;
single_value->field_statuscode = ANY_VALUE;
single_value->field_statustext = ANY_VALUE;
single_value->field_header = ANY_VALUE;
single_value->field_body = ANY_VALUE;
}
}
}

void HTTPResponse_template::copy_value(const HTTPResponse& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.version__major().is_bound()) {
  single_value->field_version__major = other_value.version__major();
} else {
  single_value->field_version__major.clean_up();
}
if (other_value.version__minor().is_bound()) {
  single_value->field_version__minor = other_value.version__minor();
} else {
  single_value->field_version__minor.clean_up();
}
if (other_value.statuscode().is_bound()) {
  single_value->field_statuscode = other_value.statuscode();
} else {
  single_value->field_statuscode.clean_up();
}
if (other_value.statustext().is_bound()) {
  single_value->field_statustext = other_value.statustext();
} else {
  single_value->field_statustext.clean_up();
}
if (other_value.header().is_bound()) {
  single_value->field_header = other_value.header();
} else {
  single_value->field_header.clean_up();
}
if (other_value.body().is_bound()) {
  single_value->field_body = other_value.body();
} else {
  single_value->field_body.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void HTTPResponse_template::copy_template(const HTTPResponse_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.version__major().get_selection()) {
single_value->field_version__major = other_value.version__major();
} else {
single_value->field_version__major.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.version__minor().get_selection()) {
single_value->field_version__minor = other_value.version__minor();
} else {
single_value->field_version__minor.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.statuscode().get_selection()) {
single_value->field_statuscode = other_value.statuscode();
} else {
single_value->field_statuscode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.statustext().get_selection()) {
single_value->field_statustext = other_value.statustext();
} else {
single_value->field_statustext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.header().get_selection()) {
single_value->field_header = other_value.header();
} else {
single_value->field_header.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.body().get_selection()) {
single_value->field_body = other_value.body();
} else {
single_value->field_body.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new HTTPResponse_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new HTTPResponse_template(*other_value.implication_.precondition);
implication_.implied_template = new HTTPResponse_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPResponse.");
break;
}
set_selection(other_value);
}

HTTPResponse_template::HTTPResponse_template()
{
}

HTTPResponse_template::HTTPResponse_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

HTTPResponse_template::HTTPResponse_template(const HTTPResponse& other_value)
{
copy_value(other_value);
}

HTTPResponse_template::HTTPResponse_template(const OPTIONAL<HTTPResponse>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTPResponse&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.HTTPResponse from an unbound optional field.");
}
}

HTTPResponse_template::HTTPResponse_template(HTTPResponse_template* p_precondition, HTTPResponse_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

HTTPResponse_template::HTTPResponse_template(Dynamic_Match_Interface<HTTPResponse>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<HTTPResponse>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

HTTPResponse_template::HTTPResponse_template(const HTTPResponse_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

HTTPResponse_template::~HTTPResponse_template()
{
clean_up();
}

HTTPResponse_template& HTTPResponse_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

HTTPResponse_template& HTTPResponse_template::operator=(const HTTPResponse& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

HTTPResponse_template& HTTPResponse_template::operator=(const OPTIONAL<HTTPResponse>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTPResponse&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.HTTPResponse.");
}
return *this;
}

HTTPResponse_template& HTTPResponse_template::operator=(const HTTPResponse_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean HTTPResponse_template::match(const HTTPResponse& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.match_omit(legacy)))return FALSE;
if(!other_value.version__major().is_bound()) return FALSE;
if(!single_value->field_version__major.match(other_value.version__major(), legacy))return FALSE;
if(!other_value.version__minor().is_bound()) return FALSE;
if(!single_value->field_version__minor.match(other_value.version__minor(), legacy))return FALSE;
if(!other_value.statuscode().is_bound()) return FALSE;
if(!single_value->field_statuscode.match(other_value.statuscode(), legacy))return FALSE;
if(!other_value.statustext().is_bound()) return FALSE;
if(!single_value->field_statustext.match(other_value.statustext(), legacy))return FALSE;
if(!other_value.header().is_bound()) return FALSE;
if(!single_value->field_header.match(other_value.header(), legacy))return FALSE;
if(!other_value.body().is_bound()) return FALSE;
if(!single_value->field_body.match(other_value.body(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPResponse.");
}
return FALSE;
}

boolean HTTPResponse_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_bound())
 || single_value->field_version__major.is_bound()
 || single_value->field_version__minor.is_bound()
 || single_value->field_statuscode.is_bound()
 || single_value->field_statustext.is_bound()
 || single_value->field_header.is_bound()
 || single_value->field_body.is_bound();
}

boolean HTTPResponse_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_value())
 && single_value->field_version__major.is_value()
 && single_value->field_version__minor.is_value()
 && single_value->field_statuscode.is_value()
 && single_value->field_statustext.is_value()
 && single_value->field_header.is_value()
 && single_value->field_body.is_value();
}

void HTTPResponse_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

HTTPResponse HTTPResponse_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.HTTPResponse.");
HTTPResponse ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_version__major.is_bound()) {
ret_val.version__major() = single_value->field_version__major.valueof();
}
if (single_value->field_version__minor.is_bound()) {
ret_val.version__minor() = single_value->field_version__minor.valueof();
}
if (single_value->field_statuscode.is_bound()) {
ret_val.statuscode() = single_value->field_statuscode.valueof();
}
if (single_value->field_statustext.is_bound()) {
ret_val.statustext() = single_value->field_statustext.valueof();
}
if (single_value->field_header.is_bound()) {
ret_val.header() = single_value->field_header.valueof();
}
if (single_value->field_body.is_bound()) {
ret_val.body() = single_value->field_body.valueof();
}
return ret_val;
}

void HTTPResponse_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.HTTPResponse.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new HTTPResponse_template[list_length];
}

HTTPResponse_template& HTTPResponse_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.HTTPResponse.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.HTTPResponse.");
return value_list.list_value[list_index];
}

INTEGER_template& HTTPResponse_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& HTTPResponse_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @HTTPmsg_Types.HTTPResponse.");
return single_value->field_client__id;
}

INTEGER_template& HTTPResponse_template::version__major()
{
set_specific();
return single_value->field_version__major;
}

const INTEGER_template& HTTPResponse_template::version__major() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version_major of a non-specific template of type @HTTPmsg_Types.HTTPResponse.");
return single_value->field_version__major;
}

INTEGER_template& HTTPResponse_template::version__minor()
{
set_specific();
return single_value->field_version__minor;
}

const INTEGER_template& HTTPResponse_template::version__minor() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version_minor of a non-specific template of type @HTTPmsg_Types.HTTPResponse.");
return single_value->field_version__minor;
}

INTEGER_template& HTTPResponse_template::statuscode()
{
set_specific();
return single_value->field_statuscode;
}

const INTEGER_template& HTTPResponse_template::statuscode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field statuscode of a non-specific template of type @HTTPmsg_Types.HTTPResponse.");
return single_value->field_statuscode;
}

CHARSTRING_template& HTTPResponse_template::statustext()
{
set_specific();
return single_value->field_statustext;
}

const CHARSTRING_template& HTTPResponse_template::statustext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field statustext of a non-specific template of type @HTTPmsg_Types.HTTPResponse.");
return single_value->field_statustext;
}

HeaderLines_template& HTTPResponse_template::header()
{
set_specific();
return single_value->field_header;
}

const HeaderLines_template& HTTPResponse_template::header() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field header of a non-specific template of type @HTTPmsg_Types.HTTPResponse.");
return single_value->field_header;
}

CHARSTRING_template& HTTPResponse_template::body()
{
set_specific();
return single_value->field_body;
}

const CHARSTRING_template& HTTPResponse_template::body() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field body of a non-specific template of type @HTTPmsg_Types.HTTPResponse.");
return single_value->field_body;
}

int HTTPResponse_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 6;
      if (single_value->field_client__id.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPResponse.");
  }
  return 0;
}

void HTTPResponse_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", version_major := ");
single_value->field_version__major.log();
TTCN_Logger::log_event_str(", version_minor := ");
single_value->field_version__minor.log();
TTCN_Logger::log_event_str(", statuscode := ");
single_value->field_statuscode.log();
TTCN_Logger::log_event_str(", statustext := ");
single_value->field_statustext.log();
TTCN_Logger::log_event_str(", header := ");
single_value->field_header.log();
TTCN_Logger::log_event_str(", body := ");
single_value->field_body.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void HTTPResponse_template::log_match(const HTTPResponse& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_version__major.match(match_value.version__major(), legacy)){
TTCN_Logger::log_logmatch_info(".version_major");
single_value->field_version__major.log_match(match_value.version__major(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_version__minor.match(match_value.version__minor(), legacy)){
TTCN_Logger::log_logmatch_info(".version_minor");
single_value->field_version__minor.log_match(match_value.version__minor(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_statuscode.match(match_value.statuscode(), legacy)){
TTCN_Logger::log_logmatch_info(".statuscode");
single_value->field_statuscode.log_match(match_value.statuscode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_statustext.match(match_value.statustext(), legacy)){
TTCN_Logger::log_logmatch_info(".statustext");
single_value->field_statustext.log_match(match_value.statustext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_header.match(match_value.header(), legacy)){
TTCN_Logger::log_logmatch_info(".header");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_body.match(match_value.body(), legacy)){
TTCN_Logger::log_logmatch_info(".body");
single_value->field_body.log_match(match_value.body(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", version_major := ");
single_value->field_version__major.log_match(match_value.version__major(), legacy);
TTCN_Logger::log_event_str(", version_minor := ");
single_value->field_version__minor.log_match(match_value.version__minor(), legacy);
TTCN_Logger::log_event_str(", statuscode := ");
single_value->field_statuscode.log_match(match_value.statuscode(), legacy);
TTCN_Logger::log_event_str(", statustext := ");
single_value->field_statustext.log_match(match_value.statustext(), legacy);
TTCN_Logger::log_event_str(", header := ");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::log_event_str(", body := ");
single_value->field_body.log_match(match_value.body(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void HTTPResponse_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (version__major().is_bound()) version__major().set_implicit_omit();
if (version__minor().is_bound()) version__minor().set_implicit_omit();
if (statuscode().is_bound()) statuscode().set_implicit_omit();
if (statustext().is_bound()) statustext().set_implicit_omit();
if (header().is_bound()) header().set_implicit_omit();
if (body().is_bound()) body().set_implicit_omit();
}

void HTTPResponse_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_version__major.encode_text(text_buf);
single_value->field_version__minor.encode_text(text_buf);
single_value->field_statuscode.encode_text(text_buf);
single_value->field_statustext.encode_text(text_buf);
single_value->field_header.encode_text(text_buf);
single_value->field_body.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPResponse.");
}
}

void HTTPResponse_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_client__id.decode_text(text_buf);
single_value->field_version__major.decode_text(text_buf);
single_value->field_version__minor.decode_text(text_buf);
single_value->field_statuscode.decode_text(text_buf);
single_value->field_statustext.decode_text(text_buf);
single_value->field_header.decode_text(text_buf);
single_value->field_body.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new HTTPResponse_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.HTTPResponse.");
}
}

void HTTPResponse_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    HTTPResponse_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.HTTPResponse has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) version__major().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) version__minor().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) statuscode().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) statustext().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) header().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) body().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_major")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__major().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_minor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__minor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statuscode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statuscode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statustext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statustext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "body")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          body().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HTTPResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    HTTPResponse_template* precondition = new HTTPResponse_template;
    precondition->set_param(*param.get_elem(0));
    HTTPResponse_template* implied_template = new HTTPResponse_template;
    implied_template->set_param(*param.get_elem(1));
    *this = HTTPResponse_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.HTTPResponse");
  }
  is_ifpresent = param.get_ifpresent();
}

void HTTPResponse_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_client__id.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse");
single_value->field_version__major.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse");
single_value->field_version__minor.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse");
single_value->field_statuscode.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse");
single_value->field_statustext.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse");
single_value->field_header.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse");
single_value->field_body.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.HTTPResponse");
}

boolean HTTPResponse_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean HTTPResponse_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

HTTPRequest::HTTPRequest()
{
}

HTTPRequest::HTTPRequest(const OPTIONAL< INTEGER >& par_client__id,
    const CHARSTRING& par_method,
    const CHARSTRING& par_uri,
    const INTEGER& par_version__major,
    const INTEGER& par_version__minor,
    const HeaderLines& par_header,
    const CHARSTRING& par_body)
  :   field_client__id(par_client__id),
  field_method(par_method),
  field_uri(par_uri),
  field_version__major(par_version__major),
  field_version__minor(par_version__minor),
  field_header(par_header),
  field_body(par_body)
{
}

HTTPRequest::HTTPRequest(const HTTPRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.HTTPRequest.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.method().is_bound()) field_method = other_value.method();
else field_method.clean_up();
if (other_value.uri().is_bound()) field_uri = other_value.uri();
else field_uri.clean_up();
if (other_value.version__major().is_bound()) field_version__major = other_value.version__major();
else field_version__major.clean_up();
if (other_value.version__minor().is_bound()) field_version__minor = other_value.version__minor();
else field_version__minor.clean_up();
if (other_value.header().is_bound()) field_header = other_value.header();
else field_header.clean_up();
if (other_value.body().is_bound()) field_body = other_value.body();
else field_body.clean_up();
}

void HTTPRequest::clean_up()
{
field_client__id.clean_up();
field_method.clean_up();
field_uri.clean_up();
field_version__major.clean_up();
field_version__minor.clean_up();
field_header.clean_up();
field_body.clean_up();
}

const TTCN_Typedescriptor_t* HTTPRequest::get_descriptor() const { return &HTTPRequest_descr_; }
HTTPRequest& HTTPRequest::operator=(const HTTPRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.HTTPRequest.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.method().is_bound()) field_method = other_value.method();
  else field_method.clean_up();
  if (other_value.uri().is_bound()) field_uri = other_value.uri();
  else field_uri.clean_up();
  if (other_value.version__major().is_bound()) field_version__major = other_value.version__major();
  else field_version__major.clean_up();
  if (other_value.version__minor().is_bound()) field_version__minor = other_value.version__minor();
  else field_version__minor.clean_up();
  if (other_value.header().is_bound()) field_header = other_value.header();
  else field_header.clean_up();
  if (other_value.body().is_bound()) field_body = other_value.body();
  else field_body.clean_up();
}
return *this;
}

boolean HTTPRequest::operator==(const HTTPRequest& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_method==other_value.field_method
  && field_uri==other_value.field_uri
  && field_version__major==other_value.field_version__major
  && field_version__minor==other_value.field_version__minor
  && field_header==other_value.field_header
  && field_body==other_value.field_body;
}

boolean HTTPRequest::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound())
  || (field_method.is_bound())
  || (field_uri.is_bound())
  || (field_version__major.is_bound())
  || (field_version__minor.is_bound())
  || (field_header.is_bound())
  || (field_body.is_bound());
}
boolean HTTPRequest::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value())
  && field_method.is_value()
  && field_uri.is_value()
  && field_version__major.is_value()
  && field_version__minor.is_value()
  && field_header.is_value()
  && field_body.is_value();
}
int HTTPRequest::size_of() const
{
  int ret_val = 6;
  if (field_client__id.ispresent()) ret_val++;
  return ret_val;
}

void HTTPRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", method := ");
field_method.log();
TTCN_Logger::log_event_str(", uri := ");
field_uri.log();
TTCN_Logger::log_event_str(", version_major := ");
field_version__major.log();
TTCN_Logger::log_event_str(", version_minor := ");
field_version__minor.log();
TTCN_Logger::log_event_str(", header := ");
field_header.log();
TTCN_Logger::log_event_str(", body := ");
field_body.log();
TTCN_Logger::log_event_str(" }");
}

void HTTPRequest::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (method().is_bound()) method().set_implicit_omit();
if (uri().is_bound()) uri().set_implicit_omit();
if (version__major().is_bound()) version__major().set_implicit_omit();
if (version__minor().is_bound()) version__minor().set_implicit_omit();
if (header().is_bound()) header().set_implicit_omit();
if (body().is_bound()) body().set_implicit_omit();
}

void HTTPRequest::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.HTTPRequest has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) method().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) uri().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) version__major().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) version__minor().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) header().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) body().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "method")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          method().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uri")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uri().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_major")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__major().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_minor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__minor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "body")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          body().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HTTPRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.HTTPRequest");
  }
}

void HTTPRequest::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_method.encode_text(text_buf);
field_uri.encode_text(text_buf);
field_version__major.encode_text(text_buf);
field_version__minor.encode_text(text_buf);
field_header.encode_text(text_buf);
field_body.encode_text(text_buf);
}

void HTTPRequest::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_method.decode_text(text_buf);
field_uri.decode_text(text_buf);
field_version__major.decode_text(text_buf);
field_version__minor.decode_text(text_buf);
field_header.decode_text(text_buf);
field_body.decode_text(text_buf);
}

struct HTTPRequest_template::single_value_struct {
INTEGER_template field_client__id;
CHARSTRING_template field_method;
CHARSTRING_template field_uri;
INTEGER_template field_version__major;
INTEGER_template field_version__minor;
HeaderLines_template field_header;
CHARSTRING_template field_body;
};

void HTTPRequest_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_client__id = ANY_OR_OMIT;
single_value->field_method = ANY_VALUE;
single_value->field_uri = ANY_VALUE;
single_value->field_version__major = ANY_VALUE;
single_value->field_version__minor = ANY_VALUE;
single_value->field_header = ANY_VALUE;
single_value->field_body = ANY_VALUE;
}
}
}

void HTTPRequest_template::copy_value(const HTTPRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.method().is_bound()) {
  single_value->field_method = other_value.method();
} else {
  single_value->field_method.clean_up();
}
if (other_value.uri().is_bound()) {
  single_value->field_uri = other_value.uri();
} else {
  single_value->field_uri.clean_up();
}
if (other_value.version__major().is_bound()) {
  single_value->field_version__major = other_value.version__major();
} else {
  single_value->field_version__major.clean_up();
}
if (other_value.version__minor().is_bound()) {
  single_value->field_version__minor = other_value.version__minor();
} else {
  single_value->field_version__minor.clean_up();
}
if (other_value.header().is_bound()) {
  single_value->field_header = other_value.header();
} else {
  single_value->field_header.clean_up();
}
if (other_value.body().is_bound()) {
  single_value->field_body = other_value.body();
} else {
  single_value->field_body.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void HTTPRequest_template::copy_template(const HTTPRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.method().get_selection()) {
single_value->field_method = other_value.method();
} else {
single_value->field_method.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uri().get_selection()) {
single_value->field_uri = other_value.uri();
} else {
single_value->field_uri.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.version__major().get_selection()) {
single_value->field_version__major = other_value.version__major();
} else {
single_value->field_version__major.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.version__minor().get_selection()) {
single_value->field_version__minor = other_value.version__minor();
} else {
single_value->field_version__minor.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.header().get_selection()) {
single_value->field_header = other_value.header();
} else {
single_value->field_header.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.body().get_selection()) {
single_value->field_body = other_value.body();
} else {
single_value->field_body.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new HTTPRequest_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new HTTPRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new HTTPRequest_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPRequest.");
break;
}
set_selection(other_value);
}

HTTPRequest_template::HTTPRequest_template()
{
}

HTTPRequest_template::HTTPRequest_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

HTTPRequest_template::HTTPRequest_template(const HTTPRequest& other_value)
{
copy_value(other_value);
}

HTTPRequest_template::HTTPRequest_template(const OPTIONAL<HTTPRequest>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTPRequest&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.HTTPRequest from an unbound optional field.");
}
}

HTTPRequest_template::HTTPRequest_template(HTTPRequest_template* p_precondition, HTTPRequest_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

HTTPRequest_template::HTTPRequest_template(Dynamic_Match_Interface<HTTPRequest>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<HTTPRequest>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

HTTPRequest_template::HTTPRequest_template(const HTTPRequest_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

HTTPRequest_template::~HTTPRequest_template()
{
clean_up();
}

HTTPRequest_template& HTTPRequest_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

HTTPRequest_template& HTTPRequest_template::operator=(const HTTPRequest& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

HTTPRequest_template& HTTPRequest_template::operator=(const OPTIONAL<HTTPRequest>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTPRequest&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.HTTPRequest.");
}
return *this;
}

HTTPRequest_template& HTTPRequest_template::operator=(const HTTPRequest_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean HTTPRequest_template::match(const HTTPRequest& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.match_omit(legacy)))return FALSE;
if(!other_value.method().is_bound()) return FALSE;
if(!single_value->field_method.match(other_value.method(), legacy))return FALSE;
if(!other_value.uri().is_bound()) return FALSE;
if(!single_value->field_uri.match(other_value.uri(), legacy))return FALSE;
if(!other_value.version__major().is_bound()) return FALSE;
if(!single_value->field_version__major.match(other_value.version__major(), legacy))return FALSE;
if(!other_value.version__minor().is_bound()) return FALSE;
if(!single_value->field_version__minor.match(other_value.version__minor(), legacy))return FALSE;
if(!other_value.header().is_bound()) return FALSE;
if(!single_value->field_header.match(other_value.header(), legacy))return FALSE;
if(!other_value.body().is_bound()) return FALSE;
if(!single_value->field_body.match(other_value.body(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPRequest.");
}
return FALSE;
}

boolean HTTPRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_bound())
 || single_value->field_method.is_bound()
 || single_value->field_uri.is_bound()
 || single_value->field_version__major.is_bound()
 || single_value->field_version__minor.is_bound()
 || single_value->field_header.is_bound()
 || single_value->field_body.is_bound();
}

boolean HTTPRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_value())
 && single_value->field_method.is_value()
 && single_value->field_uri.is_value()
 && single_value->field_version__major.is_value()
 && single_value->field_version__minor.is_value()
 && single_value->field_header.is_value()
 && single_value->field_body.is_value();
}

void HTTPRequest_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

HTTPRequest HTTPRequest_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.HTTPRequest.");
HTTPRequest ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_method.is_bound()) {
ret_val.method() = single_value->field_method.valueof();
}
if (single_value->field_uri.is_bound()) {
ret_val.uri() = single_value->field_uri.valueof();
}
if (single_value->field_version__major.is_bound()) {
ret_val.version__major() = single_value->field_version__major.valueof();
}
if (single_value->field_version__minor.is_bound()) {
ret_val.version__minor() = single_value->field_version__minor.valueof();
}
if (single_value->field_header.is_bound()) {
ret_val.header() = single_value->field_header.valueof();
}
if (single_value->field_body.is_bound()) {
ret_val.body() = single_value->field_body.valueof();
}
return ret_val;
}

void HTTPRequest_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.HTTPRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new HTTPRequest_template[list_length];
}

HTTPRequest_template& HTTPRequest_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.HTTPRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.HTTPRequest.");
return value_list.list_value[list_index];
}

INTEGER_template& HTTPRequest_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& HTTPRequest_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @HTTPmsg_Types.HTTPRequest.");
return single_value->field_client__id;
}

CHARSTRING_template& HTTPRequest_template::method()
{
set_specific();
return single_value->field_method;
}

const CHARSTRING_template& HTTPRequest_template::method() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field method of a non-specific template of type @HTTPmsg_Types.HTTPRequest.");
return single_value->field_method;
}

CHARSTRING_template& HTTPRequest_template::uri()
{
set_specific();
return single_value->field_uri;
}

const CHARSTRING_template& HTTPRequest_template::uri() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uri of a non-specific template of type @HTTPmsg_Types.HTTPRequest.");
return single_value->field_uri;
}

INTEGER_template& HTTPRequest_template::version__major()
{
set_specific();
return single_value->field_version__major;
}

const INTEGER_template& HTTPRequest_template::version__major() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version_major of a non-specific template of type @HTTPmsg_Types.HTTPRequest.");
return single_value->field_version__major;
}

INTEGER_template& HTTPRequest_template::version__minor()
{
set_specific();
return single_value->field_version__minor;
}

const INTEGER_template& HTTPRequest_template::version__minor() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version_minor of a non-specific template of type @HTTPmsg_Types.HTTPRequest.");
return single_value->field_version__minor;
}

HeaderLines_template& HTTPRequest_template::header()
{
set_specific();
return single_value->field_header;
}

const HeaderLines_template& HTTPRequest_template::header() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field header of a non-specific template of type @HTTPmsg_Types.HTTPRequest.");
return single_value->field_header;
}

CHARSTRING_template& HTTPRequest_template::body()
{
set_specific();
return single_value->field_body;
}

const CHARSTRING_template& HTTPRequest_template::body() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field body of a non-specific template of type @HTTPmsg_Types.HTTPRequest.");
return single_value->field_body;
}

int HTTPRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 6;
      if (single_value->field_client__id.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPRequest.");
  }
  return 0;
}

void HTTPRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", method := ");
single_value->field_method.log();
TTCN_Logger::log_event_str(", uri := ");
single_value->field_uri.log();
TTCN_Logger::log_event_str(", version_major := ");
single_value->field_version__major.log();
TTCN_Logger::log_event_str(", version_minor := ");
single_value->field_version__minor.log();
TTCN_Logger::log_event_str(", header := ");
single_value->field_header.log();
TTCN_Logger::log_event_str(", body := ");
single_value->field_body.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void HTTPRequest_template::log_match(const HTTPRequest& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_method.match(match_value.method(), legacy)){
TTCN_Logger::log_logmatch_info(".method");
single_value->field_method.log_match(match_value.method(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uri.match(match_value.uri(), legacy)){
TTCN_Logger::log_logmatch_info(".uri");
single_value->field_uri.log_match(match_value.uri(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_version__major.match(match_value.version__major(), legacy)){
TTCN_Logger::log_logmatch_info(".version_major");
single_value->field_version__major.log_match(match_value.version__major(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_version__minor.match(match_value.version__minor(), legacy)){
TTCN_Logger::log_logmatch_info(".version_minor");
single_value->field_version__minor.log_match(match_value.version__minor(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_header.match(match_value.header(), legacy)){
TTCN_Logger::log_logmatch_info(".header");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_body.match(match_value.body(), legacy)){
TTCN_Logger::log_logmatch_info(".body");
single_value->field_body.log_match(match_value.body(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", method := ");
single_value->field_method.log_match(match_value.method(), legacy);
TTCN_Logger::log_event_str(", uri := ");
single_value->field_uri.log_match(match_value.uri(), legacy);
TTCN_Logger::log_event_str(", version_major := ");
single_value->field_version__major.log_match(match_value.version__major(), legacy);
TTCN_Logger::log_event_str(", version_minor := ");
single_value->field_version__minor.log_match(match_value.version__minor(), legacy);
TTCN_Logger::log_event_str(", header := ");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::log_event_str(", body := ");
single_value->field_body.log_match(match_value.body(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void HTTPRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (method().is_bound()) method().set_implicit_omit();
if (uri().is_bound()) uri().set_implicit_omit();
if (version__major().is_bound()) version__major().set_implicit_omit();
if (version__minor().is_bound()) version__minor().set_implicit_omit();
if (header().is_bound()) header().set_implicit_omit();
if (body().is_bound()) body().set_implicit_omit();
}

void HTTPRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_method.encode_text(text_buf);
single_value->field_uri.encode_text(text_buf);
single_value->field_version__major.encode_text(text_buf);
single_value->field_version__minor.encode_text(text_buf);
single_value->field_header.encode_text(text_buf);
single_value->field_body.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPRequest.");
}
}

void HTTPRequest_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_client__id.decode_text(text_buf);
single_value->field_method.decode_text(text_buf);
single_value->field_uri.decode_text(text_buf);
single_value->field_version__major.decode_text(text_buf);
single_value->field_version__minor.decode_text(text_buf);
single_value->field_header.decode_text(text_buf);
single_value->field_body.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new HTTPRequest_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.HTTPRequest.");
}
}

void HTTPRequest_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    HTTPRequest_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.HTTPRequest has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) method().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) uri().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) version__major().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) version__minor().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) header().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) body().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "method")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          method().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uri")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uri().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_major")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__major().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_minor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__minor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "body")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          body().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HTTPRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    HTTPRequest_template* precondition = new HTTPRequest_template;
    precondition->set_param(*param.get_elem(0));
    HTTPRequest_template* implied_template = new HTTPRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = HTTPRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.HTTPRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void HTTPRequest_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_client__id.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest");
single_value->field_method.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest");
single_value->field_uri.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest");
single_value->field_version__major.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest");
single_value->field_version__minor.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest");
single_value->field_header.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest");
single_value->field_body.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.HTTPRequest");
}

boolean HTTPRequest_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean HTTPRequest_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

HTTPResponse__binary__body::HTTPResponse__binary__body()
{
}

HTTPResponse__binary__body::HTTPResponse__binary__body(const OPTIONAL< INTEGER >& par_client__id,
    const INTEGER& par_version__major,
    const INTEGER& par_version__minor,
    const INTEGER& par_statuscode,
    const CHARSTRING& par_statustext,
    const HeaderLines& par_header,
    const OCTETSTRING& par_body)
  :   field_client__id(par_client__id),
  field_version__major(par_version__major),
  field_version__minor(par_version__minor),
  field_statuscode(par_statuscode),
  field_statustext(par_statustext),
  field_header(par_header),
  field_body(par_body)
{
}

HTTPResponse__binary__body::HTTPResponse__binary__body(const HTTPResponse__binary__body& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.HTTPResponse_binary_body.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.version__major().is_bound()) field_version__major = other_value.version__major();
else field_version__major.clean_up();
if (other_value.version__minor().is_bound()) field_version__minor = other_value.version__minor();
else field_version__minor.clean_up();
if (other_value.statuscode().is_bound()) field_statuscode = other_value.statuscode();
else field_statuscode.clean_up();
if (other_value.statustext().is_bound()) field_statustext = other_value.statustext();
else field_statustext.clean_up();
if (other_value.header().is_bound()) field_header = other_value.header();
else field_header.clean_up();
if (other_value.body().is_bound()) field_body = other_value.body();
else field_body.clean_up();
}

void HTTPResponse__binary__body::clean_up()
{
field_client__id.clean_up();
field_version__major.clean_up();
field_version__minor.clean_up();
field_statuscode.clean_up();
field_statustext.clean_up();
field_header.clean_up();
field_body.clean_up();
}

const TTCN_Typedescriptor_t* HTTPResponse__binary__body::get_descriptor() const { return &HTTPResponse__binary__body_descr_; }
HTTPResponse__binary__body& HTTPResponse__binary__body::operator=(const HTTPResponse__binary__body& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.HTTPResponse_binary_body.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.version__major().is_bound()) field_version__major = other_value.version__major();
  else field_version__major.clean_up();
  if (other_value.version__minor().is_bound()) field_version__minor = other_value.version__minor();
  else field_version__minor.clean_up();
  if (other_value.statuscode().is_bound()) field_statuscode = other_value.statuscode();
  else field_statuscode.clean_up();
  if (other_value.statustext().is_bound()) field_statustext = other_value.statustext();
  else field_statustext.clean_up();
  if (other_value.header().is_bound()) field_header = other_value.header();
  else field_header.clean_up();
  if (other_value.body().is_bound()) field_body = other_value.body();
  else field_body.clean_up();
}
return *this;
}

boolean HTTPResponse__binary__body::operator==(const HTTPResponse__binary__body& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_version__major==other_value.field_version__major
  && field_version__minor==other_value.field_version__minor
  && field_statuscode==other_value.field_statuscode
  && field_statustext==other_value.field_statustext
  && field_header==other_value.field_header
  && field_body==other_value.field_body;
}

boolean HTTPResponse__binary__body::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound())
  || (field_version__major.is_bound())
  || (field_version__minor.is_bound())
  || (field_statuscode.is_bound())
  || (field_statustext.is_bound())
  || (field_header.is_bound())
  || (field_body.is_bound());
}
boolean HTTPResponse__binary__body::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value())
  && field_version__major.is_value()
  && field_version__minor.is_value()
  && field_statuscode.is_value()
  && field_statustext.is_value()
  && field_header.is_value()
  && field_body.is_value();
}
int HTTPResponse__binary__body::size_of() const
{
  int ret_val = 6;
  if (field_client__id.ispresent()) ret_val++;
  return ret_val;
}

void HTTPResponse__binary__body::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", version_major := ");
field_version__major.log();
TTCN_Logger::log_event_str(", version_minor := ");
field_version__minor.log();
TTCN_Logger::log_event_str(", statuscode := ");
field_statuscode.log();
TTCN_Logger::log_event_str(", statustext := ");
field_statustext.log();
TTCN_Logger::log_event_str(", header := ");
field_header.log();
TTCN_Logger::log_event_str(", body := ");
field_body.log();
TTCN_Logger::log_event_str(" }");
}

void HTTPResponse__binary__body::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (version__major().is_bound()) version__major().set_implicit_omit();
if (version__minor().is_bound()) version__minor().set_implicit_omit();
if (statuscode().is_bound()) statuscode().set_implicit_omit();
if (statustext().is_bound()) statustext().set_implicit_omit();
if (header().is_bound()) header().set_implicit_omit();
if (body().is_bound()) body().set_implicit_omit();
}

void HTTPResponse__binary__body::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.HTTPResponse_binary_body has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) version__major().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) version__minor().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) statuscode().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) statustext().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) header().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) body().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_major")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__major().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_minor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__minor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statuscode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statuscode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statustext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statustext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "body")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          body().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HTTPResponse_binary_body: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.HTTPResponse_binary_body");
  }
}

void HTTPResponse__binary__body::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_version__major.encode_text(text_buf);
field_version__minor.encode_text(text_buf);
field_statuscode.encode_text(text_buf);
field_statustext.encode_text(text_buf);
field_header.encode_text(text_buf);
field_body.encode_text(text_buf);
}

void HTTPResponse__binary__body::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_version__major.decode_text(text_buf);
field_version__minor.decode_text(text_buf);
field_statuscode.decode_text(text_buf);
field_statustext.decode_text(text_buf);
field_header.decode_text(text_buf);
field_body.decode_text(text_buf);
}

struct HTTPResponse__binary__body_template::single_value_struct {
INTEGER_template field_client__id;
INTEGER_template field_version__major;
INTEGER_template field_version__minor;
INTEGER_template field_statuscode;
CHARSTRING_template field_statustext;
HeaderLines_template field_header;
OCTETSTRING_template field_body;
};

void HTTPResponse__binary__body_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_client__id = ANY_OR_OMIT;
single_value->field_version__major = ANY_VALUE;
single_value->field_version__minor = ANY_VALUE;
single_value->field_statuscode = ANY_VALUE;
single_value->field_statustext = ANY_VALUE;
single_value->field_header = ANY_VALUE;
single_value->field_body = ANY_VALUE;
}
}
}

void HTTPResponse__binary__body_template::copy_value(const HTTPResponse__binary__body& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.version__major().is_bound()) {
  single_value->field_version__major = other_value.version__major();
} else {
  single_value->field_version__major.clean_up();
}
if (other_value.version__minor().is_bound()) {
  single_value->field_version__minor = other_value.version__minor();
} else {
  single_value->field_version__minor.clean_up();
}
if (other_value.statuscode().is_bound()) {
  single_value->field_statuscode = other_value.statuscode();
} else {
  single_value->field_statuscode.clean_up();
}
if (other_value.statustext().is_bound()) {
  single_value->field_statustext = other_value.statustext();
} else {
  single_value->field_statustext.clean_up();
}
if (other_value.header().is_bound()) {
  single_value->field_header = other_value.header();
} else {
  single_value->field_header.clean_up();
}
if (other_value.body().is_bound()) {
  single_value->field_body = other_value.body();
} else {
  single_value->field_body.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void HTTPResponse__binary__body_template::copy_template(const HTTPResponse__binary__body_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.version__major().get_selection()) {
single_value->field_version__major = other_value.version__major();
} else {
single_value->field_version__major.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.version__minor().get_selection()) {
single_value->field_version__minor = other_value.version__minor();
} else {
single_value->field_version__minor.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.statuscode().get_selection()) {
single_value->field_statuscode = other_value.statuscode();
} else {
single_value->field_statuscode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.statustext().get_selection()) {
single_value->field_statustext = other_value.statustext();
} else {
single_value->field_statustext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.header().get_selection()) {
single_value->field_header = other_value.header();
} else {
single_value->field_header.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.body().get_selection()) {
single_value->field_body = other_value.body();
} else {
single_value->field_body.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new HTTPResponse__binary__body_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new HTTPResponse__binary__body_template(*other_value.implication_.precondition);
implication_.implied_template = new HTTPResponse__binary__body_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
break;
}
set_selection(other_value);
}

HTTPResponse__binary__body_template::HTTPResponse__binary__body_template()
{
}

HTTPResponse__binary__body_template::HTTPResponse__binary__body_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

HTTPResponse__binary__body_template::HTTPResponse__binary__body_template(const HTTPResponse__binary__body& other_value)
{
copy_value(other_value);
}

HTTPResponse__binary__body_template::HTTPResponse__binary__body_template(const OPTIONAL<HTTPResponse__binary__body>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTPResponse__binary__body&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.HTTPResponse_binary_body from an unbound optional field.");
}
}

HTTPResponse__binary__body_template::HTTPResponse__binary__body_template(HTTPResponse__binary__body_template* p_precondition, HTTPResponse__binary__body_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

HTTPResponse__binary__body_template::HTTPResponse__binary__body_template(Dynamic_Match_Interface<HTTPResponse__binary__body>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<HTTPResponse__binary__body>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

HTTPResponse__binary__body_template::HTTPResponse__binary__body_template(const HTTPResponse__binary__body_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

HTTPResponse__binary__body_template::~HTTPResponse__binary__body_template()
{
clean_up();
}

HTTPResponse__binary__body_template& HTTPResponse__binary__body_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

HTTPResponse__binary__body_template& HTTPResponse__binary__body_template::operator=(const HTTPResponse__binary__body& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

HTTPResponse__binary__body_template& HTTPResponse__binary__body_template::operator=(const OPTIONAL<HTTPResponse__binary__body>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTPResponse__binary__body&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
}
return *this;
}

HTTPResponse__binary__body_template& HTTPResponse__binary__body_template::operator=(const HTTPResponse__binary__body_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean HTTPResponse__binary__body_template::match(const HTTPResponse__binary__body& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.match_omit(legacy)))return FALSE;
if(!other_value.version__major().is_bound()) return FALSE;
if(!single_value->field_version__major.match(other_value.version__major(), legacy))return FALSE;
if(!other_value.version__minor().is_bound()) return FALSE;
if(!single_value->field_version__minor.match(other_value.version__minor(), legacy))return FALSE;
if(!other_value.statuscode().is_bound()) return FALSE;
if(!single_value->field_statuscode.match(other_value.statuscode(), legacy))return FALSE;
if(!other_value.statustext().is_bound()) return FALSE;
if(!single_value->field_statustext.match(other_value.statustext(), legacy))return FALSE;
if(!other_value.header().is_bound()) return FALSE;
if(!single_value->field_header.match(other_value.header(), legacy))return FALSE;
if(!other_value.body().is_bound()) return FALSE;
if(!single_value->field_body.match(other_value.body(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
}
return FALSE;
}

boolean HTTPResponse__binary__body_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_bound())
 || single_value->field_version__major.is_bound()
 || single_value->field_version__minor.is_bound()
 || single_value->field_statuscode.is_bound()
 || single_value->field_statustext.is_bound()
 || single_value->field_header.is_bound()
 || single_value->field_body.is_bound();
}

boolean HTTPResponse__binary__body_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_value())
 && single_value->field_version__major.is_value()
 && single_value->field_version__minor.is_value()
 && single_value->field_statuscode.is_value()
 && single_value->field_statustext.is_value()
 && single_value->field_header.is_value()
 && single_value->field_body.is_value();
}

void HTTPResponse__binary__body_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

HTTPResponse__binary__body HTTPResponse__binary__body_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
HTTPResponse__binary__body ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_version__major.is_bound()) {
ret_val.version__major() = single_value->field_version__major.valueof();
}
if (single_value->field_version__minor.is_bound()) {
ret_val.version__minor() = single_value->field_version__minor.valueof();
}
if (single_value->field_statuscode.is_bound()) {
ret_val.statuscode() = single_value->field_statuscode.valueof();
}
if (single_value->field_statustext.is_bound()) {
ret_val.statustext() = single_value->field_statustext.valueof();
}
if (single_value->field_header.is_bound()) {
ret_val.header() = single_value->field_header.valueof();
}
if (single_value->field_body.is_bound()) {
ret_val.body() = single_value->field_body.valueof();
}
return ret_val;
}

void HTTPResponse__binary__body_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new HTTPResponse__binary__body_template[list_length];
}

HTTPResponse__binary__body_template& HTTPResponse__binary__body_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
return value_list.list_value[list_index];
}

INTEGER_template& HTTPResponse__binary__body_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& HTTPResponse__binary__body_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
return single_value->field_client__id;
}

INTEGER_template& HTTPResponse__binary__body_template::version__major()
{
set_specific();
return single_value->field_version__major;
}

const INTEGER_template& HTTPResponse__binary__body_template::version__major() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version_major of a non-specific template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
return single_value->field_version__major;
}

INTEGER_template& HTTPResponse__binary__body_template::version__minor()
{
set_specific();
return single_value->field_version__minor;
}

const INTEGER_template& HTTPResponse__binary__body_template::version__minor() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version_minor of a non-specific template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
return single_value->field_version__minor;
}

INTEGER_template& HTTPResponse__binary__body_template::statuscode()
{
set_specific();
return single_value->field_statuscode;
}

const INTEGER_template& HTTPResponse__binary__body_template::statuscode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field statuscode of a non-specific template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
return single_value->field_statuscode;
}

CHARSTRING_template& HTTPResponse__binary__body_template::statustext()
{
set_specific();
return single_value->field_statustext;
}

const CHARSTRING_template& HTTPResponse__binary__body_template::statustext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field statustext of a non-specific template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
return single_value->field_statustext;
}

HeaderLines_template& HTTPResponse__binary__body_template::header()
{
set_specific();
return single_value->field_header;
}

const HeaderLines_template& HTTPResponse__binary__body_template::header() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field header of a non-specific template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
return single_value->field_header;
}

OCTETSTRING_template& HTTPResponse__binary__body_template::body()
{
set_specific();
return single_value->field_body;
}

const OCTETSTRING_template& HTTPResponse__binary__body_template::body() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field body of a non-specific template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
return single_value->field_body;
}

int HTTPResponse__binary__body_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse_binary_body which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 6;
      if (single_value->field_client__id.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse_binary_body containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse_binary_body containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse_binary_body containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse_binary_body containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse_binary_body containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse_binary_body containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse_binary_body containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPResponse_binary_body containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
  }
  return 0;
}

void HTTPResponse__binary__body_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", version_major := ");
single_value->field_version__major.log();
TTCN_Logger::log_event_str(", version_minor := ");
single_value->field_version__minor.log();
TTCN_Logger::log_event_str(", statuscode := ");
single_value->field_statuscode.log();
TTCN_Logger::log_event_str(", statustext := ");
single_value->field_statustext.log();
TTCN_Logger::log_event_str(", header := ");
single_value->field_header.log();
TTCN_Logger::log_event_str(", body := ");
single_value->field_body.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void HTTPResponse__binary__body_template::log_match(const HTTPResponse__binary__body& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_version__major.match(match_value.version__major(), legacy)){
TTCN_Logger::log_logmatch_info(".version_major");
single_value->field_version__major.log_match(match_value.version__major(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_version__minor.match(match_value.version__minor(), legacy)){
TTCN_Logger::log_logmatch_info(".version_minor");
single_value->field_version__minor.log_match(match_value.version__minor(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_statuscode.match(match_value.statuscode(), legacy)){
TTCN_Logger::log_logmatch_info(".statuscode");
single_value->field_statuscode.log_match(match_value.statuscode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_statustext.match(match_value.statustext(), legacy)){
TTCN_Logger::log_logmatch_info(".statustext");
single_value->field_statustext.log_match(match_value.statustext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_header.match(match_value.header(), legacy)){
TTCN_Logger::log_logmatch_info(".header");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_body.match(match_value.body(), legacy)){
TTCN_Logger::log_logmatch_info(".body");
single_value->field_body.log_match(match_value.body(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", version_major := ");
single_value->field_version__major.log_match(match_value.version__major(), legacy);
TTCN_Logger::log_event_str(", version_minor := ");
single_value->field_version__minor.log_match(match_value.version__minor(), legacy);
TTCN_Logger::log_event_str(", statuscode := ");
single_value->field_statuscode.log_match(match_value.statuscode(), legacy);
TTCN_Logger::log_event_str(", statustext := ");
single_value->field_statustext.log_match(match_value.statustext(), legacy);
TTCN_Logger::log_event_str(", header := ");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::log_event_str(", body := ");
single_value->field_body.log_match(match_value.body(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void HTTPResponse__binary__body_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (version__major().is_bound()) version__major().set_implicit_omit();
if (version__minor().is_bound()) version__minor().set_implicit_omit();
if (statuscode().is_bound()) statuscode().set_implicit_omit();
if (statustext().is_bound()) statustext().set_implicit_omit();
if (header().is_bound()) header().set_implicit_omit();
if (body().is_bound()) body().set_implicit_omit();
}

void HTTPResponse__binary__body_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_version__major.encode_text(text_buf);
single_value->field_version__minor.encode_text(text_buf);
single_value->field_statuscode.encode_text(text_buf);
single_value->field_statustext.encode_text(text_buf);
single_value->field_header.encode_text(text_buf);
single_value->field_body.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
}
}

void HTTPResponse__binary__body_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_client__id.decode_text(text_buf);
single_value->field_version__major.decode_text(text_buf);
single_value->field_version__minor.decode_text(text_buf);
single_value->field_statuscode.decode_text(text_buf);
single_value->field_statustext.decode_text(text_buf);
single_value->field_header.decode_text(text_buf);
single_value->field_body.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new HTTPResponse__binary__body_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.HTTPResponse_binary_body.");
}
}

void HTTPResponse__binary__body_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    HTTPResponse__binary__body_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.HTTPResponse_binary_body has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) version__major().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) version__minor().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) statuscode().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) statustext().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) header().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) body().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_major")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__major().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_minor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__minor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statuscode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statuscode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statustext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statustext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "body")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          body().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HTTPResponse_binary_body: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    HTTPResponse__binary__body_template* precondition = new HTTPResponse__binary__body_template;
    precondition->set_param(*param.get_elem(0));
    HTTPResponse__binary__body_template* implied_template = new HTTPResponse__binary__body_template;
    implied_template->set_param(*param.get_elem(1));
    *this = HTTPResponse__binary__body_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.HTTPResponse_binary_body");
  }
  is_ifpresent = param.get_ifpresent();
}

void HTTPResponse__binary__body_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_client__id.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse_binary_body");
single_value->field_version__major.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse_binary_body");
single_value->field_version__minor.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse_binary_body");
single_value->field_statuscode.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse_binary_body");
single_value->field_statustext.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse_binary_body");
single_value->field_header.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse_binary_body");
single_value->field_body.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPResponse_binary_body");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.HTTPResponse_binary_body");
}

boolean HTTPResponse__binary__body_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean HTTPResponse__binary__body_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

HTTPRequest__binary__body::HTTPRequest__binary__body()
{
}

HTTPRequest__binary__body::HTTPRequest__binary__body(const OPTIONAL< INTEGER >& par_client__id,
    const CHARSTRING& par_method,
    const CHARSTRING& par_uri,
    const INTEGER& par_version__major,
    const INTEGER& par_version__minor,
    const HeaderLines& par_header,
    const OCTETSTRING& par_body)
  :   field_client__id(par_client__id),
  field_method(par_method),
  field_uri(par_uri),
  field_version__major(par_version__major),
  field_version__minor(par_version__minor),
  field_header(par_header),
  field_body(par_body)
{
}

HTTPRequest__binary__body::HTTPRequest__binary__body(const HTTPRequest__binary__body& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.HTTPRequest_binary_body.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.method().is_bound()) field_method = other_value.method();
else field_method.clean_up();
if (other_value.uri().is_bound()) field_uri = other_value.uri();
else field_uri.clean_up();
if (other_value.version__major().is_bound()) field_version__major = other_value.version__major();
else field_version__major.clean_up();
if (other_value.version__minor().is_bound()) field_version__minor = other_value.version__minor();
else field_version__minor.clean_up();
if (other_value.header().is_bound()) field_header = other_value.header();
else field_header.clean_up();
if (other_value.body().is_bound()) field_body = other_value.body();
else field_body.clean_up();
}

void HTTPRequest__binary__body::clean_up()
{
field_client__id.clean_up();
field_method.clean_up();
field_uri.clean_up();
field_version__major.clean_up();
field_version__minor.clean_up();
field_header.clean_up();
field_body.clean_up();
}

const TTCN_Typedescriptor_t* HTTPRequest__binary__body::get_descriptor() const { return &HTTPRequest__binary__body_descr_; }
HTTPRequest__binary__body& HTTPRequest__binary__body::operator=(const HTTPRequest__binary__body& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.HTTPRequest_binary_body.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.method().is_bound()) field_method = other_value.method();
  else field_method.clean_up();
  if (other_value.uri().is_bound()) field_uri = other_value.uri();
  else field_uri.clean_up();
  if (other_value.version__major().is_bound()) field_version__major = other_value.version__major();
  else field_version__major.clean_up();
  if (other_value.version__minor().is_bound()) field_version__minor = other_value.version__minor();
  else field_version__minor.clean_up();
  if (other_value.header().is_bound()) field_header = other_value.header();
  else field_header.clean_up();
  if (other_value.body().is_bound()) field_body = other_value.body();
  else field_body.clean_up();
}
return *this;
}

boolean HTTPRequest__binary__body::operator==(const HTTPRequest__binary__body& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_method==other_value.field_method
  && field_uri==other_value.field_uri
  && field_version__major==other_value.field_version__major
  && field_version__minor==other_value.field_version__minor
  && field_header==other_value.field_header
  && field_body==other_value.field_body;
}

boolean HTTPRequest__binary__body::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound())
  || (field_method.is_bound())
  || (field_uri.is_bound())
  || (field_version__major.is_bound())
  || (field_version__minor.is_bound())
  || (field_header.is_bound())
  || (field_body.is_bound());
}
boolean HTTPRequest__binary__body::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value())
  && field_method.is_value()
  && field_uri.is_value()
  && field_version__major.is_value()
  && field_version__minor.is_value()
  && field_header.is_value()
  && field_body.is_value();
}
int HTTPRequest__binary__body::size_of() const
{
  int ret_val = 6;
  if (field_client__id.ispresent()) ret_val++;
  return ret_val;
}

void HTTPRequest__binary__body::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", method := ");
field_method.log();
TTCN_Logger::log_event_str(", uri := ");
field_uri.log();
TTCN_Logger::log_event_str(", version_major := ");
field_version__major.log();
TTCN_Logger::log_event_str(", version_minor := ");
field_version__minor.log();
TTCN_Logger::log_event_str(", header := ");
field_header.log();
TTCN_Logger::log_event_str(", body := ");
field_body.log();
TTCN_Logger::log_event_str(" }");
}

void HTTPRequest__binary__body::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (method().is_bound()) method().set_implicit_omit();
if (uri().is_bound()) uri().set_implicit_omit();
if (version__major().is_bound()) version__major().set_implicit_omit();
if (version__minor().is_bound()) version__minor().set_implicit_omit();
if (header().is_bound()) header().set_implicit_omit();
if (body().is_bound()) body().set_implicit_omit();
}

void HTTPRequest__binary__body::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.HTTPRequest_binary_body has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) method().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) uri().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) version__major().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) version__minor().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) header().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) body().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "method")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          method().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uri")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uri().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_major")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__major().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_minor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__minor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "body")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          body().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HTTPRequest_binary_body: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.HTTPRequest_binary_body");
  }
}

void HTTPRequest__binary__body::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_method.encode_text(text_buf);
field_uri.encode_text(text_buf);
field_version__major.encode_text(text_buf);
field_version__minor.encode_text(text_buf);
field_header.encode_text(text_buf);
field_body.encode_text(text_buf);
}

void HTTPRequest__binary__body::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_method.decode_text(text_buf);
field_uri.decode_text(text_buf);
field_version__major.decode_text(text_buf);
field_version__minor.decode_text(text_buf);
field_header.decode_text(text_buf);
field_body.decode_text(text_buf);
}

struct HTTPRequest__binary__body_template::single_value_struct {
INTEGER_template field_client__id;
CHARSTRING_template field_method;
CHARSTRING_template field_uri;
INTEGER_template field_version__major;
INTEGER_template field_version__minor;
HeaderLines_template field_header;
OCTETSTRING_template field_body;
};

void HTTPRequest__binary__body_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_client__id = ANY_OR_OMIT;
single_value->field_method = ANY_VALUE;
single_value->field_uri = ANY_VALUE;
single_value->field_version__major = ANY_VALUE;
single_value->field_version__minor = ANY_VALUE;
single_value->field_header = ANY_VALUE;
single_value->field_body = ANY_VALUE;
}
}
}

void HTTPRequest__binary__body_template::copy_value(const HTTPRequest__binary__body& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.method().is_bound()) {
  single_value->field_method = other_value.method();
} else {
  single_value->field_method.clean_up();
}
if (other_value.uri().is_bound()) {
  single_value->field_uri = other_value.uri();
} else {
  single_value->field_uri.clean_up();
}
if (other_value.version__major().is_bound()) {
  single_value->field_version__major = other_value.version__major();
} else {
  single_value->field_version__major.clean_up();
}
if (other_value.version__minor().is_bound()) {
  single_value->field_version__minor = other_value.version__minor();
} else {
  single_value->field_version__minor.clean_up();
}
if (other_value.header().is_bound()) {
  single_value->field_header = other_value.header();
} else {
  single_value->field_header.clean_up();
}
if (other_value.body().is_bound()) {
  single_value->field_body = other_value.body();
} else {
  single_value->field_body.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void HTTPRequest__binary__body_template::copy_template(const HTTPRequest__binary__body_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.method().get_selection()) {
single_value->field_method = other_value.method();
} else {
single_value->field_method.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uri().get_selection()) {
single_value->field_uri = other_value.uri();
} else {
single_value->field_uri.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.version__major().get_selection()) {
single_value->field_version__major = other_value.version__major();
} else {
single_value->field_version__major.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.version__minor().get_selection()) {
single_value->field_version__minor = other_value.version__minor();
} else {
single_value->field_version__minor.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.header().get_selection()) {
single_value->field_header = other_value.header();
} else {
single_value->field_header.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.body().get_selection()) {
single_value->field_body = other_value.body();
} else {
single_value->field_body.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new HTTPRequest__binary__body_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new HTTPRequest__binary__body_template(*other_value.implication_.precondition);
implication_.implied_template = new HTTPRequest__binary__body_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
break;
}
set_selection(other_value);
}

HTTPRequest__binary__body_template::HTTPRequest__binary__body_template()
{
}

HTTPRequest__binary__body_template::HTTPRequest__binary__body_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

HTTPRequest__binary__body_template::HTTPRequest__binary__body_template(const HTTPRequest__binary__body& other_value)
{
copy_value(other_value);
}

HTTPRequest__binary__body_template::HTTPRequest__binary__body_template(const OPTIONAL<HTTPRequest__binary__body>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTPRequest__binary__body&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.HTTPRequest_binary_body from an unbound optional field.");
}
}

HTTPRequest__binary__body_template::HTTPRequest__binary__body_template(HTTPRequest__binary__body_template* p_precondition, HTTPRequest__binary__body_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

HTTPRequest__binary__body_template::HTTPRequest__binary__body_template(Dynamic_Match_Interface<HTTPRequest__binary__body>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<HTTPRequest__binary__body>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

HTTPRequest__binary__body_template::HTTPRequest__binary__body_template(const HTTPRequest__binary__body_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

HTTPRequest__binary__body_template::~HTTPRequest__binary__body_template()
{
clean_up();
}

HTTPRequest__binary__body_template& HTTPRequest__binary__body_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

HTTPRequest__binary__body_template& HTTPRequest__binary__body_template::operator=(const HTTPRequest__binary__body& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

HTTPRequest__binary__body_template& HTTPRequest__binary__body_template::operator=(const OPTIONAL<HTTPRequest__binary__body>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTPRequest__binary__body&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
}
return *this;
}

HTTPRequest__binary__body_template& HTTPRequest__binary__body_template::operator=(const HTTPRequest__binary__body_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean HTTPRequest__binary__body_template::match(const HTTPRequest__binary__body& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.match_omit(legacy)))return FALSE;
if(!other_value.method().is_bound()) return FALSE;
if(!single_value->field_method.match(other_value.method(), legacy))return FALSE;
if(!other_value.uri().is_bound()) return FALSE;
if(!single_value->field_uri.match(other_value.uri(), legacy))return FALSE;
if(!other_value.version__major().is_bound()) return FALSE;
if(!single_value->field_version__major.match(other_value.version__major(), legacy))return FALSE;
if(!other_value.version__minor().is_bound()) return FALSE;
if(!single_value->field_version__minor.match(other_value.version__minor(), legacy))return FALSE;
if(!other_value.header().is_bound()) return FALSE;
if(!single_value->field_header.match(other_value.header(), legacy))return FALSE;
if(!other_value.body().is_bound()) return FALSE;
if(!single_value->field_body.match(other_value.body(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
}
return FALSE;
}

boolean HTTPRequest__binary__body_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_bound())
 || single_value->field_method.is_bound()
 || single_value->field_uri.is_bound()
 || single_value->field_version__major.is_bound()
 || single_value->field_version__minor.is_bound()
 || single_value->field_header.is_bound()
 || single_value->field_body.is_bound();
}

boolean HTTPRequest__binary__body_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_value())
 && single_value->field_method.is_value()
 && single_value->field_uri.is_value()
 && single_value->field_version__major.is_value()
 && single_value->field_version__minor.is_value()
 && single_value->field_header.is_value()
 && single_value->field_body.is_value();
}

void HTTPRequest__binary__body_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

HTTPRequest__binary__body HTTPRequest__binary__body_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
HTTPRequest__binary__body ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_method.is_bound()) {
ret_val.method() = single_value->field_method.valueof();
}
if (single_value->field_uri.is_bound()) {
ret_val.uri() = single_value->field_uri.valueof();
}
if (single_value->field_version__major.is_bound()) {
ret_val.version__major() = single_value->field_version__major.valueof();
}
if (single_value->field_version__minor.is_bound()) {
ret_val.version__minor() = single_value->field_version__minor.valueof();
}
if (single_value->field_header.is_bound()) {
ret_val.header() = single_value->field_header.valueof();
}
if (single_value->field_body.is_bound()) {
ret_val.body() = single_value->field_body.valueof();
}
return ret_val;
}

void HTTPRequest__binary__body_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new HTTPRequest__binary__body_template[list_length];
}

HTTPRequest__binary__body_template& HTTPRequest__binary__body_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
return value_list.list_value[list_index];
}

INTEGER_template& HTTPRequest__binary__body_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& HTTPRequest__binary__body_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
return single_value->field_client__id;
}

CHARSTRING_template& HTTPRequest__binary__body_template::method()
{
set_specific();
return single_value->field_method;
}

const CHARSTRING_template& HTTPRequest__binary__body_template::method() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field method of a non-specific template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
return single_value->field_method;
}

CHARSTRING_template& HTTPRequest__binary__body_template::uri()
{
set_specific();
return single_value->field_uri;
}

const CHARSTRING_template& HTTPRequest__binary__body_template::uri() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uri of a non-specific template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
return single_value->field_uri;
}

INTEGER_template& HTTPRequest__binary__body_template::version__major()
{
set_specific();
return single_value->field_version__major;
}

const INTEGER_template& HTTPRequest__binary__body_template::version__major() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version_major of a non-specific template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
return single_value->field_version__major;
}

INTEGER_template& HTTPRequest__binary__body_template::version__minor()
{
set_specific();
return single_value->field_version__minor;
}

const INTEGER_template& HTTPRequest__binary__body_template::version__minor() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version_minor of a non-specific template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
return single_value->field_version__minor;
}

HeaderLines_template& HTTPRequest__binary__body_template::header()
{
set_specific();
return single_value->field_header;
}

const HeaderLines_template& HTTPRequest__binary__body_template::header() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field header of a non-specific template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
return single_value->field_header;
}

OCTETSTRING_template& HTTPRequest__binary__body_template::body()
{
set_specific();
return single_value->field_body;
}

const OCTETSTRING_template& HTTPRequest__binary__body_template::body() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field body of a non-specific template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
return single_value->field_body;
}

int HTTPRequest__binary__body_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest_binary_body which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 6;
      if (single_value->field_client__id.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest_binary_body containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest_binary_body containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest_binary_body containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest_binary_body containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest_binary_body containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest_binary_body containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest_binary_body containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTPRequest_binary_body containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
  }
  return 0;
}

void HTTPRequest__binary__body_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", method := ");
single_value->field_method.log();
TTCN_Logger::log_event_str(", uri := ");
single_value->field_uri.log();
TTCN_Logger::log_event_str(", version_major := ");
single_value->field_version__major.log();
TTCN_Logger::log_event_str(", version_minor := ");
single_value->field_version__minor.log();
TTCN_Logger::log_event_str(", header := ");
single_value->field_header.log();
TTCN_Logger::log_event_str(", body := ");
single_value->field_body.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void HTTPRequest__binary__body_template::log_match(const HTTPRequest__binary__body& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_method.match(match_value.method(), legacy)){
TTCN_Logger::log_logmatch_info(".method");
single_value->field_method.log_match(match_value.method(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uri.match(match_value.uri(), legacy)){
TTCN_Logger::log_logmatch_info(".uri");
single_value->field_uri.log_match(match_value.uri(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_version__major.match(match_value.version__major(), legacy)){
TTCN_Logger::log_logmatch_info(".version_major");
single_value->field_version__major.log_match(match_value.version__major(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_version__minor.match(match_value.version__minor(), legacy)){
TTCN_Logger::log_logmatch_info(".version_minor");
single_value->field_version__minor.log_match(match_value.version__minor(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_header.match(match_value.header(), legacy)){
TTCN_Logger::log_logmatch_info(".header");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_body.match(match_value.body(), legacy)){
TTCN_Logger::log_logmatch_info(".body");
single_value->field_body.log_match(match_value.body(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", method := ");
single_value->field_method.log_match(match_value.method(), legacy);
TTCN_Logger::log_event_str(", uri := ");
single_value->field_uri.log_match(match_value.uri(), legacy);
TTCN_Logger::log_event_str(", version_major := ");
single_value->field_version__major.log_match(match_value.version__major(), legacy);
TTCN_Logger::log_event_str(", version_minor := ");
single_value->field_version__minor.log_match(match_value.version__minor(), legacy);
TTCN_Logger::log_event_str(", header := ");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::log_event_str(", body := ");
single_value->field_body.log_match(match_value.body(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void HTTPRequest__binary__body_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (method().is_bound()) method().set_implicit_omit();
if (uri().is_bound()) uri().set_implicit_omit();
if (version__major().is_bound()) version__major().set_implicit_omit();
if (version__minor().is_bound()) version__minor().set_implicit_omit();
if (header().is_bound()) header().set_implicit_omit();
if (body().is_bound()) body().set_implicit_omit();
}

void HTTPRequest__binary__body_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_method.encode_text(text_buf);
single_value->field_uri.encode_text(text_buf);
single_value->field_version__major.encode_text(text_buf);
single_value->field_version__minor.encode_text(text_buf);
single_value->field_header.encode_text(text_buf);
single_value->field_body.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
}
}

void HTTPRequest__binary__body_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_client__id.decode_text(text_buf);
single_value->field_method.decode_text(text_buf);
single_value->field_uri.decode_text(text_buf);
single_value->field_version__major.decode_text(text_buf);
single_value->field_version__minor.decode_text(text_buf);
single_value->field_header.decode_text(text_buf);
single_value->field_body.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new HTTPRequest__binary__body_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.HTTPRequest_binary_body.");
}
}

void HTTPRequest__binary__body_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    HTTPRequest__binary__body_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.HTTPRequest_binary_body has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) method().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) uri().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) version__major().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) version__minor().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) header().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) body().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "method")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          method().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uri")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uri().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_major")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__major().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "version_minor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version__minor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "body")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          body().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HTTPRequest_binary_body: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    HTTPRequest__binary__body_template* precondition = new HTTPRequest__binary__body_template;
    precondition->set_param(*param.get_elem(0));
    HTTPRequest__binary__body_template* implied_template = new HTTPRequest__binary__body_template;
    implied_template->set_param(*param.get_elem(1));
    *this = HTTPRequest__binary__body_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.HTTPRequest_binary_body");
  }
  is_ifpresent = param.get_ifpresent();
}

void HTTPRequest__binary__body_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_client__id.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest_binary_body");
single_value->field_method.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest_binary_body");
single_value->field_uri.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest_binary_body");
single_value->field_version__major.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest_binary_body");
single_value->field_version__minor.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest_binary_body");
single_value->field_header.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest_binary_body");
single_value->field_body.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPRequest_binary_body");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.HTTPRequest_binary_body");
}

boolean HTTPRequest__binary__body_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean HTTPRequest__binary__body_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

HTTP__erronous__msg::HTTP__erronous__msg()
{
}

HTTP__erronous__msg::HTTP__erronous__msg(const OPTIONAL< INTEGER >& par_client__id,
    const CHARSTRING& par_msg)
  :   field_client__id(par_client__id),
  field_msg(par_msg)
{
}

HTTP__erronous__msg::HTTP__erronous__msg(const HTTP__erronous__msg& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.HTTP_erronous_msg.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.msg().is_bound()) field_msg = other_value.msg();
else field_msg.clean_up();
}

void HTTP__erronous__msg::clean_up()
{
field_client__id.clean_up();
field_msg.clean_up();
}

const TTCN_Typedescriptor_t* HTTP__erronous__msg::get_descriptor() const { return &HTTP__erronous__msg_descr_; }
HTTP__erronous__msg& HTTP__erronous__msg::operator=(const HTTP__erronous__msg& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.HTTP_erronous_msg.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.msg().is_bound()) field_msg = other_value.msg();
  else field_msg.clean_up();
}
return *this;
}

boolean HTTP__erronous__msg::operator==(const HTTP__erronous__msg& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_msg==other_value.field_msg;
}

boolean HTTP__erronous__msg::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound())
  || (field_msg.is_bound());
}
boolean HTTP__erronous__msg::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value())
  && field_msg.is_value();
}
int HTTP__erronous__msg::size_of() const
{
  int ret_val = 1;
  if (field_client__id.ispresent()) ret_val++;
  return ret_val;
}

void HTTP__erronous__msg::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", msg := ");
field_msg.log();
TTCN_Logger::log_event_str(" }");
}

void HTTP__erronous__msg::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (msg().is_bound()) msg().set_implicit_omit();
}

void HTTP__erronous__msg::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.HTTP_erronous_msg has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) msg().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HTTP_erronous_msg: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.HTTP_erronous_msg");
  }
}

void HTTP__erronous__msg::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_msg.encode_text(text_buf);
}

void HTTP__erronous__msg::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_msg.decode_text(text_buf);
}

struct HTTP__erronous__msg_template::single_value_struct {
INTEGER_template field_client__id;
CHARSTRING_template field_msg;
};

void HTTP__erronous__msg_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_client__id = ANY_OR_OMIT;
single_value->field_msg = ANY_VALUE;
}
}
}

void HTTP__erronous__msg_template::copy_value(const HTTP__erronous__msg& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.msg().is_bound()) {
  single_value->field_msg = other_value.msg();
} else {
  single_value->field_msg.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void HTTP__erronous__msg_template::copy_template(const HTTP__erronous__msg_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msg().get_selection()) {
single_value->field_msg = other_value.msg();
} else {
single_value->field_msg.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new HTTP__erronous__msg_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new HTTP__erronous__msg_template(*other_value.implication_.precondition);
implication_.implied_template = new HTTP__erronous__msg_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.HTTP_erronous_msg.");
break;
}
set_selection(other_value);
}

HTTP__erronous__msg_template::HTTP__erronous__msg_template()
{
}

HTTP__erronous__msg_template::HTTP__erronous__msg_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

HTTP__erronous__msg_template::HTTP__erronous__msg_template(const HTTP__erronous__msg& other_value)
{
copy_value(other_value);
}

HTTP__erronous__msg_template::HTTP__erronous__msg_template(const OPTIONAL<HTTP__erronous__msg>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTP__erronous__msg&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.HTTP_erronous_msg from an unbound optional field.");
}
}

HTTP__erronous__msg_template::HTTP__erronous__msg_template(HTTP__erronous__msg_template* p_precondition, HTTP__erronous__msg_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

HTTP__erronous__msg_template::HTTP__erronous__msg_template(Dynamic_Match_Interface<HTTP__erronous__msg>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<HTTP__erronous__msg>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

HTTP__erronous__msg_template::HTTP__erronous__msg_template(const HTTP__erronous__msg_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

HTTP__erronous__msg_template::~HTTP__erronous__msg_template()
{
clean_up();
}

HTTP__erronous__msg_template& HTTP__erronous__msg_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

HTTP__erronous__msg_template& HTTP__erronous__msg_template::operator=(const HTTP__erronous__msg& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

HTTP__erronous__msg_template& HTTP__erronous__msg_template::operator=(const OPTIONAL<HTTP__erronous__msg>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTP__erronous__msg&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.HTTP_erronous_msg.");
}
return *this;
}

HTTP__erronous__msg_template& HTTP__erronous__msg_template::operator=(const HTTP__erronous__msg_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean HTTP__erronous__msg_template::match(const HTTP__erronous__msg& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.match_omit(legacy)))return FALSE;
if(!other_value.msg().is_bound()) return FALSE;
if(!single_value->field_msg.match(other_value.msg(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.HTTP_erronous_msg.");
}
return FALSE;
}

boolean HTTP__erronous__msg_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_bound())
 || single_value->field_msg.is_bound();
}

boolean HTTP__erronous__msg_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_value())
 && single_value->field_msg.is_value();
}

void HTTP__erronous__msg_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

HTTP__erronous__msg HTTP__erronous__msg_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.HTTP_erronous_msg.");
HTTP__erronous__msg ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_msg.is_bound()) {
ret_val.msg() = single_value->field_msg.valueof();
}
return ret_val;
}

void HTTP__erronous__msg_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.HTTP_erronous_msg.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new HTTP__erronous__msg_template[list_length];
}

HTTP__erronous__msg_template& HTTP__erronous__msg_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.HTTP_erronous_msg.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.HTTP_erronous_msg.");
return value_list.list_value[list_index];
}

INTEGER_template& HTTP__erronous__msg_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& HTTP__erronous__msg_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @HTTPmsg_Types.HTTP_erronous_msg.");
return single_value->field_client__id;
}

CHARSTRING_template& HTTP__erronous__msg_template::msg()
{
set_specific();
return single_value->field_msg;
}

const CHARSTRING_template& HTTP__erronous__msg_template::msg() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msg of a non-specific template of type @HTTPmsg_Types.HTTP_erronous_msg.");
return single_value->field_msg;
}

int HTTP__erronous__msg_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTP_erronous_msg which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_client__id.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTP_erronous_msg containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTP_erronous_msg containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTP_erronous_msg containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTP_erronous_msg containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTP_erronous_msg containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTP_erronous_msg containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTP_erronous_msg containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.HTTP_erronous_msg containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.HTTP_erronous_msg.");
  }
  return 0;
}

void HTTP__erronous__msg_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", msg := ");
single_value->field_msg.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void HTTP__erronous__msg_template::log_match(const HTTP__erronous__msg& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_msg.match(match_value.msg(), legacy)){
TTCN_Logger::log_logmatch_info(".msg");
single_value->field_msg.log_match(match_value.msg(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", msg := ");
single_value->field_msg.log_match(match_value.msg(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void HTTP__erronous__msg_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (msg().is_bound()) msg().set_implicit_omit();
}

void HTTP__erronous__msg_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_msg.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.HTTP_erronous_msg.");
}
}

void HTTP__erronous__msg_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_client__id.decode_text(text_buf);
single_value->field_msg.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new HTTP__erronous__msg_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.HTTP_erronous_msg.");
}
}

void HTTP__erronous__msg_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    HTTP__erronous__msg_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.HTTP_erronous_msg has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) msg().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.HTTP_erronous_msg: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    HTTP__erronous__msg_template* precondition = new HTTP__erronous__msg_template;
    precondition->set_param(*param.get_elem(0));
    HTTP__erronous__msg_template* implied_template = new HTTP__erronous__msg_template;
    implied_template->set_param(*param.get_elem(1));
    *this = HTTP__erronous__msg_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.HTTP_erronous_msg");
  }
  is_ifpresent = param.get_ifpresent();
}

void HTTP__erronous__msg_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_client__id.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTP_erronous_msg");
single_value->field_msg.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTP_erronous_msg");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.HTTP_erronous_msg");
}

boolean HTTP__erronous__msg_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean HTTP__erronous__msg_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void HTTPMessage::copy_value(const HTTPMessage& other_value)
{
switch (other_value.union_selection) {
case ALT_response:
field_response = new HTTPResponse(*other_value.field_response);
break;
case ALT_request:
field_request = new HTTPRequest(*other_value.field_request);
break;
case ALT_response__binary:
field_response__binary = new HTTPResponse__binary__body(*other_value.field_response__binary);
break;
case ALT_request__binary:
field_request__binary = new HTTPRequest__binary__body(*other_value.field_request__binary);
break;
case ALT_erronous__msg:
field_erronous__msg = new HTTP__erronous__msg(*other_value.field_erronous__msg);
break;
default:
TTCN_error("Assignment of an unbound union value of type @HTTPmsg_Types.HTTPMessage.");
}
union_selection = other_value.union_selection;
}

HTTPMessage::HTTPMessage()
{
union_selection = UNBOUND_VALUE;
}

HTTPMessage::HTTPMessage(const HTTPMessage& other_value)
: Base_Type(){
copy_value(other_value);
}

HTTPMessage::~HTTPMessage()
{
clean_up();
}

HTTPMessage& HTTPMessage::operator=(const HTTPMessage& other_value)
{
if (this != &other_value) {
clean_up();
copy_value(other_value);
}
return *this;
}

boolean HTTPMessage::operator==(const HTTPMessage& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HTTPmsg_Types.HTTPMessage.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HTTPmsg_Types.HTTPMessage.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_response:
return *field_response == *other_value.field_response;
case ALT_request:
return *field_request == *other_value.field_request;
case ALT_response__binary:
return *field_response__binary == *other_value.field_response__binary;
case ALT_request__binary:
return *field_request__binary == *other_value.field_request__binary;
case ALT_erronous__msg:
return *field_erronous__msg == *other_value.field_erronous__msg;
default:
return FALSE;
}
}

HTTPResponse& HTTPMessage::response()
{
if (union_selection != ALT_response) {
clean_up();
field_response = new HTTPResponse;
union_selection = ALT_response;
}
return *field_response;
}

const HTTPResponse& HTTPMessage::response() const
{
if (union_selection != ALT_response) TTCN_error("Using non-selected field response in a value of union type @HTTPmsg_Types.HTTPMessage.");
return *field_response;
}

HTTPRequest& HTTPMessage::request()
{
if (union_selection != ALT_request) {
clean_up();
field_request = new HTTPRequest;
union_selection = ALT_request;
}
return *field_request;
}

const HTTPRequest& HTTPMessage::request() const
{
if (union_selection != ALT_request) TTCN_error("Using non-selected field request in a value of union type @HTTPmsg_Types.HTTPMessage.");
return *field_request;
}

HTTPResponse__binary__body& HTTPMessage::response__binary()
{
if (union_selection != ALT_response__binary) {
clean_up();
field_response__binary = new HTTPResponse__binary__body;
union_selection = ALT_response__binary;
}
return *field_response__binary;
}

const HTTPResponse__binary__body& HTTPMessage::response__binary() const
{
if (union_selection != ALT_response__binary) TTCN_error("Using non-selected field response_binary in a value of union type @HTTPmsg_Types.HTTPMessage.");
return *field_response__binary;
}

HTTPRequest__binary__body& HTTPMessage::request__binary()
{
if (union_selection != ALT_request__binary) {
clean_up();
field_request__binary = new HTTPRequest__binary__body;
union_selection = ALT_request__binary;
}
return *field_request__binary;
}

const HTTPRequest__binary__body& HTTPMessage::request__binary() const
{
if (union_selection != ALT_request__binary) TTCN_error("Using non-selected field request_binary in a value of union type @HTTPmsg_Types.HTTPMessage.");
return *field_request__binary;
}

HTTP__erronous__msg& HTTPMessage::erronous__msg()
{
if (union_selection != ALT_erronous__msg) {
clean_up();
field_erronous__msg = new HTTP__erronous__msg;
union_selection = ALT_erronous__msg;
}
return *field_erronous__msg;
}

const HTTP__erronous__msg& HTTPMessage::erronous__msg() const
{
if (union_selection != ALT_erronous__msg) TTCN_error("Using non-selected field erronous_msg in a value of union type @HTTPmsg_Types.HTTPMessage.");
return *field_erronous__msg;
}

boolean HTTPMessage::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HTTPmsg_Types.HTTPMessage.");
return union_selection == checked_selection;
}

boolean HTTPMessage::is_bound() const
{
  return union_selection != UNBOUND_VALUE;
}

boolean HTTPMessage::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_response: return field_response->is_value();
case ALT_request: return field_request->is_value();
case ALT_response__binary: return field_response__binary->is_value();
case ALT_request__binary: return field_request__binary->is_value();
case ALT_erronous__msg: return field_erronous__msg->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void HTTPMessage::clean_up()
{
switch (union_selection) {
case ALT_response:
  delete field_response;
  break;
case ALT_request:
  delete field_request;
  break;
case ALT_response__binary:
  delete field_response__binary;
  break;
case ALT_request__binary:
  delete field_request__binary;
  break;
case ALT_erronous__msg:
  delete field_erronous__msg;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void HTTPMessage::log() const
{
switch (union_selection) {
case ALT_response:
TTCN_Logger::log_event_str("{ response := ");
field_response->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_request:
TTCN_Logger::log_event_str("{ request := ");
field_request->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_response__binary:
TTCN_Logger::log_event_str("{ response_binary := ");
field_response__binary->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_request__binary:
TTCN_Logger::log_event_str("{ request_binary := ");
field_request__binary->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_erronous__msg:
TTCN_Logger::log_event_str("{ erronous_msg := ");
field_erronous__msg->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void HTTPMessage::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "response")) {
    response().set_param(*mp_last);
    if (!response().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "request")) {
    request().set_param(*mp_last);
    if (!request().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "response_binary")) {
    response__binary().set_param(*mp_last);
    if (!response__binary().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "request_binary")) {
    request__binary().set_param(*mp_last);
    if (!request__binary().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "erronous_msg")) {
    erronous__msg().set_param(*mp_last);
    if (!erronous__msg().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @HTTPmsg_Types.HTTPMessage.", last_name);
}

void HTTPMessage::set_implicit_omit()
{
switch (union_selection) {
case ALT_response:
field_response->set_implicit_omit(); break;
case ALT_request:
field_request->set_implicit_omit(); break;
case ALT_response__binary:
field_response__binary->set_implicit_omit(); break;
case ALT_request__binary:
field_request__binary->set_implicit_omit(); break;
case ALT_erronous__msg:
field_erronous__msg->set_implicit_omit(); break;
default: break;
}
}

void HTTPMessage::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_response:
field_response->encode_text(text_buf);
break;
case ALT_request:
field_request->encode_text(text_buf);
break;
case ALT_response__binary:
field_response__binary->encode_text(text_buf);
break;
case ALT_request__binary:
field_request__binary->encode_text(text_buf);
break;
case ALT_erronous__msg:
field_erronous__msg->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @HTTPmsg_Types.HTTPMessage.");
}
}

void HTTPMessage::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_response:
response().decode_text(text_buf);
break;
case ALT_request:
request().decode_text(text_buf);
break;
case ALT_response__binary:
response__binary().decode_text(text_buf);
break;
case ALT_request__binary:
request__binary().decode_text(text_buf);
break;
case ALT_erronous__msg:
erronous__msg().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @HTTPmsg_Types.HTTPMessage.");
}
}

void HTTPMessage_template::copy_value(const HTTPMessage& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case HTTPMessage::ALT_response:
single_value.field_response = new HTTPResponse_template(other_value.response());
break;
case HTTPMessage::ALT_request:
single_value.field_request = new HTTPRequest_template(other_value.request());
break;
case HTTPMessage::ALT_response__binary:
single_value.field_response__binary = new HTTPResponse__binary__body_template(other_value.response__binary());
break;
case HTTPMessage::ALT_request__binary:
single_value.field_request__binary = new HTTPRequest__binary__body_template(other_value.request__binary());
break;
case HTTPMessage::ALT_erronous__msg:
single_value.field_erronous__msg = new HTTP__erronous__msg_template(other_value.erronous__msg());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @HTTPmsg_Types.HTTPMessage.");
}
set_selection(SPECIFIC_VALUE);
}

void HTTPMessage_template::copy_template(const HTTPMessage_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case HTTPMessage::ALT_response:
single_value.field_response = new HTTPResponse_template(*other_value.single_value.field_response);
break;
case HTTPMessage::ALT_request:
single_value.field_request = new HTTPRequest_template(*other_value.single_value.field_request);
break;
case HTTPMessage::ALT_response__binary:
single_value.field_response__binary = new HTTPResponse__binary__body_template(*other_value.single_value.field_response__binary);
break;
case HTTPMessage::ALT_request__binary:
single_value.field_request__binary = new HTTPRequest__binary__body_template(*other_value.single_value.field_request__binary);
break;
case HTTPMessage::ALT_erronous__msg:
single_value.field_erronous__msg = new HTTP__erronous__msg_template(*other_value.single_value.field_erronous__msg);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @HTTPmsg_Types.HTTPMessage.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new HTTPMessage_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new HTTPMessage_template(*other_value.implication_.precondition);
implication_.implied_template = new HTTPMessage_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @HTTPmsg_Types.HTTPMessage.");
}
set_selection(other_value);
}

HTTPMessage_template::HTTPMessage_template()
{
}

HTTPMessage_template::HTTPMessage_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

HTTPMessage_template::HTTPMessage_template(const HTTPMessage& other_value)
{
copy_value(other_value);
}

HTTPMessage_template::HTTPMessage_template(const OPTIONAL<HTTPMessage>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTPMessage&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of union type @HTTPmsg_Types.HTTPMessage from an unbound optional field.");
}
}

HTTPMessage_template::HTTPMessage_template(HTTPMessage_template* p_precondition, HTTPMessage_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

HTTPMessage_template::HTTPMessage_template(Dynamic_Match_Interface<HTTPMessage>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<HTTPMessage>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

HTTPMessage_template::HTTPMessage_template(const HTTPMessage_template& other_value)
: Base_Template(){
copy_template(other_value);
}

HTTPMessage_template::~HTTPMessage_template()
{
clean_up();
}

void HTTPMessage_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case HTTPMessage::ALT_response:
delete single_value.field_response;
break;
case HTTPMessage::ALT_request:
delete single_value.field_request;
break;
case HTTPMessage::ALT_response__binary:
delete single_value.field_response__binary;
break;
case HTTPMessage::ALT_request__binary:
delete single_value.field_request__binary;
break;
case HTTPMessage::ALT_erronous__msg:
delete single_value.field_erronous__msg;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

HTTPMessage_template& HTTPMessage_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

HTTPMessage_template& HTTPMessage_template::operator=(const HTTPMessage& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

HTTPMessage_template& HTTPMessage_template::operator=(const OPTIONAL<HTTPMessage>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTPMessage&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @HTTPmsg_Types.HTTPMessage.");
}
return *this;
}

HTTPMessage_template& HTTPMessage_template::operator=(const HTTPMessage_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean HTTPMessage_template::match(const HTTPMessage& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
HTTPMessage::union_selection_type value_selection = other_value.get_selection();
if (value_selection == HTTPMessage::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case HTTPMessage::ALT_response:
return single_value.field_response->match(other_value.response(), legacy);
case HTTPMessage::ALT_request:
return single_value.field_request->match(other_value.request(), legacy);
case HTTPMessage::ALT_response__binary:
return single_value.field_response__binary->match(other_value.response__binary(), legacy);
case HTTPMessage::ALT_request__binary:
return single_value.field_request__binary->match(other_value.request__binary(), legacy);
case HTTPMessage::ALT_erronous__msg:
return single_value.field_erronous__msg->match(other_value.erronous__msg(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @HTTPmsg_Types.HTTPMessage.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @HTTPmsg_Types.HTTPMessage.");
}
return FALSE;
}

boolean HTTPMessage_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case HTTPMessage::ALT_response:
return single_value.field_response->is_value();
case HTTPMessage::ALT_request:
return single_value.field_request->is_value();
case HTTPMessage::ALT_response__binary:
return single_value.field_response__binary->is_value();
case HTTPMessage::ALT_request__binary:
return single_value.field_request__binary->is_value();
case HTTPMessage::ALT_erronous__msg:
return single_value.field_erronous__msg->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @HTTPmsg_Types.HTTPMessage.");
}
}

HTTPMessage HTTPMessage_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @HTTPmsg_Types.HTTPMessage.");
HTTPMessage ret_val;
switch (single_value.union_selection) {
case HTTPMessage::ALT_response:
ret_val.response() = single_value.field_response->valueof();
break;
case HTTPMessage::ALT_request:
ret_val.request() = single_value.field_request->valueof();
break;
case HTTPMessage::ALT_response__binary:
ret_val.response__binary() = single_value.field_response__binary->valueof();
break;
case HTTPMessage::ALT_request__binary:
ret_val.request__binary() = single_value.field_request__binary->valueof();
break;
case HTTPMessage::ALT_erronous__msg:
ret_val.erronous__msg() = single_value.field_erronous__msg->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @HTTPmsg_Types.HTTPMessage.");
}
return ret_val;
}

HTTPMessage_template& HTTPMessage_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @HTTPmsg_Types.HTTPMessage.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HTTPmsg_Types.HTTPMessage.");
return value_list.list_value[list_index];
}
void HTTPMessage_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @HTTPmsg_Types.HTTPMessage.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new HTTPMessage_template[list_length];
}

HTTPResponse_template& HTTPMessage_template::response()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != HTTPMessage::ALT_response) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_response = new HTTPResponse_template(ANY_VALUE);
else single_value.field_response = new HTTPResponse_template;
single_value.union_selection = HTTPMessage::ALT_response;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_response;
}

const HTTPResponse_template& HTTPMessage_template::response() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field response in a non-specific template of union type @HTTPmsg_Types.HTTPMessage.");
if (single_value.union_selection != HTTPMessage::ALT_response) TTCN_error("Accessing non-selected field response in a template of union type @HTTPmsg_Types.HTTPMessage.");
return *single_value.field_response;
}

HTTPRequest_template& HTTPMessage_template::request()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != HTTPMessage::ALT_request) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_request = new HTTPRequest_template(ANY_VALUE);
else single_value.field_request = new HTTPRequest_template;
single_value.union_selection = HTTPMessage::ALT_request;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_request;
}

const HTTPRequest_template& HTTPMessage_template::request() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field request in a non-specific template of union type @HTTPmsg_Types.HTTPMessage.");
if (single_value.union_selection != HTTPMessage::ALT_request) TTCN_error("Accessing non-selected field request in a template of union type @HTTPmsg_Types.HTTPMessage.");
return *single_value.field_request;
}

HTTPResponse__binary__body_template& HTTPMessage_template::response__binary()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != HTTPMessage::ALT_response__binary) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_response__binary = new HTTPResponse__binary__body_template(ANY_VALUE);
else single_value.field_response__binary = new HTTPResponse__binary__body_template;
single_value.union_selection = HTTPMessage::ALT_response__binary;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_response__binary;
}

const HTTPResponse__binary__body_template& HTTPMessage_template::response__binary() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field response_binary in a non-specific template of union type @HTTPmsg_Types.HTTPMessage.");
if (single_value.union_selection != HTTPMessage::ALT_response__binary) TTCN_error("Accessing non-selected field response_binary in a template of union type @HTTPmsg_Types.HTTPMessage.");
return *single_value.field_response__binary;
}

HTTPRequest__binary__body_template& HTTPMessage_template::request__binary()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != HTTPMessage::ALT_request__binary) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_request__binary = new HTTPRequest__binary__body_template(ANY_VALUE);
else single_value.field_request__binary = new HTTPRequest__binary__body_template;
single_value.union_selection = HTTPMessage::ALT_request__binary;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_request__binary;
}

const HTTPRequest__binary__body_template& HTTPMessage_template::request__binary() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field request_binary in a non-specific template of union type @HTTPmsg_Types.HTTPMessage.");
if (single_value.union_selection != HTTPMessage::ALT_request__binary) TTCN_error("Accessing non-selected field request_binary in a template of union type @HTTPmsg_Types.HTTPMessage.");
return *single_value.field_request__binary;
}

HTTP__erronous__msg_template& HTTPMessage_template::erronous__msg()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != HTTPMessage::ALT_erronous__msg) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_erronous__msg = new HTTP__erronous__msg_template(ANY_VALUE);
else single_value.field_erronous__msg = new HTTP__erronous__msg_template;
single_value.union_selection = HTTPMessage::ALT_erronous__msg;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_erronous__msg;
}

const HTTP__erronous__msg_template& HTTPMessage_template::erronous__msg() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field erronous_msg in a non-specific template of union type @HTTPmsg_Types.HTTPMessage.");
if (single_value.union_selection != HTTPMessage::ALT_erronous__msg) TTCN_error("Accessing non-selected field erronous_msg in a template of union type @HTTPmsg_Types.HTTPMessage.");
return *single_value.field_erronous__msg;
}

boolean HTTPMessage_template::ischosen(HTTPMessage::union_selection_type checked_selection) const
{
if (checked_selection == HTTPMessage::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HTTPmsg_Types.HTTPMessage.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == HTTPMessage::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HTTPmsg_Types.HTTPMessage.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @HTTPmsg_Types.HTTPMessage containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void HTTPMessage_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case HTTPMessage::ALT_response:
TTCN_Logger::log_event_str("{ response := ");
single_value.field_response->log();
TTCN_Logger::log_event_str(" }");
break;
case HTTPMessage::ALT_request:
TTCN_Logger::log_event_str("{ request := ");
single_value.field_request->log();
TTCN_Logger::log_event_str(" }");
break;
case HTTPMessage::ALT_response__binary:
TTCN_Logger::log_event_str("{ response_binary := ");
single_value.field_response__binary->log();
TTCN_Logger::log_event_str(" }");
break;
case HTTPMessage::ALT_request__binary:
TTCN_Logger::log_event_str("{ request_binary := ");
single_value.field_request__binary->log();
TTCN_Logger::log_event_str(" }");
break;
case HTTPMessage::ALT_erronous__msg:
TTCN_Logger::log_event_str("{ erronous_msg := ");
single_value.field_erronous__msg->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void HTTPMessage_template::log_match(const HTTPMessage& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case HTTPMessage::ALT_response:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".response");
single_value.field_response->log_match(match_value.response(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ response := ");
single_value.field_response->log_match(match_value.response(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case HTTPMessage::ALT_request:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".request");
single_value.field_request->log_match(match_value.request(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ request := ");
single_value.field_request->log_match(match_value.request(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case HTTPMessage::ALT_response__binary:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".response_binary");
single_value.field_response__binary->log_match(match_value.response__binary(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ response_binary := ");
single_value.field_response__binary->log_match(match_value.response__binary(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case HTTPMessage::ALT_request__binary:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".request_binary");
single_value.field_request__binary->log_match(match_value.request__binary(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ request_binary := ");
single_value.field_request__binary->log_match(match_value.request__binary(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case HTTPMessage::ALT_erronous__msg:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".erronous_msg");
single_value.field_erronous__msg->log_match(match_value.erronous__msg(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ erronous_msg := ");
single_value.field_erronous__msg->log_match(match_value.erronous__msg(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void HTTPMessage_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case HTTPMessage::ALT_response:
single_value.field_response->set_implicit_omit(); break;
case HTTPMessage::ALT_request:
single_value.field_request->set_implicit_omit(); break;
case HTTPMessage::ALT_response__binary:
single_value.field_response__binary->set_implicit_omit(); break;
case HTTPMessage::ALT_request__binary:
single_value.field_request__binary->set_implicit_omit(); break;
case HTTPMessage::ALT_erronous__msg:
single_value.field_erronous__msg->set_implicit_omit(); break;
default: break;
}
}

void HTTPMessage_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case HTTPMessage::ALT_response:
single_value.field_response->encode_text(text_buf);
break;
case HTTPMessage::ALT_request:
single_value.field_request->encode_text(text_buf);
break;
case HTTPMessage::ALT_response__binary:
single_value.field_response__binary->encode_text(text_buf);
break;
case HTTPMessage::ALT_request__binary:
single_value.field_request__binary->encode_text(text_buf);
break;
case HTTPMessage::ALT_erronous__msg:
single_value.field_erronous__msg->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @HTTPmsg_Types.HTTPMessage.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @HTTPmsg_Types.HTTPMessage.");
}
}

void HTTPMessage_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = HTTPMessage::UNBOUND_VALUE;
HTTPMessage::union_selection_type new_selection = (HTTPMessage::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case HTTPMessage::ALT_response:
single_value.field_response = new HTTPResponse_template;
single_value.field_response->decode_text(text_buf);
break;
case HTTPMessage::ALT_request:
single_value.field_request = new HTTPRequest_template;
single_value.field_request->decode_text(text_buf);
break;
case HTTPMessage::ALT_response__binary:
single_value.field_response__binary = new HTTPResponse__binary__body_template;
single_value.field_response__binary->decode_text(text_buf);
break;
case HTTPMessage::ALT_request__binary:
single_value.field_request__binary = new HTTPRequest__binary__body_template;
single_value.field_request__binary->decode_text(text_buf);
break;
case HTTPMessage::ALT_erronous__msg:
single_value.field_erronous__msg = new HTTP__erronous__msg_template;
single_value.field_erronous__msg->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @HTTPmsg_Types.HTTPMessage.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new HTTPMessage_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @HTTPmsg_Types.HTTPMessage.");
}
}

boolean HTTPMessage_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean HTTPMessage_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int v_idx=0; v_idx<value_list.n_values; v_idx++)
if (value_list.list_value[v_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void HTTPMessage_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@HTTPmsg_Types.HTTPMessage'");
    }
    if (strcmp("response", param_field) == 0) {
      response().set_param(param);
      return;
    } else if (strcmp("request", param_field) == 0) {
      request().set_param(param);
      return;
    } else if (strcmp("response_binary", param_field) == 0) {
      response__binary().set_param(param);
      return;
    } else if (strcmp("request_binary", param_field) == 0) {
      request__binary().set_param(param);
      return;
    } else if (strcmp("erronous_msg", param_field) == 0) {
      erronous__msg().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@HTTPmsg_Types.HTTPMessage'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    HTTPMessage_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@HTTPmsg_Types.HTTPMessage");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "response")) {
      response().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "request")) {
      request().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "response_binary")) {
      response__binary().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "request_binary")) {
      request__binary().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "erronous_msg")) {
      erronous__msg().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @HTTPmsg_Types.HTTPMessage.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    HTTPMessage_template* precondition = new HTTPMessage_template;
    precondition->set_param(*m_p->get_elem(0));
    HTTPMessage_template* implied_template = new HTTPMessage_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = HTTPMessage_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@HTTPmsg_Types.HTTPMessage");
  }
  is_ifpresent = param.get_ifpresent();
}

void HTTPMessage_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case HTTPMessage::ALT_response:
single_value.field_response->check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPMessage");
return;
case HTTPMessage::ALT_request:
single_value.field_request->check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPMessage");
return;
case HTTPMessage::ALT_response__binary:
single_value.field_response__binary->check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPMessage");
return;
case HTTPMessage::ALT_request__binary:
single_value.field_request__binary->check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPMessage");
return;
case HTTPMessage::ALT_erronous__msg:
single_value.field_erronous__msg->check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.HTTPMessage");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @HTTPmsg_Types.HTTPMessage.");
}
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.HTTPMessage");
}

Close::Close()
{
}

Close::Close(const OPTIONAL< INTEGER >& par_client__id)
  :   field_client__id(par_client__id)
{
}

Close::Close(const Close& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.Close.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
}

void Close::clean_up()
{
field_client__id.clean_up();
}

const TTCN_Typedescriptor_t* Close::get_descriptor() const { return &Close_descr_; }
Close& Close::operator=(const Close& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.Close.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
}
return *this;
}

boolean Close::operator==(const Close& other_value) const
{
return field_client__id==other_value.field_client__id;
}

boolean Close::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound());
}
boolean Close::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value());
}
int Close::size_of() const
{
  int ret_val = 0;
  if (field_client__id.ispresent()) ret_val++;
  return ret_val;
}

void Close::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(" }");
}

void Close::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
}

void Close::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.Close has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Close: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.Close");
  }
}

void Close::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
}

void Close::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
}

struct Close_template::single_value_struct {
INTEGER_template field_client__id;
};

void Close_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_client__id = ANY_OR_OMIT;
}
}
}

void Close_template::copy_value(const Close& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Close_template::copy_template(const Close_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Close_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new Close_template(*other_value.implication_.precondition);
implication_.implied_template = new Close_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.Close.");
break;
}
set_selection(other_value);
}

Close_template::Close_template()
{
}

Close_template::Close_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Close_template::Close_template(const Close& other_value)
{
copy_value(other_value);
}

Close_template::Close_template(const OPTIONAL<Close>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Close&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.Close from an unbound optional field.");
}
}

Close_template::Close_template(Close_template* p_precondition, Close_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Close_template::Close_template(Dynamic_Match_Interface<Close>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Close>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Close_template::Close_template(const Close_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Close_template::~Close_template()
{
clean_up();
}

Close_template& Close_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Close_template& Close_template::operator=(const Close& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Close_template& Close_template::operator=(const OPTIONAL<Close>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Close&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.Close.");
}
return *this;
}

Close_template& Close_template::operator=(const Close_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Close_template::match(const Close& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.Close.");
}
return FALSE;
}

boolean Close_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_bound());
}

boolean Close_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_value());
}

void Close_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

Close Close_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.Close.");
Close ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
return ret_val;
}

void Close_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.Close.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Close_template[list_length];
}

Close_template& Close_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.Close.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.Close.");
return value_list.list_value[list_index];
}

INTEGER_template& Close_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& Close_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @HTTPmsg_Types.Close.");
return single_value->field_client__id;
}

int Close_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Close which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 0;
      if (single_value->field_client__id.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.Close containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Close containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Close containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Close containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Close containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Close containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Close containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Close containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.Close.");
  }
  return 0;
}

void Close_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Close_template::log_match(const Close& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Close_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
}

void Close_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.Close.");
}
}

void Close_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_client__id.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Close_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.Close.");
}
}

void Close_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Close_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.Close has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Close: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Close_template* precondition = new Close_template;
    precondition->set_param(*param.get_elem(0));
    Close_template* implied_template = new Close_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Close_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.Close");
  }
  is_ifpresent = param.get_ifpresent();
}

void Close_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_client__id.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Close");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.Close");
}

boolean Close_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Close_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

Connect::Connect()
{
}

Connect::Connect(const CHARSTRING& par_hostname,
    const INTEGER& par_portnumber,
    const BOOLEAN& par_use__ssl)
  :   field_hostname(par_hostname),
  field_portnumber(par_portnumber),
  field_use__ssl(par_use__ssl)
{
}

Connect::Connect(const Connect& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.Connect.");
if (other_value.hostname().is_bound()) field_hostname = other_value.hostname();
else field_hostname.clean_up();
if (other_value.portnumber().is_bound()) field_portnumber = other_value.portnumber();
else field_portnumber.clean_up();
if (other_value.use__ssl().is_bound()) field_use__ssl = other_value.use__ssl();
else field_use__ssl.clean_up();
}

void Connect::clean_up()
{
field_hostname.clean_up();
field_portnumber.clean_up();
field_use__ssl.clean_up();
}

const TTCN_Typedescriptor_t* Connect::get_descriptor() const { return &Connect_descr_; }
Connect& Connect::operator=(const Connect& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.Connect.");
  if (other_value.hostname().is_bound()) field_hostname = other_value.hostname();
  else field_hostname.clean_up();
  if (other_value.portnumber().is_bound()) field_portnumber = other_value.portnumber();
  else field_portnumber.clean_up();
  if (other_value.use__ssl().is_bound()) field_use__ssl = other_value.use__ssl();
  else field_use__ssl.clean_up();
}
return *this;
}

boolean Connect::operator==(const Connect& other_value) const
{
return field_hostname==other_value.field_hostname
  && field_portnumber==other_value.field_portnumber
  && field_use__ssl==other_value.field_use__ssl;
}

boolean Connect::is_bound() const
{
return (field_hostname.is_bound())
  || (field_portnumber.is_bound())
  || (field_use__ssl.is_bound());
}
boolean Connect::is_value() const
{
return field_hostname.is_value()
  && field_portnumber.is_value()
  && field_use__ssl.is_value();
}
void Connect::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ hostname := ");
field_hostname.log();
TTCN_Logger::log_event_str(", portnumber := ");
field_portnumber.log();
TTCN_Logger::log_event_str(", use_ssl := ");
field_use__ssl.log();
TTCN_Logger::log_event_str(" }");
}

void Connect::set_implicit_omit()
{
if (hostname().is_bound()) hostname().set_implicit_omit();
if (portnumber().is_bound()) portnumber().set_implicit_omit();
if (use__ssl().is_bound()) use__ssl().set_implicit_omit();
}

void Connect::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.Connect has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) portnumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) use__ssl().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hostname().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          portnumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "use_ssl")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          use__ssl().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Connect: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.Connect");
  }
}

void Connect::encode_text(Text_Buf& text_buf) const
{
field_hostname.encode_text(text_buf);
field_portnumber.encode_text(text_buf);
field_use__ssl.encode_text(text_buf);
}

void Connect::decode_text(Text_Buf& text_buf)
{
field_hostname.decode_text(text_buf);
field_portnumber.decode_text(text_buf);
field_use__ssl.decode_text(text_buf);
}

struct Connect_template::single_value_struct {
CHARSTRING_template field_hostname;
INTEGER_template field_portnumber;
BOOLEAN_template field_use__ssl;
};

void Connect_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_hostname = ANY_VALUE;
single_value->field_portnumber = ANY_VALUE;
single_value->field_use__ssl = ANY_VALUE;
}
}
}

void Connect_template::copy_value(const Connect& other_value)
{
single_value = new single_value_struct;
if (other_value.hostname().is_bound()) {
  single_value->field_hostname = other_value.hostname();
} else {
  single_value->field_hostname.clean_up();
}
if (other_value.portnumber().is_bound()) {
  single_value->field_portnumber = other_value.portnumber();
} else {
  single_value->field_portnumber.clean_up();
}
if (other_value.use__ssl().is_bound()) {
  single_value->field_use__ssl = other_value.use__ssl();
} else {
  single_value->field_use__ssl.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Connect_template::copy_template(const Connect_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.hostname().get_selection()) {
single_value->field_hostname = other_value.hostname();
} else {
single_value->field_hostname.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.portnumber().get_selection()) {
single_value->field_portnumber = other_value.portnumber();
} else {
single_value->field_portnumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.use__ssl().get_selection()) {
single_value->field_use__ssl = other_value.use__ssl();
} else {
single_value->field_use__ssl.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Connect_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new Connect_template(*other_value.implication_.precondition);
implication_.implied_template = new Connect_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.Connect.");
break;
}
set_selection(other_value);
}

Connect_template::Connect_template()
{
}

Connect_template::Connect_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Connect_template::Connect_template(const Connect& other_value)
{
copy_value(other_value);
}

Connect_template::Connect_template(const OPTIONAL<Connect>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Connect&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.Connect from an unbound optional field.");
}
}

Connect_template::Connect_template(Connect_template* p_precondition, Connect_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Connect_template::Connect_template(Dynamic_Match_Interface<Connect>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Connect>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Connect_template::Connect_template(const Connect_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Connect_template::~Connect_template()
{
clean_up();
}

Connect_template& Connect_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Connect_template& Connect_template::operator=(const Connect& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Connect_template& Connect_template::operator=(const OPTIONAL<Connect>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Connect&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.Connect.");
}
return *this;
}

Connect_template& Connect_template::operator=(const Connect_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Connect_template::match(const Connect& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.hostname().is_bound()) return FALSE;
if(!single_value->field_hostname.match(other_value.hostname(), legacy))return FALSE;
if(!other_value.portnumber().is_bound()) return FALSE;
if(!single_value->field_portnumber.match(other_value.portnumber(), legacy))return FALSE;
if(!other_value.use__ssl().is_bound()) return FALSE;
if(!single_value->field_use__ssl.match(other_value.use__ssl(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.Connect.");
}
return FALSE;
}

boolean Connect_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_hostname.is_bound()
 || single_value->field_portnumber.is_bound()
 || single_value->field_use__ssl.is_bound();
}

boolean Connect_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_hostname.is_value()
 && single_value->field_portnumber.is_value()
 && single_value->field_use__ssl.is_value();
}

void Connect_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

Connect Connect_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.Connect.");
Connect ret_val;
if (single_value->field_hostname.is_bound()) {
ret_val.hostname() = single_value->field_hostname.valueof();
}
if (single_value->field_portnumber.is_bound()) {
ret_val.portnumber() = single_value->field_portnumber.valueof();
}
if (single_value->field_use__ssl.is_bound()) {
ret_val.use__ssl() = single_value->field_use__ssl.valueof();
}
return ret_val;
}

void Connect_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.Connect.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Connect_template[list_length];
}

Connect_template& Connect_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.Connect.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.Connect.");
return value_list.list_value[list_index];
}

CHARSTRING_template& Connect_template::hostname()
{
set_specific();
return single_value->field_hostname;
}

const CHARSTRING_template& Connect_template::hostname() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field hostname of a non-specific template of type @HTTPmsg_Types.Connect.");
return single_value->field_hostname;
}

INTEGER_template& Connect_template::portnumber()
{
set_specific();
return single_value->field_portnumber;
}

const INTEGER_template& Connect_template::portnumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field portnumber of a non-specific template of type @HTTPmsg_Types.Connect.");
return single_value->field_portnumber;
}

BOOLEAN_template& Connect_template::use__ssl()
{
set_specific();
return single_value->field_use__ssl;
}

const BOOLEAN_template& Connect_template::use__ssl() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field use_ssl of a non-specific template of type @HTTPmsg_Types.Connect.");
return single_value->field_use__ssl;
}

int Connect_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.Connect.");
  }
  return 0;
}

void Connect_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ hostname := ");
single_value->field_hostname.log();
TTCN_Logger::log_event_str(", portnumber := ");
single_value->field_portnumber.log();
TTCN_Logger::log_event_str(", use_ssl := ");
single_value->field_use__ssl.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Connect_template::log_match(const Connect& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_hostname.match(match_value.hostname(), legacy)){
TTCN_Logger::log_logmatch_info(".hostname");
single_value->field_hostname.log_match(match_value.hostname(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_portnumber.match(match_value.portnumber(), legacy)){
TTCN_Logger::log_logmatch_info(".portnumber");
single_value->field_portnumber.log_match(match_value.portnumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_use__ssl.match(match_value.use__ssl(), legacy)){
TTCN_Logger::log_logmatch_info(".use_ssl");
single_value->field_use__ssl.log_match(match_value.use__ssl(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ hostname := ");
single_value->field_hostname.log_match(match_value.hostname(), legacy);
TTCN_Logger::log_event_str(", portnumber := ");
single_value->field_portnumber.log_match(match_value.portnumber(), legacy);
TTCN_Logger::log_event_str(", use_ssl := ");
single_value->field_use__ssl.log_match(match_value.use__ssl(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Connect_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (hostname().is_bound()) hostname().set_implicit_omit();
if (portnumber().is_bound()) portnumber().set_implicit_omit();
if (use__ssl().is_bound()) use__ssl().set_implicit_omit();
}

void Connect_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_hostname.encode_text(text_buf);
single_value->field_portnumber.encode_text(text_buf);
single_value->field_use__ssl.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.Connect.");
}
}

void Connect_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_hostname.decode_text(text_buf);
single_value->field_portnumber.decode_text(text_buf);
single_value->field_use__ssl.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Connect_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.Connect.");
}
}

void Connect_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Connect_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.Connect has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) portnumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) use__ssl().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hostname().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          portnumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "use_ssl")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          use__ssl().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Connect: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Connect_template* precondition = new Connect_template;
    precondition->set_param(*param.get_elem(0));
    Connect_template* implied_template = new Connect_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Connect_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.Connect");
  }
  is_ifpresent = param.get_ifpresent();
}

void Connect_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_hostname.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Connect");
single_value->field_portnumber.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Connect");
single_value->field_use__ssl.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Connect");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.Connect");
}

boolean Connect_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Connect_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

Connect__result::Connect__result()
{
}

Connect__result::Connect__result(const INTEGER& par_client__id)
  :   field_client__id(par_client__id)
{
}

Connect__result::Connect__result(const Connect__result& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.Connect_result.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
}

void Connect__result::clean_up()
{
field_client__id.clean_up();
}

const TTCN_Typedescriptor_t* Connect__result::get_descriptor() const { return &Connect__result_descr_; }
Connect__result& Connect__result::operator=(const Connect__result& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.Connect_result.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
}
return *this;
}

boolean Connect__result::operator==(const Connect__result& other_value) const
{
return field_client__id==other_value.field_client__id;
}

boolean Connect__result::is_bound() const
{
return (field_client__id.is_bound());
}
boolean Connect__result::is_value() const
{
return field_client__id.is_value();
}
void Connect__result::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(" }");
}

void Connect__result::set_implicit_omit()
{
if (client__id().is_bound()) client__id().set_implicit_omit();
}

void Connect__result::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.Connect_result has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Connect_result: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.Connect_result");
  }
}

void Connect__result::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
}

void Connect__result::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
}

struct Connect__result_template::single_value_struct {
INTEGER_template field_client__id;
};

void Connect__result_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_client__id = ANY_VALUE;
}
}
}

void Connect__result_template::copy_value(const Connect__result& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Connect__result_template::copy_template(const Connect__result_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Connect__result_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new Connect__result_template(*other_value.implication_.precondition);
implication_.implied_template = new Connect__result_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.Connect_result.");
break;
}
set_selection(other_value);
}

Connect__result_template::Connect__result_template()
{
}

Connect__result_template::Connect__result_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Connect__result_template::Connect__result_template(const Connect__result& other_value)
{
copy_value(other_value);
}

Connect__result_template::Connect__result_template(const OPTIONAL<Connect__result>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Connect__result&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.Connect_result from an unbound optional field.");
}
}

Connect__result_template::Connect__result_template(Connect__result_template* p_precondition, Connect__result_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Connect__result_template::Connect__result_template(Dynamic_Match_Interface<Connect__result>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Connect__result>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Connect__result_template::Connect__result_template(const Connect__result_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Connect__result_template::~Connect__result_template()
{
clean_up();
}

Connect__result_template& Connect__result_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Connect__result_template& Connect__result_template::operator=(const Connect__result& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Connect__result_template& Connect__result_template::operator=(const OPTIONAL<Connect__result>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Connect__result&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.Connect_result.");
}
return *this;
}

Connect__result_template& Connect__result_template::operator=(const Connect__result_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Connect__result_template::match(const Connect__result& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__id(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.Connect_result.");
}
return FALSE;
}

boolean Connect__result_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_client__id.is_bound();
}

boolean Connect__result_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_client__id.is_value();
}

void Connect__result_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

Connect__result Connect__result_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.Connect_result.");
Connect__result ret_val;
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
return ret_val;
}

void Connect__result_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.Connect_result.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Connect__result_template[list_length];
}

Connect__result_template& Connect__result_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.Connect_result.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.Connect_result.");
return value_list.list_value[list_index];
}

INTEGER_template& Connect__result_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& Connect__result_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @HTTPmsg_Types.Connect_result.");
return single_value->field_client__id;
}

int Connect__result_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect_result which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect_result containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect_result containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect_result containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect_result containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect_result containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect_result containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect_result containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Connect_result containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.Connect_result.");
  }
  return 0;
}

void Connect__result_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Connect__result_template::log_match(const Connect__result& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Connect__result_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (client__id().is_bound()) client__id().set_implicit_omit();
}

void Connect__result_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.Connect_result.");
}
}

void Connect__result_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_client__id.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Connect__result_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.Connect_result.");
}
}

void Connect__result_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Connect__result_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.Connect_result has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Connect_result: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Connect__result_template* precondition = new Connect__result_template;
    precondition->set_param(*param.get_elem(0));
    Connect__result_template* implied_template = new Connect__result_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Connect__result_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.Connect_result");
  }
  is_ifpresent = param.get_ifpresent();
}

void Connect__result_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_client__id.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Connect_result");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.Connect_result");
}

boolean Connect__result_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Connect__result_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

Client__connected::Client__connected()
{
}

Client__connected::Client__connected(const CHARSTRING& par_hostname,
    const INTEGER& par_portnumber,
    const INTEGER& par_client__id)
  :   field_hostname(par_hostname),
  field_portnumber(par_portnumber),
  field_client__id(par_client__id)
{
}

Client__connected::Client__connected(const Client__connected& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.Client_connected.");
if (other_value.hostname().is_bound()) field_hostname = other_value.hostname();
else field_hostname.clean_up();
if (other_value.portnumber().is_bound()) field_portnumber = other_value.portnumber();
else field_portnumber.clean_up();
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
}

void Client__connected::clean_up()
{
field_hostname.clean_up();
field_portnumber.clean_up();
field_client__id.clean_up();
}

const TTCN_Typedescriptor_t* Client__connected::get_descriptor() const { return &Client__connected_descr_; }
Client__connected& Client__connected::operator=(const Client__connected& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.Client_connected.");
  if (other_value.hostname().is_bound()) field_hostname = other_value.hostname();
  else field_hostname.clean_up();
  if (other_value.portnumber().is_bound()) field_portnumber = other_value.portnumber();
  else field_portnumber.clean_up();
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
}
return *this;
}

boolean Client__connected::operator==(const Client__connected& other_value) const
{
return field_hostname==other_value.field_hostname
  && field_portnumber==other_value.field_portnumber
  && field_client__id==other_value.field_client__id;
}

boolean Client__connected::is_bound() const
{
return (field_hostname.is_bound())
  || (field_portnumber.is_bound())
  || (field_client__id.is_bound());
}
boolean Client__connected::is_value() const
{
return field_hostname.is_value()
  && field_portnumber.is_value()
  && field_client__id.is_value();
}
void Client__connected::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ hostname := ");
field_hostname.log();
TTCN_Logger::log_event_str(", portnumber := ");
field_portnumber.log();
TTCN_Logger::log_event_str(", client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(" }");
}

void Client__connected::set_implicit_omit()
{
if (hostname().is_bound()) hostname().set_implicit_omit();
if (portnumber().is_bound()) portnumber().set_implicit_omit();
if (client__id().is_bound()) client__id().set_implicit_omit();
}

void Client__connected::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.Client_connected has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) portnumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hostname().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          portnumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Client_connected: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.Client_connected");
  }
}

void Client__connected::encode_text(Text_Buf& text_buf) const
{
field_hostname.encode_text(text_buf);
field_portnumber.encode_text(text_buf);
field_client__id.encode_text(text_buf);
}

void Client__connected::decode_text(Text_Buf& text_buf)
{
field_hostname.decode_text(text_buf);
field_portnumber.decode_text(text_buf);
field_client__id.decode_text(text_buf);
}

struct Client__connected_template::single_value_struct {
CHARSTRING_template field_hostname;
INTEGER_template field_portnumber;
INTEGER_template field_client__id;
};

void Client__connected_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_hostname = ANY_VALUE;
single_value->field_portnumber = ANY_VALUE;
single_value->field_client__id = ANY_VALUE;
}
}
}

void Client__connected_template::copy_value(const Client__connected& other_value)
{
single_value = new single_value_struct;
if (other_value.hostname().is_bound()) {
  single_value->field_hostname = other_value.hostname();
} else {
  single_value->field_hostname.clean_up();
}
if (other_value.portnumber().is_bound()) {
  single_value->field_portnumber = other_value.portnumber();
} else {
  single_value->field_portnumber.clean_up();
}
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Client__connected_template::copy_template(const Client__connected_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.hostname().get_selection()) {
single_value->field_hostname = other_value.hostname();
} else {
single_value->field_hostname.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.portnumber().get_selection()) {
single_value->field_portnumber = other_value.portnumber();
} else {
single_value->field_portnumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Client__connected_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new Client__connected_template(*other_value.implication_.precondition);
implication_.implied_template = new Client__connected_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.Client_connected.");
break;
}
set_selection(other_value);
}

Client__connected_template::Client__connected_template()
{
}

Client__connected_template::Client__connected_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Client__connected_template::Client__connected_template(const Client__connected& other_value)
{
copy_value(other_value);
}

Client__connected_template::Client__connected_template(const OPTIONAL<Client__connected>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Client__connected&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.Client_connected from an unbound optional field.");
}
}

Client__connected_template::Client__connected_template(Client__connected_template* p_precondition, Client__connected_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Client__connected_template::Client__connected_template(Dynamic_Match_Interface<Client__connected>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Client__connected>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Client__connected_template::Client__connected_template(const Client__connected_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Client__connected_template::~Client__connected_template()
{
clean_up();
}

Client__connected_template& Client__connected_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Client__connected_template& Client__connected_template::operator=(const Client__connected& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Client__connected_template& Client__connected_template::operator=(const OPTIONAL<Client__connected>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Client__connected&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.Client_connected.");
}
return *this;
}

Client__connected_template& Client__connected_template::operator=(const Client__connected_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Client__connected_template::match(const Client__connected& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.hostname().is_bound()) return FALSE;
if(!single_value->field_hostname.match(other_value.hostname(), legacy))return FALSE;
if(!other_value.portnumber().is_bound()) return FALSE;
if(!single_value->field_portnumber.match(other_value.portnumber(), legacy))return FALSE;
if(!other_value.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__id(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.Client_connected.");
}
return FALSE;
}

boolean Client__connected_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_hostname.is_bound()
 || single_value->field_portnumber.is_bound()
 || single_value->field_client__id.is_bound();
}

boolean Client__connected_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_hostname.is_value()
 && single_value->field_portnumber.is_value()
 && single_value->field_client__id.is_value();
}

void Client__connected_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

Client__connected Client__connected_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.Client_connected.");
Client__connected ret_val;
if (single_value->field_hostname.is_bound()) {
ret_val.hostname() = single_value->field_hostname.valueof();
}
if (single_value->field_portnumber.is_bound()) {
ret_val.portnumber() = single_value->field_portnumber.valueof();
}
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
return ret_val;
}

void Client__connected_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.Client_connected.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Client__connected_template[list_length];
}

Client__connected_template& Client__connected_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.Client_connected.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.Client_connected.");
return value_list.list_value[list_index];
}

CHARSTRING_template& Client__connected_template::hostname()
{
set_specific();
return single_value->field_hostname;
}

const CHARSTRING_template& Client__connected_template::hostname() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field hostname of a non-specific template of type @HTTPmsg_Types.Client_connected.");
return single_value->field_hostname;
}

INTEGER_template& Client__connected_template::portnumber()
{
set_specific();
return single_value->field_portnumber;
}

const INTEGER_template& Client__connected_template::portnumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field portnumber of a non-specific template of type @HTTPmsg_Types.Client_connected.");
return single_value->field_portnumber;
}

INTEGER_template& Client__connected_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& Client__connected_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @HTTPmsg_Types.Client_connected.");
return single_value->field_client__id;
}

int Client__connected_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Client_connected which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.Client_connected containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Client_connected containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Client_connected containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Client_connected containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Client_connected containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Client_connected containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Client_connected containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Client_connected containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.Client_connected.");
  }
  return 0;
}

void Client__connected_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ hostname := ");
single_value->field_hostname.log();
TTCN_Logger::log_event_str(", portnumber := ");
single_value->field_portnumber.log();
TTCN_Logger::log_event_str(", client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Client__connected_template::log_match(const Client__connected& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_hostname.match(match_value.hostname(), legacy)){
TTCN_Logger::log_logmatch_info(".hostname");
single_value->field_hostname.log_match(match_value.hostname(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_portnumber.match(match_value.portnumber(), legacy)){
TTCN_Logger::log_logmatch_info(".portnumber");
single_value->field_portnumber.log_match(match_value.portnumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ hostname := ");
single_value->field_hostname.log_match(match_value.hostname(), legacy);
TTCN_Logger::log_event_str(", portnumber := ");
single_value->field_portnumber.log_match(match_value.portnumber(), legacy);
TTCN_Logger::log_event_str(", client_id := ");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Client__connected_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (hostname().is_bound()) hostname().set_implicit_omit();
if (portnumber().is_bound()) portnumber().set_implicit_omit();
if (client__id().is_bound()) client__id().set_implicit_omit();
}

void Client__connected_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_hostname.encode_text(text_buf);
single_value->field_portnumber.encode_text(text_buf);
single_value->field_client__id.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.Client_connected.");
}
}

void Client__connected_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_hostname.decode_text(text_buf);
single_value->field_portnumber.decode_text(text_buf);
single_value->field_client__id.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Client__connected_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.Client_connected.");
}
}

void Client__connected_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Client__connected_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.Client_connected has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) portnumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hostname().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          portnumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Client_connected: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Client__connected_template* precondition = new Client__connected_template;
    precondition->set_param(*param.get_elem(0));
    Client__connected_template* implied_template = new Client__connected_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Client__connected_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.Client_connected");
  }
  is_ifpresent = param.get_ifpresent();
}

void Client__connected_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_hostname.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Client_connected");
single_value->field_portnumber.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Client_connected");
single_value->field_client__id.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Client_connected");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.Client_connected");
}

boolean Client__connected_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Client__connected_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

Half__close::Half__close()
{
}

Half__close::Half__close(const OPTIONAL< INTEGER >& par_client__id)
  :   field_client__id(par_client__id)
{
}

Half__close::Half__close(const Half__close& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.Half_close.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
}

void Half__close::clean_up()
{
field_client__id.clean_up();
}

const TTCN_Typedescriptor_t* Half__close::get_descriptor() const { return &Half__close_descr_; }
Half__close& Half__close::operator=(const Half__close& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.Half_close.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
}
return *this;
}

boolean Half__close::operator==(const Half__close& other_value) const
{
return field_client__id==other_value.field_client__id;
}

boolean Half__close::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound());
}
boolean Half__close::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value());
}
int Half__close::size_of() const
{
  int ret_val = 0;
  if (field_client__id.ispresent()) ret_val++;
  return ret_val;
}

void Half__close::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(" }");
}

void Half__close::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
}

void Half__close::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.Half_close has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Half_close: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.Half_close");
  }
}

void Half__close::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
}

void Half__close::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
}

struct Half__close_template::single_value_struct {
INTEGER_template field_client__id;
};

void Half__close_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_client__id = ANY_OR_OMIT;
}
}
}

void Half__close_template::copy_value(const Half__close& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Half__close_template::copy_template(const Half__close_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Half__close_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new Half__close_template(*other_value.implication_.precondition);
implication_.implied_template = new Half__close_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.Half_close.");
break;
}
set_selection(other_value);
}

Half__close_template::Half__close_template()
{
}

Half__close_template::Half__close_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Half__close_template::Half__close_template(const Half__close& other_value)
{
copy_value(other_value);
}

Half__close_template::Half__close_template(const OPTIONAL<Half__close>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Half__close&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.Half_close from an unbound optional field.");
}
}

Half__close_template::Half__close_template(Half__close_template* p_precondition, Half__close_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Half__close_template::Half__close_template(Dynamic_Match_Interface<Half__close>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Half__close>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Half__close_template::Half__close_template(const Half__close_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Half__close_template::~Half__close_template()
{
clean_up();
}

Half__close_template& Half__close_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Half__close_template& Half__close_template::operator=(const Half__close& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Half__close_template& Half__close_template::operator=(const OPTIONAL<Half__close>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Half__close&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.Half_close.");
}
return *this;
}

Half__close_template& Half__close_template::operator=(const Half__close_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Half__close_template::match(const Half__close& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.Half_close.");
}
return FALSE;
}

boolean Half__close_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_bound());
}

boolean Half__close_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_value());
}

void Half__close_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

Half__close Half__close_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.Half_close.");
Half__close ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
return ret_val;
}

void Half__close_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.Half_close.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Half__close_template[list_length];
}

Half__close_template& Half__close_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.Half_close.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.Half_close.");
return value_list.list_value[list_index];
}

INTEGER_template& Half__close_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& Half__close_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @HTTPmsg_Types.Half_close.");
return single_value->field_client__id;
}

int Half__close_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Half_close which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 0;
      if (single_value->field_client__id.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.Half_close containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Half_close containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Half_close containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Half_close containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Half_close containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Half_close containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Half_close containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Half_close containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.Half_close.");
  }
  return 0;
}

void Half__close_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Half__close_template::log_match(const Half__close& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Half__close_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
}

void Half__close_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.Half_close.");
}
}

void Half__close_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_client__id.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Half__close_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.Half_close.");
}
}

void Half__close_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Half__close_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.Half_close has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Half_close: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Half__close_template* precondition = new Half__close_template;
    precondition->set_param(*param.get_elem(0));
    Half__close_template* implied_template = new Half__close_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Half__close_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.Half_close");
  }
  is_ifpresent = param.get_ifpresent();
}

void Half__close_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_client__id.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Half_close");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.Half_close");
}

boolean Half__close_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Half__close_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

Listen::Listen()
{
}

Listen::Listen(const OPTIONAL< CHARSTRING >& par_local__hostname,
    const INTEGER& par_portnumber,
    const BOOLEAN& par_use__ssl)
  :   field_local__hostname(par_local__hostname),
  field_portnumber(par_portnumber),
  field_use__ssl(par_use__ssl)
{
}

Listen::Listen(const Listen& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.Listen.");
if (other_value.local__hostname().is_bound()) field_local__hostname = other_value.local__hostname();
else field_local__hostname.clean_up();
if (other_value.portnumber().is_bound()) field_portnumber = other_value.portnumber();
else field_portnumber.clean_up();
if (other_value.use__ssl().is_bound()) field_use__ssl = other_value.use__ssl();
else field_use__ssl.clean_up();
}

void Listen::clean_up()
{
field_local__hostname.clean_up();
field_portnumber.clean_up();
field_use__ssl.clean_up();
}

const TTCN_Typedescriptor_t* Listen::get_descriptor() const { return &Listen_descr_; }
Listen& Listen::operator=(const Listen& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.Listen.");
  if (other_value.local__hostname().is_bound()) field_local__hostname = other_value.local__hostname();
  else field_local__hostname.clean_up();
  if (other_value.portnumber().is_bound()) field_portnumber = other_value.portnumber();
  else field_portnumber.clean_up();
  if (other_value.use__ssl().is_bound()) field_use__ssl = other_value.use__ssl();
  else field_use__ssl.clean_up();
}
return *this;
}

boolean Listen::operator==(const Listen& other_value) const
{
return field_local__hostname==other_value.field_local__hostname
  && field_portnumber==other_value.field_portnumber
  && field_use__ssl==other_value.field_use__ssl;
}

boolean Listen::is_bound() const
{
return (OPTIONAL_OMIT == field_local__hostname.get_selection() || field_local__hostname.is_bound())
  || (field_portnumber.is_bound())
  || (field_use__ssl.is_bound());
}
boolean Listen::is_value() const
{
return (OPTIONAL_OMIT == field_local__hostname.get_selection() || field_local__hostname.is_value())
  && field_portnumber.is_value()
  && field_use__ssl.is_value();
}
int Listen::size_of() const
{
  int ret_val = 2;
  if (field_local__hostname.ispresent()) ret_val++;
  return ret_val;
}

void Listen::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ local_hostname := ");
field_local__hostname.log();
TTCN_Logger::log_event_str(", portnumber := ");
field_portnumber.log();
TTCN_Logger::log_event_str(", use_ssl := ");
field_use__ssl.log();
TTCN_Logger::log_event_str(" }");
}

void Listen::set_implicit_omit()
{
if (!local__hostname().is_bound()) local__hostname() = OMIT_VALUE;
else local__hostname().set_implicit_omit();
if (portnumber().is_bound()) portnumber().set_implicit_omit();
if (use__ssl().is_bound()) use__ssl().set_implicit_omit();
}

void Listen::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.Listen has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) local__hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) portnumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) use__ssl().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "local_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__hostname().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          portnumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "use_ssl")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          use__ssl().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Listen: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.Listen");
  }
}

void Listen::encode_text(Text_Buf& text_buf) const
{
field_local__hostname.encode_text(text_buf);
field_portnumber.encode_text(text_buf);
field_use__ssl.encode_text(text_buf);
}

void Listen::decode_text(Text_Buf& text_buf)
{
field_local__hostname.decode_text(text_buf);
field_portnumber.decode_text(text_buf);
field_use__ssl.decode_text(text_buf);
}

struct Listen_template::single_value_struct {
CHARSTRING_template field_local__hostname;
INTEGER_template field_portnumber;
BOOLEAN_template field_use__ssl;
};

void Listen_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_local__hostname = ANY_OR_OMIT;
single_value->field_portnumber = ANY_VALUE;
single_value->field_use__ssl = ANY_VALUE;
}
}
}

void Listen_template::copy_value(const Listen& other_value)
{
single_value = new single_value_struct;
if (other_value.local__hostname().is_bound()) {
  if (other_value.local__hostname().ispresent()) single_value->field_local__hostname = other_value.local__hostname()();
  else single_value->field_local__hostname = OMIT_VALUE;
} else {
  single_value->field_local__hostname.clean_up();
}
if (other_value.portnumber().is_bound()) {
  single_value->field_portnumber = other_value.portnumber();
} else {
  single_value->field_portnumber.clean_up();
}
if (other_value.use__ssl().is_bound()) {
  single_value->field_use__ssl = other_value.use__ssl();
} else {
  single_value->field_use__ssl.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Listen_template::copy_template(const Listen_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.local__hostname().get_selection()) {
single_value->field_local__hostname = other_value.local__hostname();
} else {
single_value->field_local__hostname.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.portnumber().get_selection()) {
single_value->field_portnumber = other_value.portnumber();
} else {
single_value->field_portnumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.use__ssl().get_selection()) {
single_value->field_use__ssl = other_value.use__ssl();
} else {
single_value->field_use__ssl.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Listen_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new Listen_template(*other_value.implication_.precondition);
implication_.implied_template = new Listen_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.Listen.");
break;
}
set_selection(other_value);
}

Listen_template::Listen_template()
{
}

Listen_template::Listen_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Listen_template::Listen_template(const Listen& other_value)
{
copy_value(other_value);
}

Listen_template::Listen_template(const OPTIONAL<Listen>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Listen&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.Listen from an unbound optional field.");
}
}

Listen_template::Listen_template(Listen_template* p_precondition, Listen_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Listen_template::Listen_template(Dynamic_Match_Interface<Listen>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Listen>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Listen_template::Listen_template(const Listen_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Listen_template::~Listen_template()
{
clean_up();
}

Listen_template& Listen_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Listen_template& Listen_template::operator=(const Listen& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Listen_template& Listen_template::operator=(const OPTIONAL<Listen>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Listen&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.Listen.");
}
return *this;
}

Listen_template& Listen_template::operator=(const Listen_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Listen_template::match(const Listen& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.local__hostname().is_bound()) return FALSE;
if((other_value.local__hostname().ispresent() ? !single_value->field_local__hostname.match((const CHARSTRING&)other_value.local__hostname(), legacy) : !single_value->field_local__hostname.match_omit(legacy)))return FALSE;
if(!other_value.portnumber().is_bound()) return FALSE;
if(!single_value->field_portnumber.match(other_value.portnumber(), legacy))return FALSE;
if(!other_value.use__ssl().is_bound()) return FALSE;
if(!single_value->field_use__ssl.match(other_value.use__ssl(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.Listen.");
}
return FALSE;
}

boolean Listen_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_local__hostname.is_omit() || single_value->field_local__hostname.is_bound())
 || single_value->field_portnumber.is_bound()
 || single_value->field_use__ssl.is_bound();
}

boolean Listen_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_local__hostname.is_omit() || single_value->field_local__hostname.is_value())
 && single_value->field_portnumber.is_value()
 && single_value->field_use__ssl.is_value();
}

void Listen_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

Listen Listen_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.Listen.");
Listen ret_val;
if (single_value->field_local__hostname.is_omit()) ret_val.local__hostname() = OMIT_VALUE;
else if (single_value->field_local__hostname.is_bound()) {
ret_val.local__hostname() = single_value->field_local__hostname.valueof();
}
if (single_value->field_portnumber.is_bound()) {
ret_val.portnumber() = single_value->field_portnumber.valueof();
}
if (single_value->field_use__ssl.is_bound()) {
ret_val.use__ssl() = single_value->field_use__ssl.valueof();
}
return ret_val;
}

void Listen_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.Listen.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Listen_template[list_length];
}

Listen_template& Listen_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.Listen.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.Listen.");
return value_list.list_value[list_index];
}

CHARSTRING_template& Listen_template::local__hostname()
{
set_specific();
return single_value->field_local__hostname;
}

const CHARSTRING_template& Listen_template::local__hostname() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_hostname of a non-specific template of type @HTTPmsg_Types.Listen.");
return single_value->field_local__hostname;
}

INTEGER_template& Listen_template::portnumber()
{
set_specific();
return single_value->field_portnumber;
}

const INTEGER_template& Listen_template::portnumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field portnumber of a non-specific template of type @HTTPmsg_Types.Listen.");
return single_value->field_portnumber;
}

BOOLEAN_template& Listen_template::use__ssl()
{
set_specific();
return single_value->field_use__ssl;
}

const BOOLEAN_template& Listen_template::use__ssl() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field use_ssl of a non-specific template of type @HTTPmsg_Types.Listen.");
return single_value->field_use__ssl;
}

int Listen_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_local__hostname.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.Listen.");
  }
  return 0;
}

void Listen_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ local_hostname := ");
single_value->field_local__hostname.log();
TTCN_Logger::log_event_str(", portnumber := ");
single_value->field_portnumber.log();
TTCN_Logger::log_event_str(", use_ssl := ");
single_value->field_use__ssl.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Listen_template::log_match(const Listen& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.local__hostname().ispresent()){
if(!single_value->field_local__hostname.match(match_value.local__hostname(), legacy)){
TTCN_Logger::log_logmatch_info(".local_hostname");
single_value->field_local__hostname.log_match(match_value.local__hostname(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_local__hostname.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".local_hostname := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_local__hostname.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_portnumber.match(match_value.portnumber(), legacy)){
TTCN_Logger::log_logmatch_info(".portnumber");
single_value->field_portnumber.log_match(match_value.portnumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_use__ssl.match(match_value.use__ssl(), legacy)){
TTCN_Logger::log_logmatch_info(".use_ssl");
single_value->field_use__ssl.log_match(match_value.use__ssl(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ local_hostname := ");
if (match_value.local__hostname().ispresent()) {
single_value->field_local__hostname.log_match(match_value.local__hostname(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_local__hostname.log();
if (single_value->field_local__hostname.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", portnumber := ");
single_value->field_portnumber.log_match(match_value.portnumber(), legacy);
TTCN_Logger::log_event_str(", use_ssl := ");
single_value->field_use__ssl.log_match(match_value.use__ssl(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Listen_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!local__hostname().is_bound()) local__hostname() = OMIT_VALUE;
else local__hostname().set_implicit_omit();
if (portnumber().is_bound()) portnumber().set_implicit_omit();
if (use__ssl().is_bound()) use__ssl().set_implicit_omit();
}

void Listen_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_local__hostname.encode_text(text_buf);
single_value->field_portnumber.encode_text(text_buf);
single_value->field_use__ssl.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.Listen.");
}
}

void Listen_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_local__hostname.decode_text(text_buf);
single_value->field_portnumber.decode_text(text_buf);
single_value->field_use__ssl.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Listen_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.Listen.");
}
}

void Listen_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Listen_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.Listen has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) local__hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) portnumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) use__ssl().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "local_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__hostname().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          portnumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "use_ssl")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          use__ssl().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Listen: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Listen_template* precondition = new Listen_template;
    precondition->set_param(*param.get_elem(0));
    Listen_template* implied_template = new Listen_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Listen_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.Listen");
  }
  is_ifpresent = param.get_ifpresent();
}

void Listen_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_local__hostname.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Listen");
single_value->field_portnumber.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Listen");
single_value->field_use__ssl.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Listen");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.Listen");
}

boolean Listen_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Listen_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

Listen__result::Listen__result()
{
}

Listen__result::Listen__result(const INTEGER& par_portnumber)
  :   field_portnumber(par_portnumber)
{
}

Listen__result::Listen__result(const Listen__result& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.Listen_result.");
if (other_value.portnumber().is_bound()) field_portnumber = other_value.portnumber();
else field_portnumber.clean_up();
}

void Listen__result::clean_up()
{
field_portnumber.clean_up();
}

const TTCN_Typedescriptor_t* Listen__result::get_descriptor() const { return &Listen__result_descr_; }
Listen__result& Listen__result::operator=(const Listen__result& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.Listen_result.");
  if (other_value.portnumber().is_bound()) field_portnumber = other_value.portnumber();
  else field_portnumber.clean_up();
}
return *this;
}

boolean Listen__result::operator==(const Listen__result& other_value) const
{
return field_portnumber==other_value.field_portnumber;
}

boolean Listen__result::is_bound() const
{
return (field_portnumber.is_bound());
}
boolean Listen__result::is_value() const
{
return field_portnumber.is_value();
}
void Listen__result::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ portnumber := ");
field_portnumber.log();
TTCN_Logger::log_event_str(" }");
}

void Listen__result::set_implicit_omit()
{
if (portnumber().is_bound()) portnumber().set_implicit_omit();
}

void Listen__result::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.Listen_result has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) portnumber().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          portnumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Listen_result: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.Listen_result");
  }
}

void Listen__result::encode_text(Text_Buf& text_buf) const
{
field_portnumber.encode_text(text_buf);
}

void Listen__result::decode_text(Text_Buf& text_buf)
{
field_portnumber.decode_text(text_buf);
}

struct Listen__result_template::single_value_struct {
INTEGER_template field_portnumber;
};

void Listen__result_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_portnumber = ANY_VALUE;
}
}
}

void Listen__result_template::copy_value(const Listen__result& other_value)
{
single_value = new single_value_struct;
if (other_value.portnumber().is_bound()) {
  single_value->field_portnumber = other_value.portnumber();
} else {
  single_value->field_portnumber.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Listen__result_template::copy_template(const Listen__result_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.portnumber().get_selection()) {
single_value->field_portnumber = other_value.portnumber();
} else {
single_value->field_portnumber.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Listen__result_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new Listen__result_template(*other_value.implication_.precondition);
implication_.implied_template = new Listen__result_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.Listen_result.");
break;
}
set_selection(other_value);
}

Listen__result_template::Listen__result_template()
{
}

Listen__result_template::Listen__result_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Listen__result_template::Listen__result_template(const Listen__result& other_value)
{
copy_value(other_value);
}

Listen__result_template::Listen__result_template(const OPTIONAL<Listen__result>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Listen__result&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.Listen_result from an unbound optional field.");
}
}

Listen__result_template::Listen__result_template(Listen__result_template* p_precondition, Listen__result_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Listen__result_template::Listen__result_template(Dynamic_Match_Interface<Listen__result>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Listen__result>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Listen__result_template::Listen__result_template(const Listen__result_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Listen__result_template::~Listen__result_template()
{
clean_up();
}

Listen__result_template& Listen__result_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Listen__result_template& Listen__result_template::operator=(const Listen__result& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Listen__result_template& Listen__result_template::operator=(const OPTIONAL<Listen__result>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Listen__result&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.Listen_result.");
}
return *this;
}

Listen__result_template& Listen__result_template::operator=(const Listen__result_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Listen__result_template::match(const Listen__result& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.portnumber().is_bound()) return FALSE;
if(!single_value->field_portnumber.match(other_value.portnumber(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.Listen_result.");
}
return FALSE;
}

boolean Listen__result_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_portnumber.is_bound();
}

boolean Listen__result_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_portnumber.is_value();
}

void Listen__result_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

Listen__result Listen__result_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.Listen_result.");
Listen__result ret_val;
if (single_value->field_portnumber.is_bound()) {
ret_val.portnumber() = single_value->field_portnumber.valueof();
}
return ret_val;
}

void Listen__result_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.Listen_result.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Listen__result_template[list_length];
}

Listen__result_template& Listen__result_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.Listen_result.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.Listen_result.");
return value_list.list_value[list_index];
}

INTEGER_template& Listen__result_template::portnumber()
{
set_specific();
return single_value->field_portnumber;
}

const INTEGER_template& Listen__result_template::portnumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field portnumber of a non-specific template of type @HTTPmsg_Types.Listen_result.");
return single_value->field_portnumber;
}

int Listen__result_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen_result which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen_result containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen_result containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen_result containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen_result containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen_result containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen_result containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen_result containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Listen_result containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.Listen_result.");
  }
  return 0;
}

void Listen__result_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ portnumber := ");
single_value->field_portnumber.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Listen__result_template::log_match(const Listen__result& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_portnumber.match(match_value.portnumber(), legacy)){
TTCN_Logger::log_logmatch_info(".portnumber");
single_value->field_portnumber.log_match(match_value.portnumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ portnumber := ");
single_value->field_portnumber.log_match(match_value.portnumber(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Listen__result_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (portnumber().is_bound()) portnumber().set_implicit_omit();
}

void Listen__result_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_portnumber.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.Listen_result.");
}
}

void Listen__result_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_portnumber.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Listen__result_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.Listen_result.");
}
}

void Listen__result_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Listen__result_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.Listen_result has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) portnumber().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          portnumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Listen_result: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Listen__result_template* precondition = new Listen__result_template;
    precondition->set_param(*param.get_elem(0));
    Listen__result_template* implied_template = new Listen__result_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Listen__result_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.Listen_result");
  }
  is_ifpresent = param.get_ifpresent();
}

void Listen__result_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_portnumber.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Listen_result");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.Listen_result");
}

boolean Listen__result_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Listen__result_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

Shutdown::Shutdown()
{
bound_flag = FALSE;
}

Shutdown::Shutdown(null_type)
{
bound_flag = TRUE;
}

Shutdown::Shutdown(const Shutdown& other_value)
{
other_value.must_bound("Copying an unbound value of type @HTTPmsg_Types.Shutdown.");
bound_flag = TRUE;
}

Shutdown& Shutdown::operator=(null_type)
{
bound_flag = TRUE;
return *this;
}

Shutdown& Shutdown::operator=(const Shutdown& other_value)
{
other_value.must_bound("Assignment of an unbound value of type @HTTPmsg_Types.Shutdown.");
bound_flag = TRUE;
return *this;
}

boolean Shutdown::operator==(null_type) const
{
must_bound("Comparison of an unbound value of type @HTTPmsg_Types.Shutdown.");
return TRUE;
}

boolean Shutdown::operator==(const Shutdown& other_value) const
{
must_bound("Comparison of an unbound value of type @HTTPmsg_Types.Shutdown.");
other_value.must_bound("Comparison of an unbound value of type @HTTPmsg_Types.Shutdown.");
return TRUE;
}

void Shutdown::log() const
{
if (bound_flag) TTCN_Logger::log_event_str("{ }");
else TTCN_Logger::log_event_unbound();
}

void Shutdown::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "empty record/set value (i.e. { })");
  if (param.get_type()!=Module_Param::MP_Value_List || param.get_size()>0) {
    param.type_error("empty record/set value (i.e. { })", "@HTTPmsg_Types.Shutdown");
  }
  bound_flag = TRUE;
}

void Shutdown::encode_text(Text_Buf& /*text_buf*/) const
{
must_bound("Text encoder: Encoding an unbound value of type @HTTPmsg_Types.Shutdown.");
}

void Shutdown::decode_text(Text_Buf& /*text_buf*/)
{
bound_flag = TRUE;
}

void Shutdown_template::copy_template(const Shutdown_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Shutdown_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new Shutdown_template(*other_value.implication_.precondition);
implication_.implied_template = new Shutdown_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.Shutdown.");
break;
}
}

Shutdown_template::Shutdown_template()
{
}

Shutdown_template::Shutdown_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Shutdown_template::Shutdown_template(null_type)
 : Base_Template(SPECIFIC_VALUE)
{
}

Shutdown_template::Shutdown_template(const Shutdown& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
other_value.must_bound("Creating a template from an unbound value of type @HTTPmsg_Types.Shutdown.");
}

Shutdown_template::Shutdown_template(const OPTIONAL<Shutdown>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.Shutdown from an unbound optional field.");
}
}

Shutdown_template::Shutdown_template(Shutdown_template* p_precondition, Shutdown_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Shutdown_template::Shutdown_template(Dynamic_Match_Interface<Shutdown>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Shutdown>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Shutdown_template::Shutdown_template(const Shutdown_template& other_value)
: Base_Template(){
copy_template(other_value);
}

Shutdown_template::~Shutdown_template()
{
clean_up();
}

void Shutdown_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

Shutdown_template& Shutdown_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Shutdown_template& Shutdown_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
return *this;
}

Shutdown_template& Shutdown_template::operator=(const Shutdown& other_value)
{
other_value.must_bound("Assignment of an unbound value of type @HTTPmsg_Types.Shutdown to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
return *this;
}

Shutdown_template& Shutdown_template::operator=(const OPTIONAL<Shutdown>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.Shutdown.");
}
return *this;
}

Shutdown_template& Shutdown_template::operator=(const Shutdown_template& other_value)
{
if (&other_value != this) {
clean_up();
set_selection(other_value);
}
return *this;
}

boolean Shutdown_template::match(null_type other_value,boolean) const
{
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
return TRUE;
case OMIT_VALUE:
return FALSE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.Shutdown.");
}
return FALSE;
}

boolean Shutdown_template::match(const Shutdown& other_value, boolean) const
{
if (!other_value.is_bound()) return FALSE;
return match(NULL_VALUE);
}

Shutdown Shutdown_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.Shutdown.");
return NULL_VALUE;
}

void Shutdown_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.Shutdown.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Shutdown_template[list_length];
}

Shutdown_template& Shutdown_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.Shutdown.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.Shutdown.");
return value_list.list_value[list_index];
}

void Shutdown_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Shutdown_template::log_match(const Shutdown& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void Shutdown_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.Shutdown.");
}
}

void Shutdown_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Shutdown_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.Shutdown.");
}
}

void Shutdown_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "empty record/set template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Shutdown_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Value_List:
    if (param.get_size()>0) param.type_error("empty record/set template", "@HTTPmsg_Types.Shutdown");
    *this = NULL_VALUE;
    break;
  case Module_Param::MP_Implication_Template: {
    Shutdown_template* precondition = new Shutdown_template;
    precondition->set_param(*param.get_elem(0));
    Shutdown_template* implied_template = new Shutdown_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Shutdown_template(precondition, implied_template);
  } break;
  default:
    param.type_error("empty record/set template", "@HTTPmsg_Types.Shutdown");
  }
  is_ifpresent = param.get_ifpresent();
}

void Shutdown_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.Shutdown");
}

boolean Shutdown_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Shutdown_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

Send__failed::Send__failed()
{
}

Send__failed::Send__failed(const HTTPMessage& par_msg,
    const BOOLEAN& par_already__half__closed)
  :   field_msg(par_msg),
  field_already__half__closed(par_already__half__closed)
{
}

Send__failed::Send__failed(const Send__failed& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTPmsg_Types.Send_failed.");
if (other_value.msg().is_bound()) field_msg = other_value.msg();
else field_msg.clean_up();
if (other_value.already__half__closed().is_bound()) field_already__half__closed = other_value.already__half__closed();
else field_already__half__closed.clean_up();
}

void Send__failed::clean_up()
{
field_msg.clean_up();
field_already__half__closed.clean_up();
}

const TTCN_Typedescriptor_t* Send__failed::get_descriptor() const { return &Send__failed_descr_; }
Send__failed& Send__failed::operator=(const Send__failed& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTPmsg_Types.Send_failed.");
  if (other_value.msg().is_bound()) field_msg = other_value.msg();
  else field_msg.clean_up();
  if (other_value.already__half__closed().is_bound()) field_already__half__closed = other_value.already__half__closed();
  else field_already__half__closed.clean_up();
}
return *this;
}

boolean Send__failed::operator==(const Send__failed& other_value) const
{
return field_msg==other_value.field_msg
  && field_already__half__closed==other_value.field_already__half__closed;
}

boolean Send__failed::is_bound() const
{
return (field_msg.is_bound())
  || (field_already__half__closed.is_bound());
}
boolean Send__failed::is_value() const
{
return field_msg.is_value()
  && field_already__half__closed.is_value();
}
void Send__failed::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ msg := ");
field_msg.log();
TTCN_Logger::log_event_str(", already_half_closed := ");
field_already__half__closed.log();
TTCN_Logger::log_event_str(" }");
}

void Send__failed::set_implicit_omit()
{
if (msg().is_bound()) msg().set_implicit_omit();
if (already__half__closed().is_bound()) already__half__closed().set_implicit_omit();
}

void Send__failed::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @HTTPmsg_Types.Send_failed has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) msg().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) already__half__closed().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "already_half_closed")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          already__half__closed().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Send_failed: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTPmsg_Types.Send_failed");
  }
}

void Send__failed::encode_text(Text_Buf& text_buf) const
{
field_msg.encode_text(text_buf);
field_already__half__closed.encode_text(text_buf);
}

void Send__failed::decode_text(Text_Buf& text_buf)
{
field_msg.decode_text(text_buf);
field_already__half__closed.decode_text(text_buf);
}

struct Send__failed_template::single_value_struct {
HTTPMessage_template field_msg;
BOOLEAN_template field_already__half__closed;
};

void Send__failed_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_msg = ANY_VALUE;
single_value->field_already__half__closed = ANY_VALUE;
}
}
}

void Send__failed_template::copy_value(const Send__failed& other_value)
{
single_value = new single_value_struct;
if (other_value.msg().is_bound()) {
  single_value->field_msg = other_value.msg();
} else {
  single_value->field_msg.clean_up();
}
if (other_value.already__half__closed().is_bound()) {
  single_value->field_already__half__closed = other_value.already__half__closed();
} else {
  single_value->field_already__half__closed.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Send__failed_template::copy_template(const Send__failed_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.msg().get_selection()) {
single_value->field_msg = other_value.msg();
} else {
single_value->field_msg.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.already__half__closed().get_selection()) {
single_value->field_already__half__closed = other_value.already__half__closed();
} else {
single_value->field_already__half__closed.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Send__failed_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new Send__failed_template(*other_value.implication_.precondition);
implication_.implied_template = new Send__failed_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTPmsg_Types.Send_failed.");
break;
}
set_selection(other_value);
}

Send__failed_template::Send__failed_template()
{
}

Send__failed_template::Send__failed_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Send__failed_template::Send__failed_template(const Send__failed& other_value)
{
copy_value(other_value);
}

Send__failed_template::Send__failed_template(const OPTIONAL<Send__failed>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Send__failed&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTPmsg_Types.Send_failed from an unbound optional field.");
}
}

Send__failed_template::Send__failed_template(Send__failed_template* p_precondition, Send__failed_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Send__failed_template::Send__failed_template(Dynamic_Match_Interface<Send__failed>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Send__failed>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Send__failed_template::Send__failed_template(const Send__failed_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Send__failed_template::~Send__failed_template()
{
clean_up();
}

Send__failed_template& Send__failed_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Send__failed_template& Send__failed_template::operator=(const Send__failed& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Send__failed_template& Send__failed_template::operator=(const OPTIONAL<Send__failed>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Send__failed&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTPmsg_Types.Send_failed.");
}
return *this;
}

Send__failed_template& Send__failed_template::operator=(const Send__failed_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Send__failed_template::match(const Send__failed& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.msg().is_bound()) return FALSE;
if(!single_value->field_msg.match(other_value.msg(), legacy))return FALSE;
if(!other_value.already__half__closed().is_bound()) return FALSE;
if(!single_value->field_already__half__closed.match(other_value.already__half__closed(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTPmsg_Types.Send_failed.");
}
return FALSE;
}

boolean Send__failed_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_msg.is_bound()
 || single_value->field_already__half__closed.is_bound();
}

boolean Send__failed_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_msg.is_value()
 && single_value->field_already__half__closed.is_value();
}

void Send__failed_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

Send__failed Send__failed_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTPmsg_Types.Send_failed.");
Send__failed ret_val;
if (single_value->field_msg.is_bound()) {
ret_val.msg() = single_value->field_msg.valueof();
}
if (single_value->field_already__half__closed.is_bound()) {
ret_val.already__half__closed() = single_value->field_already__half__closed.valueof();
}
return ret_val;
}

void Send__failed_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTPmsg_Types.Send_failed.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Send__failed_template[list_length];
}

Send__failed_template& Send__failed_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTPmsg_Types.Send_failed.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTPmsg_Types.Send_failed.");
return value_list.list_value[list_index];
}

HTTPMessage_template& Send__failed_template::msg()
{
set_specific();
return single_value->field_msg;
}

const HTTPMessage_template& Send__failed_template::msg() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msg of a non-specific template of type @HTTPmsg_Types.Send_failed.");
return single_value->field_msg;
}

BOOLEAN_template& Send__failed_template::already__half__closed()
{
set_specific();
return single_value->field_already__half__closed;
}

const BOOLEAN_template& Send__failed_template::already__half__closed() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field already_half_closed of a non-specific template of type @HTTPmsg_Types.Send_failed.");
return single_value->field_already__half__closed;
}

int Send__failed_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Send_failed which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTPmsg_Types.Send_failed containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Send_failed containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Send_failed containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Send_failed containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Send_failed containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Send_failed containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Send_failed containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTPmsg_Types.Send_failed containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTPmsg_Types.Send_failed.");
  }
  return 0;
}

void Send__failed_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ msg := ");
single_value->field_msg.log();
TTCN_Logger::log_event_str(", already_half_closed := ");
single_value->field_already__half__closed.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Send__failed_template::log_match(const Send__failed& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_msg.match(match_value.msg(), legacy)){
TTCN_Logger::log_logmatch_info(".msg");
single_value->field_msg.log_match(match_value.msg(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_already__half__closed.match(match_value.already__half__closed(), legacy)){
TTCN_Logger::log_logmatch_info(".already_half_closed");
single_value->field_already__half__closed.log_match(match_value.already__half__closed(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ msg := ");
single_value->field_msg.log_match(match_value.msg(), legacy);
TTCN_Logger::log_event_str(", already_half_closed := ");
single_value->field_already__half__closed.log_match(match_value.already__half__closed(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Send__failed_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (msg().is_bound()) msg().set_implicit_omit();
if (already__half__closed().is_bound()) already__half__closed().set_implicit_omit();
}

void Send__failed_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_msg.encode_text(text_buf);
single_value->field_already__half__closed.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTPmsg_Types.Send_failed.");
}
}

void Send__failed_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_msg.decode_text(text_buf);
single_value->field_already__half__closed.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Send__failed_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTPmsg_Types.Send_failed.");
}
}

void Send__failed_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Send__failed_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @HTTPmsg_Types.Send_failed has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) msg().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) already__half__closed().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "already_half_closed")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          already__half__closed().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTPmsg_Types.Send_failed: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Send__failed_template* precondition = new Send__failed_template;
    precondition->set_param(*param.get_elem(0));
    Send__failed_template* implied_template = new Send__failed_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Send__failed_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTPmsg_Types.Send_failed");
  }
  is_ifpresent = param.get_ifpresent();
}

void Send__failed_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_msg.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Send_failed");
single_value->field_already__half__closed.check_restriction(t_res, t_name ? t_name : "@HTTPmsg_Types.Send_failed");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTPmsg_Types.Send_failed");
}

boolean Send__failed_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Send__failed_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


/* Bodies of functions, altsteps and testcases */

boolean operator==(null_type, const HeaderLines& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @HTTPmsg_Types.HeaderLines.");
return other_value.val_ptr->n_elements == 0;
}

boolean operator==(null_type, const Shutdown& other_value)
{
other_value.must_bound("Comparison of an unbound value of type @HTTPmsg_Types.Shutdown.");
return TRUE;
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("HTTPmsg_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "HTTPmsg_Types");
current_location.update_lineno(25);
/* HTTPmsg_Types.ttcn, line 25 */
modulepar_tsp__socket__debugging = FALSE;
module_object.add_modulepar("tsp_socket_debugging");
current_location.update_lineno(26);
/* HTTPmsg_Types.ttcn, line 26 */
modulepar_crlf__mode = strict__crlf__mode::WARNING__ONCE;
module_object.add_modulepar("crlf_mode");
module_object.add_function("enc_HTTPMessage", (genericfunc_t)&enc__HTTPMessage, NULL);
module_object.add_function("dec_HTTPMessage", (genericfunc_t)&dec__HTTPMessage, NULL);
}

void post_init_module()
{
TTCN_Location current_location("HTTPmsg_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "HTTPmsg_Types");
current_location.update_lineno(30);
/* HTTPmsg_Types.ttcn, line 30 */
const_dec__HTTPMessage_socket__debugging_defval = tsp__socket__debugging;
}

boolean set_module_param(Module_Param& param)
{
const char* const par_name = param.get_id()->get_current_name();
if (!strcmp(par_name, "tsp_socket_debugging")) {
modulepar_tsp__socket__debugging.set_param(param);
return TRUE;
} else if (!strcmp(par_name, "crlf_mode")) {
modulepar_crlf__mode.set_param(param);
return TRUE;
} else return FALSE;
}

void log_module_param()
{
TTCN_Logger::log_event_str("tsp_socket_debugging := ");
tsp__socket__debugging.log();
TTCN_Logger::log_event_str(", crlf_mode := ");
crlf__mode.log();
}


} /* end of namespace */
