// 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 "BTS_Tests_VAMOS.hh"

namespace BTS__Tests__VAMOS {

/* Literal string constants */

extern const CHARSTRING cs_0(20, "BTS_Tests_VAMOS.ttcn"),
cs_1(19, "Rx MODE MODIFY NACK"),
cs_2(38, "Timeout waiting for MODE MODIFY (N)ACK");
const unsigned char module_checksum[] = { 0xda, 0xdb, 0x6f, 0x04, 0x23, 0xa0, 0xa2, 0x25, 0xcd, 0xb7, 0x29, 0x09, 0x46, 0x05, 0xa8, 0x91 };

/* Global variable definitions */

// No XER for ChanNrModeTest
const TTCN_Typedescriptor_t ChanNrModeTest_descr_ = { "@BTS_Tests_VAMOS.ChanNrModeTest", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &ChanNrModeSet_descr_, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ChanNrModeSet
const TTCN_Typedescriptor_t ChanNrModeSet_descr_ = { "@BTS_Tests_VAMOS.ChanNrModeSet", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &ChanNrMode_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ChanNrMode_chan__nr_default_coding("RAW");
UNIVERSAL_CHARSTRING ChanNrMode_chan__mode_default_coding("RAW");
// No XER for ChanNrMode
const TTCN_Typedescriptor_t ChanNrMode_descr_ = { "@BTS_Tests_VAMOS.ChanNrMode", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
RSL__Types::RSL__IE_template template_ts__RSL__IE__OsmoTSC;
const RSL__Types::RSL__IE_template& ts__RSL__IE__OsmoTSC = template_ts__RSL__IE__OsmoTSC;
TTCN_Module module_object("BTS_Tests_VAMOS", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, start_ptc_function, module_control_part);

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 */


const ChanNrModeSet ChanNrModeTest::UNBOUND_ELEM;
ChanNrModeTest::ChanNrModeTest()
{
val_ptr = NULL;
}

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

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

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

void ChanNrModeTest::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.");
}
}

ChanNrModeTest& ChanNrModeTest::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;
}

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

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

boolean ChanNrModeTest::operator==(const ChanNrModeTest& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
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;
}

ChanNrModeSet& ChanNrModeTest::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests_VAMOS.ChanNrModeTest 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 = (ChanNrModeSet**)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 ChanNrModeSet(*(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 ChanNrModeSet;
}
return *val_ptr->value_elements[index_value];
}

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

const ChanNrModeSet& ChanNrModeTest::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests_VAMOS.ChanNrModeTest using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests_VAMOS.ChanNrModeTest: 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 ChanNrModeSet& ChanNrModeTest::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
return (*this)[(int)index_value];
}

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

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

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

ChanNrModeTest ChanNrModeTest::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
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;
ChanNrModeTest 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 ChanNrModeSet(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

ChanNrModeTest ChanNrModeTest::operator+(const ChanNrModeTest& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests_VAMOS.ChanNrModeTest concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
ChanNrModeTest 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 ChanNrModeSet(*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 ChanNrModeSet(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

ChanNrModeTest ChanNrModeTest::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests_VAMOS.ChanNrModeTest","element");
ChanNrModeTest 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 ChanNrModeSet(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

ChanNrModeTest ChanNrModeTest::replace(int index, int len, const ChanNrModeTest& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests_VAMOS.ChanNrModeTest","element");
ChanNrModeTest 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 ChanNrModeSet(*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 ChanNrModeSet(*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 ChanNrModeSet(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

ChanNrModeTest ChanNrModeTest::replace(int index, int len, const ChanNrModeTest_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 ChanNrModeTest::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
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 = (ChanNrModeSet**)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 ChanNrModeSet(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (ChanNrModeSet**)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 @BTS_Tests_VAMOS.ChanNrModeTest: %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 = (ChanNrModeSet**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean ChanNrModeTest::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 ChanNrModeTest::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
return val_ptr->n_elements;
}

int ChanNrModeTest::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
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 ChanNrModeTest::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 ChanNrModeTest::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 ChanNrModeTest::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", "@BTS_Tests_VAMOS.ChanNrModeTest");
    }
    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", "@BTS_Tests_VAMOS.ChanNrModeTest");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void ChanNrModeTest::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
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 ChanNrModeTest::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 @BTS_Tests_VAMOS.ChanNrModeTest.");
val_ptr->value_elements = (ChanNrModeSet**)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 ChanNrModeSet;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void ChanNrModeTest_template::copy_value(const ChanNrModeTest& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests_VAMOS.ChanNrModeTest with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (ChanNrModeSet_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 ChanNrModeSet_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new ChanNrModeSet_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void ChanNrModeTest_template::copy_template(const ChanNrModeTest_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 = (ChanNrModeSet_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 ChanNrModeSet_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new ChanNrModeSet_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 ChanNrModeTest_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 ChanNrModeTest_template(*other_value.implication_.precondition);
implication_.implied_template = new ChanNrModeTest_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 @BTS_Tests_VAMOS.ChanNrModeTest.");
break;
}
set_selection(other_value);
}

boolean ChanNrModeTest_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 ChanNrModeTest_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const ChanNrModeTest*)value_ptr)[value_index], legacy);
else return ((const ChanNrModeTest_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

ChanNrModeTest_template::ChanNrModeTest_template()
{
}

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

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

ChanNrModeTest_template::ChanNrModeTest_template(const ChanNrModeTest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void ChanNrModeTest_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;
}

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

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

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

ChanNrModeTest_template& ChanNrModeTest_template::operator=(const OPTIONAL<ChanNrModeTest>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ChanNrModeTest&)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 @BTS_Tests_VAMOS.ChanNrModeTest.");
}
return *this;
}

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

ChanNrModeSet_template& ChanNrModeTest_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests_VAMOS.ChanNrModeTest 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 @BTS_Tests_VAMOS.ChanNrModeTest.");
    break;
}
return *single_value.value_elements[index_value];
}

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

const ChanNrModeSet_template& ChanNrModeTest_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests_VAMOS.ChanNrModeTest using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests_VAMOS.ChanNrModeTest.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests_VAMOS.ChanNrModeTest: 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 ChanNrModeSet_template& ChanNrModeTest_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests_VAMOS.ChanNrModeTest.");
return (*this)[(int)index_value];
}

void ChanNrModeTest_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests_VAMOS.ChanNrModeTest.");
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 = (ChanNrModeSet_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 ChanNrModeSet_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 ChanNrModeSet_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 = (ChanNrModeSet_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int ChanNrModeTest_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 ChanNrModeTest_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 @BTS_Tests_VAMOS.ChanNrModeTest 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 @BTS_Tests_VAMOS.ChanNrModeTest 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 @BTS_Tests_VAMOS.ChanNrModeTest 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 @BTS_Tests_VAMOS.ChanNrModeTest 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 @BTS_Tests_VAMOS.ChanNrModeTest 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 @BTS_Tests_VAMOS.ChanNrModeTest containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests_VAMOS.ChanNrModeTest.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests_VAMOS.ChanNrModeTest");
}

boolean ChanNrModeTest_template::match(const ChanNrModeTest& 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 @BTS_Tests_VAMOS.ChanNrModeTest.");
}
return FALSE;
}

boolean ChanNrModeTest_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;
}

ChanNrModeTest ChanNrModeTest_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 @BTS_Tests_VAMOS.ChanNrModeTest.");
ChanNrModeTest 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;
}

ChanNrModeTest ChanNrModeTest_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);
}

ChanNrModeTest ChanNrModeTest_template::replace(int index, int len, const ChanNrModeTest_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());
}

ChanNrModeTest ChanNrModeTest_template::replace(int index, int len, const ChanNrModeTest& 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 ChanNrModeTest_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 ChanNrModeTest_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests_VAMOS.ChanNrModeTest.");
}
set_selection(template_type);
}

ChanNrModeTest_template& ChanNrModeTest_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 @BTS_Tests_VAMOS.ChanNrModeTest.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests_VAMOS.ChanNrModeTest.");
return value_list.list_value[list_index];
}

void ChanNrModeTest_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 ChanNrModeTest_template::log_match(const ChanNrModeTest& 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 ChanNrModeTest_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 @BTS_Tests_VAMOS.ChanNrModeTest.");
}
}

void ChanNrModeTest_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 @BTS_Tests_VAMOS.ChanNrModeTest.");
single_value.value_elements = (ChanNrModeSet_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 ChanNrModeSet_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 ChanNrModeTest_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 @BTS_Tests_VAMOS.ChanNrModeTest.");
}
}

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

boolean ChanNrModeTest_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 ChanNrModeTest_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 ChanNrModeTest_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: {
    ChanNrModeTest_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: {
    ChanNrModeTest_template* precondition = new ChanNrModeTest_template;
    precondition->set_param(*param.get_elem(0));
    ChanNrModeTest_template* implied_template = new ChanNrModeTest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ChanNrModeTest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests_VAMOS.ChanNrModeTest");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void ChanNrModeTest_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 : "@BTS_Tests_VAMOS.ChanNrModeTest");
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 : "@BTS_Tests_VAMOS.ChanNrModeTest");
}

boolean ChanNrModeTest_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);
}
}

const ChanNrMode ChanNrModeSet::UNBOUND_ELEM;
ChanNrModeSet::ChanNrModeSet()
{
val_ptr = NULL;
}

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

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

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

void ChanNrModeSet::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.");
}
}

ChanNrModeSet& ChanNrModeSet::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;
}

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

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

boolean ChanNrModeSet::operator==(const ChanNrModeSet& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
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;
}

ChanNrMode& ChanNrModeSet::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests_VAMOS.ChanNrModeSet 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 = (ChanNrMode**)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 ChanNrMode(*(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 ChanNrMode;
}
return *val_ptr->value_elements[index_value];
}

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

const ChanNrMode& ChanNrModeSet::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests_VAMOS.ChanNrModeSet using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests_VAMOS.ChanNrModeSet: 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 ChanNrMode& ChanNrModeSet::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
return (*this)[(int)index_value];
}

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

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

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

ChanNrModeSet ChanNrModeSet::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
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;
ChanNrModeSet 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 ChanNrMode(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

ChanNrModeSet ChanNrModeSet::operator+(const ChanNrModeSet& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests_VAMOS.ChanNrModeSet concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
ChanNrModeSet 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 ChanNrMode(*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 ChanNrMode(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

ChanNrModeSet ChanNrModeSet::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests_VAMOS.ChanNrModeSet","element");
ChanNrModeSet 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 ChanNrMode(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

ChanNrModeSet ChanNrModeSet::replace(int index, int len, const ChanNrModeSet& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests_VAMOS.ChanNrModeSet","element");
ChanNrModeSet 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 ChanNrMode(*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 ChanNrMode(*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 ChanNrMode(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

ChanNrModeSet ChanNrModeSet::replace(int index, int len, const ChanNrModeSet_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 ChanNrModeSet::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
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 = (ChanNrMode**)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 ChanNrMode(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (ChanNrMode**)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 @BTS_Tests_VAMOS.ChanNrModeSet: %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 = (ChanNrMode**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean ChanNrModeSet::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 ChanNrModeSet::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
return val_ptr->n_elements;
}

int ChanNrModeSet::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
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 ChanNrModeSet::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 ChanNrModeSet::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 ChanNrModeSet::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", "@BTS_Tests_VAMOS.ChanNrModeSet");
    }
    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", "@BTS_Tests_VAMOS.ChanNrModeSet");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void ChanNrModeSet::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
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 ChanNrModeSet::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 @BTS_Tests_VAMOS.ChanNrModeSet.");
val_ptr->value_elements = (ChanNrMode**)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 ChanNrMode;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void ChanNrModeSet_template::copy_value(const ChanNrModeSet& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests_VAMOS.ChanNrModeSet with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (ChanNrMode_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 ChanNrMode_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new ChanNrMode_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void ChanNrModeSet_template::copy_template(const ChanNrModeSet_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 = (ChanNrMode_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 ChanNrMode_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new ChanNrMode_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 ChanNrModeSet_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 ChanNrModeSet_template(*other_value.implication_.precondition);
implication_.implied_template = new ChanNrModeSet_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 @BTS_Tests_VAMOS.ChanNrModeSet.");
break;
}
set_selection(other_value);
}

boolean ChanNrModeSet_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 ChanNrModeSet_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const ChanNrModeSet*)value_ptr)[value_index], legacy);
else return ((const ChanNrModeSet_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

ChanNrModeSet_template::ChanNrModeSet_template()
{
}

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

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

ChanNrModeSet_template::ChanNrModeSet_template(const ChanNrModeSet& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void ChanNrModeSet_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;
}

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

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

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

ChanNrModeSet_template& ChanNrModeSet_template::operator=(const OPTIONAL<ChanNrModeSet>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ChanNrModeSet&)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 @BTS_Tests_VAMOS.ChanNrModeSet.");
}
return *this;
}

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

ChanNrMode_template& ChanNrModeSet_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests_VAMOS.ChanNrModeSet 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 @BTS_Tests_VAMOS.ChanNrModeSet.");
    break;
}
return *single_value.value_elements[index_value];
}

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

const ChanNrMode_template& ChanNrModeSet_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests_VAMOS.ChanNrModeSet using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests_VAMOS.ChanNrModeSet.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests_VAMOS.ChanNrModeSet: 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 ChanNrMode_template& ChanNrModeSet_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests_VAMOS.ChanNrModeSet.");
return (*this)[(int)index_value];
}

void ChanNrModeSet_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests_VAMOS.ChanNrModeSet.");
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 = (ChanNrMode_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 ChanNrMode_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 ChanNrMode_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 = (ChanNrMode_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int ChanNrModeSet_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 ChanNrModeSet_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 @BTS_Tests_VAMOS.ChanNrModeSet 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 @BTS_Tests_VAMOS.ChanNrModeSet 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 @BTS_Tests_VAMOS.ChanNrModeSet 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 @BTS_Tests_VAMOS.ChanNrModeSet 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 @BTS_Tests_VAMOS.ChanNrModeSet 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 @BTS_Tests_VAMOS.ChanNrModeSet containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests_VAMOS.ChanNrModeSet.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests_VAMOS.ChanNrModeSet");
}

boolean ChanNrModeSet_template::match(const ChanNrModeSet& 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 @BTS_Tests_VAMOS.ChanNrModeSet.");
}
return FALSE;
}

boolean ChanNrModeSet_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;
}

ChanNrModeSet ChanNrModeSet_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 @BTS_Tests_VAMOS.ChanNrModeSet.");
ChanNrModeSet 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;
}

ChanNrModeSet ChanNrModeSet_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);
}

ChanNrModeSet ChanNrModeSet_template::replace(int index, int len, const ChanNrModeSet_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());
}

ChanNrModeSet ChanNrModeSet_template::replace(int index, int len, const ChanNrModeSet& 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 ChanNrModeSet_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 ChanNrModeSet_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests_VAMOS.ChanNrModeSet.");
}
set_selection(template_type);
}

ChanNrModeSet_template& ChanNrModeSet_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 @BTS_Tests_VAMOS.ChanNrModeSet.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests_VAMOS.ChanNrModeSet.");
return value_list.list_value[list_index];
}

void ChanNrModeSet_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 ChanNrModeSet_template::log_match(const ChanNrModeSet& 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 ChanNrModeSet_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 @BTS_Tests_VAMOS.ChanNrModeSet.");
}
}

void ChanNrModeSet_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 @BTS_Tests_VAMOS.ChanNrModeSet.");
single_value.value_elements = (ChanNrMode_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 ChanNrMode_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 ChanNrModeSet_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 @BTS_Tests_VAMOS.ChanNrModeSet.");
}
}

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

boolean ChanNrModeSet_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 ChanNrModeSet_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 ChanNrModeSet_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: {
    ChanNrModeSet_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: {
    ChanNrModeSet_template* precondition = new ChanNrModeSet_template;
    precondition->set_param(*param.get_elem(0));
    ChanNrModeSet_template* implied_template = new ChanNrModeSet_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ChanNrModeSet_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests_VAMOS.ChanNrModeSet");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void ChanNrModeSet_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 : "@BTS_Tests_VAMOS.ChanNrModeSet");
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 : "@BTS_Tests_VAMOS.ChanNrModeSet");
}

boolean ChanNrModeSet_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);
}
}
ChanNrMode::ChanNrMode()
{
}

ChanNrMode::ChanNrMode(const GSM__Types::RslChannelNr& par_chan__nr,
    const RSL__Types::RSL__IE__ChannelMode& par_chan__mode)
  :   field_chan__nr(par_chan__nr),
  field_chan__mode(par_chan__mode)
{
}

ChanNrMode::ChanNrMode(const ChanNrMode& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests_VAMOS.ChanNrMode.");
if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr();
else field_chan__nr.clean_up();
if (other_value.chan__mode().is_bound()) field_chan__mode = other_value.chan__mode();
else field_chan__mode.clean_up();
}

void ChanNrMode::clean_up()
{
field_chan__nr.clean_up();
field_chan__mode.clean_up();
}

const TTCN_Typedescriptor_t* ChanNrMode::get_descriptor() const { return &ChanNrMode_descr_; }
ChanNrMode& ChanNrMode::operator=(const ChanNrMode& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests_VAMOS.ChanNrMode.");
  if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr();
  else field_chan__nr.clean_up();
  if (other_value.chan__mode().is_bound()) field_chan__mode = other_value.chan__mode();
  else field_chan__mode.clean_up();
}
return *this;
}

boolean ChanNrMode::operator==(const ChanNrMode& other_value) const
{
return field_chan__nr==other_value.field_chan__nr
  && field_chan__mode==other_value.field_chan__mode;
}

boolean ChanNrMode::is_bound() const
{
return (field_chan__nr.is_bound())
  || (field_chan__mode.is_bound());
}
boolean ChanNrMode::is_value() const
{
return field_chan__nr.is_value()
  && field_chan__mode.is_value();
}
void ChanNrMode::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ chan_nr := ");
field_chan__nr.log();
TTCN_Logger::log_event_str(", chan_mode := ");
field_chan__mode.log();
TTCN_Logger::log_event_str(" }");
}

void ChanNrMode::set_implicit_omit()
{
if (chan__nr().is_bound()) chan__nr().set_implicit_omit();
if (chan__mode().is_bound()) chan__mode().set_implicit_omit();
}

void ChanNrMode::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 @BTS_Tests_VAMOS.ChanNrMode 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) chan__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) chan__mode().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(), "chan_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          chan__nr().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(), "chan_mode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          chan__mode().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 @BTS_Tests_VAMOS.ChanNrMode: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests_VAMOS.ChanNrMode");
  }
}

void ChanNrMode::encode_text(Text_Buf& text_buf) const
{
field_chan__nr.encode_text(text_buf);
field_chan__mode.encode_text(text_buf);
}

void ChanNrMode::decode_text(Text_Buf& text_buf)
{
field_chan__nr.decode_text(text_buf);
field_chan__mode.decode_text(text_buf);
}

struct ChanNrMode_template::single_value_struct {
GSM__Types::RslChannelNr_template field_chan__nr;
RSL__Types::RSL__IE__ChannelMode_template field_chan__mode;
};

void ChanNrMode_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_chan__nr = ANY_VALUE;
single_value->field_chan__mode = ANY_VALUE;
}
}
}

void ChanNrMode_template::copy_value(const ChanNrMode& other_value)
{
single_value = new single_value_struct;
if (other_value.chan__nr().is_bound()) {
  single_value->field_chan__nr = other_value.chan__nr();
} else {
  single_value->field_chan__nr.clean_up();
}
if (other_value.chan__mode().is_bound()) {
  single_value->field_chan__mode = other_value.chan__mode();
} else {
  single_value->field_chan__mode.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ChanNrMode_template::copy_template(const ChanNrMode_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.chan__nr().get_selection()) {
single_value->field_chan__nr = other_value.chan__nr();
} else {
single_value->field_chan__nr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.chan__mode().get_selection()) {
single_value->field_chan__mode = other_value.chan__mode();
} else {
single_value->field_chan__mode.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 ChanNrMode_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 ChanNrMode_template(*other_value.implication_.precondition);
implication_.implied_template = new ChanNrMode_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 @BTS_Tests_VAMOS.ChanNrMode.");
break;
}
set_selection(other_value);
}

ChanNrMode_template::ChanNrMode_template()
{
}

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

ChanNrMode_template::ChanNrMode_template(const ChanNrMode& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

ChanNrMode_template& ChanNrMode_template::operator=(const OPTIONAL<ChanNrMode>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ChanNrMode&)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 @BTS_Tests_VAMOS.ChanNrMode.");
}
return *this;
}

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

boolean ChanNrMode_template::match(const ChanNrMode& 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.chan__nr().is_bound()) return FALSE;
if(!single_value->field_chan__nr.match(other_value.chan__nr(), legacy))return FALSE;
if(!other_value.chan__mode().is_bound()) return FALSE;
if(!single_value->field_chan__mode.match(other_value.chan__mode(), 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 @BTS_Tests_VAMOS.ChanNrMode.");
}
return FALSE;
}

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

boolean ChanNrMode_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_chan__nr.is_value()
 && single_value->field_chan__mode.is_value();
}

void ChanNrMode_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;
}

ChanNrMode ChanNrMode_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 @BTS_Tests_VAMOS.ChanNrMode.");
ChanNrMode ret_val;
if (single_value->field_chan__nr.is_bound()) {
ret_val.chan__nr() = single_value->field_chan__nr.valueof();
}
if (single_value->field_chan__mode.is_bound()) {
ret_val.chan__mode() = single_value->field_chan__mode.valueof();
}
return ret_val;
}

void ChanNrMode_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 @BTS_Tests_VAMOS.ChanNrMode.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ChanNrMode_template[list_length];
}

ChanNrMode_template& ChanNrMode_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 @BTS_Tests_VAMOS.ChanNrMode.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests_VAMOS.ChanNrMode.");
return value_list.list_value[list_index];
}

GSM__Types::RslChannelNr_template& ChanNrMode_template::chan__nr()
{
set_specific();
return single_value->field_chan__nr;
}

const GSM__Types::RslChannelNr_template& ChanNrMode_template::chan__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field chan_nr of a non-specific template of type @BTS_Tests_VAMOS.ChanNrMode.");
return single_value->field_chan__nr;
}

RSL__Types::RSL__IE__ChannelMode_template& ChanNrMode_template::chan__mode()
{
set_specific();
return single_value->field_chan__mode;
}

const RSL__Types::RSL__IE__ChannelMode_template& ChanNrMode_template::chan__mode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field chan_mode of a non-specific template of type @BTS_Tests_VAMOS.ChanNrMode.");
return single_value->field_chan__mode;
}

int ChanNrMode_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_VAMOS.ChanNrMode 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 @BTS_Tests_VAMOS.ChanNrMode 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 @BTS_Tests_VAMOS.ChanNrMode containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_VAMOS.ChanNrMode containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_VAMOS.ChanNrMode containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_VAMOS.ChanNrMode containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_VAMOS.ChanNrMode containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_VAMOS.ChanNrMode containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_VAMOS.ChanNrMode containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests_VAMOS.ChanNrMode.");
  }
  return 0;
}

void ChanNrMode_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ chan_nr := ");
single_value->field_chan__nr.log();
TTCN_Logger::log_event_str(", chan_mode := ");
single_value->field_chan__mode.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 ChanNrMode_template::log_match(const ChanNrMode& 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_chan__nr.match(match_value.chan__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".chan_nr");
single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_chan__mode.match(match_value.chan__mode(), legacy)){
TTCN_Logger::log_logmatch_info(".chan_mode");
single_value->field_chan__mode.log_match(match_value.chan__mode(), 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("{ chan_nr := ");
single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy);
TTCN_Logger::log_event_str(", chan_mode := ");
single_value->field_chan__mode.log_match(match_value.chan__mode(), 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 ChanNrMode_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (chan__nr().is_bound()) chan__nr().set_implicit_omit();
if (chan__mode().is_bound()) chan__mode().set_implicit_omit();
}

void ChanNrMode_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_chan__nr.encode_text(text_buf);
single_value->field_chan__mode.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 @BTS_Tests_VAMOS.ChanNrMode.");
}
}

void ChanNrMode_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_chan__nr.decode_text(text_buf);
single_value->field_chan__mode.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 ChanNrMode_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 @BTS_Tests_VAMOS.ChanNrMode.");
}
}

void ChanNrMode_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: {
    ChanNrMode_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 @BTS_Tests_VAMOS.ChanNrMode 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) chan__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) chan__mode().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(), "chan_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          chan__nr().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(), "chan_mode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          chan__mode().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 @BTS_Tests_VAMOS.ChanNrMode: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ChanNrMode_template* precondition = new ChanNrMode_template;
    precondition->set_param(*param.get_elem(0));
    ChanNrMode_template* implied_template = new ChanNrMode_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ChanNrMode_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests_VAMOS.ChanNrMode");
  }
  is_ifpresent = param.get_ifpresent();
}

void ChanNrMode_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_chan__nr.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_VAMOS.ChanNrMode");
single_value->field_chan__mode.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_VAMOS.ChanNrMode");
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 : "@BTS_Tests_VAMOS.ChanNrMode");
}

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

boolean ChanNrMode_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 ChanNrModeTest& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeTest.");
return other_value.val_ptr->n_elements == 0;
}

boolean operator==(null_type, const ChanNrModeSet& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests_VAMOS.ChanNrModeSet.");
return other_value.val_ptr->n_elements == 0;
}

ChanNrModeTest_template ChanNrModeTestVFF(const INTEGER& tn)
{
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 42, TTCN_Location::LOCATION_TEMPLATE, "ChanNrModeTestVFF");
ChanNrModeTest_template ret_val;
ret_val.set_size(4);
{
ChanNrModeSet_template& tmp_0 = ret_val[0];
tmp_0.set_size(2);
{
ChanNrMode_template& tmp_1 = tmp_0[0];
tmp_1.chan__nr() = GSM__Types::ts__RslChanNr__Bm(tn);
tmp_1.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__F__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
{
ChanNrMode_template& tmp_2 = tmp_0[1];
tmp_2.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Bm(tn);
tmp_2.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__F__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
}
{
ChanNrModeSet_template& tmp_3 = ret_val[1];
tmp_3.set_size(2);
{
ChanNrMode_template& tmp_4 = tmp_3[0];
tmp_4.chan__nr() = GSM__Types::ts__RslChanNr__Bm(tn);
tmp_4.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__F__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM1, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_5 = tmp_3[1];
tmp_5.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Bm(tn);
tmp_5.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__F__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
}
{
ChanNrModeSet_template& tmp_6 = ret_val[2];
tmp_6.set_size(2);
{
ChanNrMode_template& tmp_7 = tmp_6[0];
tmp_7.chan__nr() = GSM__Types::ts__RslChanNr__Bm(tn);
tmp_7.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__F__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM2, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_8 = tmp_6[1];
tmp_8.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Bm(tn);
tmp_8.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__F__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
}
{
ChanNrModeSet_template& tmp_9 = ret_val[3];
tmp_9.set_size(2);
{
ChanNrMode_template& tmp_10 = tmp_9[0];
tmp_10.chan__nr() = GSM__Types::ts__RslChanNr__Bm(tn);
tmp_10.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__F__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_11 = tmp_9[1];
tmp_11.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Bm(tn);
tmp_11.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__F__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
}
return ret_val;
}

ChanNrModeTest_template ChanNrModeTestVHH(const INTEGER& tn)
{
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 71, TTCN_Location::LOCATION_TEMPLATE, "ChanNrModeTestVHH");
ChanNrModeTest_template ret_val;
ret_val.set_size(4);
{
ChanNrModeSet_template& tmp_12 = ret_val[0];
tmp_12.set_size(4);
{
ChanNrMode_template& tmp_13 = tmp_12[0];
tmp_13.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 0);
tmp_13.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
{
ChanNrMode_template& tmp_14 = tmp_12[1];
tmp_14.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 1);
tmp_14.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
{
ChanNrMode_template& tmp_15 = tmp_12[2];
tmp_15.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 0);
tmp_15.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
{
ChanNrMode_template& tmp_16 = tmp_12[3];
tmp_16.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 1);
tmp_16.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
}
{
ChanNrModeSet_template& tmp_17 = ret_val[1];
tmp_17.set_size(4);
{
ChanNrMode_template& tmp_18 = tmp_17[0];
tmp_18.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 0);
tmp_18.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
{
ChanNrMode_template& tmp_19 = tmp_17[1];
tmp_19.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 1);
tmp_19.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM1, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_20 = tmp_17[2];
tmp_20.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 0);
tmp_20.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM1, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_21 = tmp_17[3];
tmp_21.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 1);
tmp_21.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
}
{
ChanNrModeSet_template& tmp_22 = ret_val[2];
tmp_22.set_size(4);
{
ChanNrMode_template& tmp_23 = tmp_22[0];
tmp_23.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 0);
tmp_23.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM1, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_24 = tmp_22[1];
tmp_24.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 1);
tmp_24.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_25 = tmp_22[2];
tmp_25.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 0);
tmp_25.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
{
ChanNrMode_template& tmp_26 = tmp_22[3];
tmp_26.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 1);
tmp_26.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
}
{
ChanNrModeSet_template& tmp_27 = ret_val[3];
tmp_27.set_size(4);
{
ChanNrMode_template& tmp_28 = tmp_27[0];
tmp_28.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 0);
tmp_28.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_29 = tmp_27[1];
tmp_29.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 1);
tmp_29.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_30 = tmp_27[2];
tmp_30.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 0);
tmp_30.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_31 = tmp_27[3];
tmp_31.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 1);
tmp_31.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
}
return ret_val;
}

ChanNrModeTest_template ChanNrModeTestHVHH(const INTEGER& tn)
{
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 116, TTCN_Location::LOCATION_TEMPLATE, "ChanNrModeTestHVHH");
ChanNrModeTest_template ret_val;
ret_val.set_size(4);
{
ChanNrModeSet_template& tmp_32 = ret_val[0];
tmp_32.set_size(3);
{
ChanNrMode_template& tmp_33 = tmp_32[0];
tmp_33.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 0);
tmp_33.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__H), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
{
ChanNrMode_template& tmp_34 = tmp_32[1];
tmp_34.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 1);
tmp_34.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
{
ChanNrMode_template& tmp_35 = tmp_32[2];
tmp_35.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 1);
tmp_35.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
}
{
ChanNrModeSet_template& tmp_36 = ret_val[1];
tmp_36.set_size(3);
{
ChanNrMode_template& tmp_37 = tmp_36[0];
tmp_37.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 0);
tmp_37.chan__mode() = RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__H), RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval);
}
{
ChanNrMode_template& tmp_38 = tmp_36[1];
tmp_38.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 1);
tmp_38.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_39 = tmp_36[2];
tmp_39.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 1);
tmp_39.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
}
{
ChanNrModeSet_template& tmp_40 = ret_val[2];
tmp_40.set_size(3);
{
ChanNrMode_template& tmp_41 = tmp_40[0];
tmp_41.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 0);
tmp_41.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__H, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM1, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_42 = tmp_40[1];
tmp_42.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 1);
tmp_42.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM1, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_43 = tmp_40[2];
tmp_43.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 1);
tmp_43.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
}
{
ChanNrModeSet_template& tmp_44 = ret_val[3];
tmp_44.set_size(3);
{
ChanNrMode_template& tmp_45 = tmp_44[0];
tmp_45.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 0);
tmp_45.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__H, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_46 = tmp_44[1];
tmp_46.chan__nr() = GSM__Types::ts__RslChanNr__Lm(tn, 1);
tmp_46.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
{
ChanNrMode_template& tmp_47 = tmp_44[2];
tmp_47.chan__nr() = GSM__Types::ts__RslChanNr__Osmo__VAMOS__Lm(tn, 1);
tmp_47.chan__mode() = RSL__Types::ts__RSL__ChanMode(RSL__Types::RSL__ChanRateType::RSL__CHRT__OSMO__TCH__H__VAMOS, RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3, RSL__Types::ts__RSL__ChanMode_dtx__downlink_defval);
}
}
return ret_val;
}

void f__TC__vamos__exec__async(const ChanNrModeTest& test, const BTS__Tests::void__fn& handler)
{
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 164, TTCN_Location::LOCATION_FUNCTION, "f_TC_vamos_exec_async");
current_location.update_lineno(167);
/* BTS_Tests_VAMOS.ttcn, line 167 */
VALUE_ARRAY<BTS__Tests::ConnHdlrPars, 4, 0> pars;
current_location.update_lineno(168);
/* BTS_Tests_VAMOS.ttcn, line 168 */
VALUE_ARRAY<COMPONENT, 4, 0> vc__conn;
current_location.update_lineno(170);
/* BTS_Tests_VAMOS.ttcn, line 170 */
BTS__Tests::f__init(BTS__Tests::f__init_trx__nr_defval);
{
current_location.update_lineno(172);
/* BTS_Tests_VAMOS.ttcn, line 172 */
INTEGER i(0);
current_location.update_lineno(172);
/* BTS_Tests_VAMOS.ttcn, line 172 */
for ( ; ; ) {
current_location.update_lineno(172);
/* BTS_Tests_VAMOS.ttcn, line 172 */
if (!(i < test.lengthof())) break;
{
current_location.update_lineno(174);
/* BTS_Tests_VAMOS.ttcn, line 174 */
INTEGER ch(0);
current_location.update_lineno(174);
/* BTS_Tests_VAMOS.ttcn, line 174 */
for ( ; ; ) {
current_location.update_lineno(174);
/* BTS_Tests_VAMOS.ttcn, line 174 */
if (!(ch < const_cast< const ChanNrModeTest&>(test)[i].lengthof())) break;
current_location.update_lineno(175);
/* BTS_Tests_VAMOS.ttcn, line 175 */
pars[ch] = BTS__Tests::t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChanNrModeTest&>(test)[i][ch].chan__nr()), RSL__Types::RSL__IE__ChannelMode_template(const_cast< const ChanNrModeTest&>(test)[i][ch].chan__mode()), BTS__Tests::t__Pars_spec_defval, BTS__Tests::t__Pars_trx__nr_defval, BTS__Tests::t__Pars_t__guard_defval).valueof();
current_location.update_lineno(177);
/* BTS_Tests_VAMOS.ttcn, line 177 */
{
boolean tmp_50;
{
boolean tmp_51 = test.is_bound();
if(tmp_51) {
const int tmp_52 = i;
tmp_51 = (tmp_52 >= 0) && (test.size_of() > tmp_52);
if(tmp_51) {
const ChanNrModeSet& tmp_53 = test[tmp_52];
tmp_51 = tmp_53.is_bound();
if(tmp_51) {
const int tmp_54 = ch;
tmp_51 = (tmp_54 >= 0) && (tmp_53.size_of() > tmp_54);
if(tmp_51) {
const ChanNrMode& tmp_55 = tmp_53[tmp_54];
tmp_51 = tmp_55.is_bound();
if(tmp_51) {
const ChanNrMode& tmp_56 = tmp_55;
const RSL__Types::RSL__IE__ChannelMode& tmp_57 = tmp_56.chan__mode();
tmp_51 = tmp_57.is_bound();
if(tmp_51) {
const RSL__Types::RSL__IE__ChannelMode& tmp_58 = tmp_57;
const RSL__Types::RSL__ChanModeOct6& tmp_59 = tmp_58.u();
tmp_51 = tmp_59.is_bound();
if (tmp_51) {
tmp_51 = tmp_59.ischosen(RSL__Types::RSL__ChanModeOct6::ALT_speech);
}
}
}
}
}
}
}
tmp_50 = tmp_51;
}
if (tmp_50) tmp_50 = (const_cast< const ChanNrModeTest&>(test)[i][ch].chan__mode().u().speech() == RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3);
if (tmp_50) {
current_location.update_lineno(178);
/* BTS_Tests_VAMOS.ttcn, line 178 */
pars[ch].mr__conf() = RSL__Types::ts__RSL__MultirateCfg(RSL__Types::ts__RSL__MultirateCfg_icmi_defval, RSL__Types::ts__RSL__MultirateCfg_start__mode_defval, RSL__Types::ts__RSL__MultirateCfg_codec__modes_defval, RSL__Types::ts__RSL__MultirateCfg_params_defval).valueof();
}
}
current_location.update_lineno(180);
/* BTS_Tests_VAMOS.ttcn, line 180 */
vc__conn[ch] = BTS__Tests::f__start__handler(handler, const_cast< const VALUE_ARRAY<BTS__Tests::ConnHdlrPars, 4, 0>&>(pars)[ch], BTS__Tests::f__start__handler_pcu__comp_defval, BTS__Tests::f__start__handler_trxc__comp_defval, FALSE);
current_location.update_lineno(174);
/* BTS_Tests_VAMOS.ttcn, line 174 */
{
INTEGER tmp_62;
++ch;
}
}
}
{
current_location.update_lineno(184);
/* BTS_Tests_VAMOS.ttcn, line 184 */
INTEGER ch(0);
current_location.update_lineno(184);
/* BTS_Tests_VAMOS.ttcn, line 184 */
for ( ; ; ) {
current_location.update_lineno(184);
/* BTS_Tests_VAMOS.ttcn, line 184 */
if (!(ch < const_cast< const ChanNrModeTest&>(test)[i].lengthof())) break;
current_location.update_lineno(185);
/* BTS_Tests_VAMOS.ttcn, line 185 */
{
tmp_63:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = const_cast< const VALUE_ARRAY<COMPONENT, 4, 0>&>(vc__conn)[ch].done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_63;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_63;
}
current_location.update_lineno(185);
/* BTS_Tests_VAMOS.ttcn, line 185 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests_VAMOS.ttcn, line 185.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(184);
/* BTS_Tests_VAMOS.ttcn, line 184 */
{
INTEGER tmp_64;
++ch;
}
}
}
current_location.update_lineno(172);
/* BTS_Tests_VAMOS.ttcn, line 172 */
{
INTEGER tmp_65;
++i;
}
}
}
current_location.update_lineno(189);
/* BTS_Tests_VAMOS.ttcn, line 189 */
Misc__Helpers::f__shutdown(cs_0, 189, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
}

void start_f__TC__vamos__exec__async(const COMPONENT& component_reference, const ChanNrModeTest& test, const BTS__Tests::void__fn& handler)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_vamos_exec_async(");
test.log();
TTCN_Logger::log_event_str(", ");
handler.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests_VAMOS", "f_TC_vamos_exec_async", text_buf);
test.encode_text(text_buf);
handler.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__vamos__chan__act(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 192, TTCN_Location::LOCATION_FUNCTION, "f_TC_vamos_chan_act");
current_location.update_lineno(194);
/* BTS_Tests_VAMOS.ttcn, line 194 */
RSL__Types::RSL__IE tsc__ie(ts__RSL__IE__OsmoTSC.valueof());
current_location.update_lineno(197);
/* BTS_Tests_VAMOS.ttcn, line 197 */
{
RSL__Types::RSL__IE__List tmp_66;
tmp_66.set_size(1);
tmp_66[0] = tsc__ie;
BTS__Tests::f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const BTS__Tests::ConnHdlrPars&>(BTS__Tests::ConnHdlr_component_g__pars).chan__mode()), BTS__Tests::f__rsl__chan__act_encr__enable_defval, tmp_66, BTS__Tests::f__rsl__chan__act_act__type_defval);
}
current_location.update_lineno(200);
/* BTS_Tests_VAMOS.ttcn, line 200 */
Osmocom__Types::f__sleep(3.0e-1);
current_location.update_lineno(203);
/* BTS_Tests_VAMOS.ttcn, line 203 */
BTS__Tests::f__rsl__chan__deact();
current_location.update_lineno(204);
/* BTS_Tests_VAMOS.ttcn, line 204 */
RSL__Emulation::f__rslem__unregister(0, GSM__Types::RslChannelNr(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Emulation::RSL__DchanHdlr_component_RSL__PROC);
}

void start_f__TC__vamos__chan__act(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_vamos_chan_act(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests_VAMOS", "f_TC_vamos_chan_act", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__vamos__chan__act__vff(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 208, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_act_vff");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_act_vff", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(209);
/* BTS_Tests_VAMOS.ttcn, line 209 */
ChanNrModeTest test(ChanNrModeTestVFF(1).valueof());
current_location.update_lineno(210);
/* BTS_Tests_VAMOS.ttcn, line 210 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__act);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_act_vff was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__act__dyn__ipa__vff(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 212, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_act_dyn_ipa_vff");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_act_dyn_ipa_vff", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(213);
/* BTS_Tests_VAMOS.ttcn, line 213 */
ChanNrModeTest test(ChanNrModeTestVFF(3).valueof());
current_location.update_lineno(214);
/* BTS_Tests_VAMOS.ttcn, line 214 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__act);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_act_dyn_ipa_vff was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__act__dyn__osmo__vff(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 216, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_act_dyn_osmo_vff");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_act_dyn_osmo_vff", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(217);
/* BTS_Tests_VAMOS.ttcn, line 217 */
ChanNrModeTest test(ChanNrModeTestVFF(4).valueof());
current_location.update_lineno(218);
/* BTS_Tests_VAMOS.ttcn, line 218 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__act);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_act_dyn_osmo_vff was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__act__vhh(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 222, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_act_vhh");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_act_vhh", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(223);
/* BTS_Tests_VAMOS.ttcn, line 223 */
ChanNrModeTest test(ChanNrModeTestVHH(5).valueof());
current_location.update_lineno(224);
/* BTS_Tests_VAMOS.ttcn, line 224 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__act);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_act_vhh was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__act__dyn__osmo__vhh(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 226, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_act_dyn_osmo_vhh");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_act_dyn_osmo_vhh", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(227);
/* BTS_Tests_VAMOS.ttcn, line 227 */
ChanNrModeTest test(ChanNrModeTestVHH(4).valueof());
current_location.update_lineno(228);
/* BTS_Tests_VAMOS.ttcn, line 228 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__act);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_act_dyn_osmo_vhh was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__act__hvhh(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 232, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_act_hvhh");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_act_hvhh", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(233);
/* BTS_Tests_VAMOS.ttcn, line 233 */
ChanNrModeTest test(ChanNrModeTestHVHH(5).valueof());
current_location.update_lineno(234);
/* BTS_Tests_VAMOS.ttcn, line 234 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__act);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_act_hvhh was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__act__dyn__osmo__hvhh(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 236, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_act_dyn_osmo_hvhh");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_act_dyn_osmo_hvhh", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(237);
/* BTS_Tests_VAMOS.ttcn, line 237 */
ChanNrModeTest test(ChanNrModeTestHVHH(4).valueof());
current_location.update_lineno(238);
/* BTS_Tests_VAMOS.ttcn, line 238 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__act);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_act_dyn_osmo_hvhh was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__vamos__chan__mode__modify(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 241, TTCN_Location::LOCATION_FUNCTION, "f_TC_vamos_chan_mode_modify");
current_location.update_lineno(243);
/* BTS_Tests_VAMOS.ttcn, line 243 */
RSL__Types::RSL__IE tsc__ie(ts__RSL__IE__OsmoTSC.valueof());
current_location.update_lineno(246);
/* BTS_Tests_VAMOS.ttcn, line 246 */
{
RSL__Types::RSL__IE__List tmp_67;
tmp_67.set_size(1);
tmp_67[0] = tsc__ie;
BTS__Tests::f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const BTS__Tests::ConnHdlrPars&>(BTS__Tests::ConnHdlr_component_g__pars).chan__mode()), BTS__Tests::f__rsl__chan__act_encr__enable_defval, tmp_67, BTS__Tests::f__rsl__chan__act_act__type_defval);
}
current_location.update_lineno(249);
/* BTS_Tests_VAMOS.ttcn, line 249 */
if ((const_cast< const BTS__Tests::ConnHdlrPars&>(BTS__Tests::ConnHdlr_component_g__pars).chan__mode().spd__ind() == RSL__Types::RSL__SpeechDataInd::RSL__SPDI__SIGN)) {
current_location.update_lineno(250);
/* BTS_Tests_VAMOS.ttcn, line 250 */
BTS__Tests::ConnHdlr_component_g__pars.chan__mode().spd__ind() = RSL__Types::RSL__SpeechDataInd::RSL__SPDI__SPEECH;
current_location.update_lineno(251);
/* BTS_Tests_VAMOS.ttcn, line 251 */
BTS__Tests::ConnHdlr_component_g__pars.chan__mode().u().speech() = RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM1;
}
else {
current_location.update_lineno(253);
/* BTS_Tests_VAMOS.ttcn, line 253 */
BTS__Tests::ConnHdlr_component_g__pars.chan__mode().spd__ind() = RSL__Types::RSL__SpeechDataInd::RSL__SPDI__SIGN;
current_location.update_lineno(254);
/* BTS_Tests_VAMOS.ttcn, line 254 */
BTS__Tests::ConnHdlr_component_g__pars.chan__mode().u().sign() = RSL__Types::RSL__ChanModeOct6Signalling::RSL__CMOD__NO__RESOURCE;
}
current_location.update_lineno(257);
/* BTS_Tests_VAMOS.ttcn, line 257 */
RSL__Types::RSL__Message rsl(RSL__Types::ts__RSL__MODE__MODIFY__REQ(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Types::RSL__IE__ChannelMode_template(const_cast< const BTS__Tests::ConnHdlrPars&>(BTS__Tests::ConnHdlr_component_g__pars).chan__mode())).valueof());
current_location.update_lineno(258);
/* BTS_Tests_VAMOS.ttcn, line 258 */
{
OPTIONAL< RSL__Types::RSL__IE__List > tmp_72;
{
RSL__Types::RSL__IE__List tmp_74;
tmp_74.set_size(1);
tmp_74[0] = tsc__ie;
tmp_72() = (const_cast< const RSL__Types::RSL__Message&>(rsl).ies()() + tmp_74);
}
{
RSL__Types::RSL__IE__List& tmp_73 = rsl.ies(); /* 7388 */
tmp_73 = tmp_72;
}
}
current_location.update_lineno(259);
/* BTS_Tests_VAMOS.ttcn, line 259 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(rsl, FALSE, NULL);
current_location.update_lineno(261);
/* BTS_Tests_VAMOS.ttcn, line 261 */
TIMER T("T", 1.0);
current_location.update_lineno(262);
/* BTS_Tests_VAMOS.ttcn, line 262 */
T.start();
current_location.update_lineno(263);
/* BTS_Tests_VAMOS.ttcn, line 263 */
{
tmp_75:
alt_status tmp_75_alt_flag_0 = ALT_MAYBE;
alt_status tmp_75_alt_flag_1 = ALT_MAYBE;
alt_status tmp_75_alt_flag_2 = ALT_MAYBE;
alt_status tmp_75_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_75_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(264);
/* BTS_Tests_VAMOS.ttcn, line 264 */
tmp_75_alt_flag_0 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__MODE__MODIFY__ACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr)), NULL, any_compref, NULL, NULL, NULL);
if (tmp_75_alt_flag_0 == ALT_YES) {
current_location.update_lineno(264);
/* BTS_Tests_VAMOS.ttcn, line 264 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_75_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(265);
/* BTS_Tests_VAMOS.ttcn, line 265 */
tmp_75_alt_flag_1 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__MODE__MODIFY__NACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Types::RSL__Cause_template(ANY_VALUE)), NULL, any_compref, NULL, NULL, NULL);
if (tmp_75_alt_flag_1 == ALT_YES) {
current_location.update_lineno(266);
/* BTS_Tests_VAMOS.ttcn, line 266 */
Misc__Helpers::f__shutdown(cs_0, 266, FAIL, cs_1);
break;
}
}
if (tmp_75_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(269);
/* BTS_Tests_VAMOS.ttcn, line 269 */
tmp_75_alt_flag_2 = T.timeout(NULL);
if (tmp_75_alt_flag_2 == ALT_YES) {
current_location.update_lineno(270);
/* BTS_Tests_VAMOS.ttcn, line 270 */
Misc__Helpers::f__shutdown(cs_0, 270, FAIL, cs_2);
break;
}
}
if (tmp_75_default_flag == ALT_MAYBE) {
tmp_75_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_75_default_flag == ALT_YES || tmp_75_default_flag == ALT_BREAK) break;
else if (tmp_75_default_flag == ALT_REPEAT) goto tmp_75;
}
current_location.update_lineno(263);
/* BTS_Tests_VAMOS.ttcn, line 263 */
if (tmp_75_alt_flag_0 == ALT_NO && tmp_75_alt_flag_1 == ALT_NO && tmp_75_alt_flag_2 == ALT_NO && tmp_75_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests_VAMOS.ttcn between lines 263 and 273.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(276);
/* BTS_Tests_VAMOS.ttcn, line 276 */
BTS__Tests::f__rsl__chan__deact();
current_location.update_lineno(277);
/* BTS_Tests_VAMOS.ttcn, line 277 */
RSL__Emulation::f__rslem__unregister(0, GSM__Types::RslChannelNr(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Emulation::RSL__DchanHdlr_component_RSL__PROC);
}

void start_f__TC__vamos__chan__mode__modify(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_vamos_chan_mode_modify(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests_VAMOS", "f_TC_vamos_chan_mode_modify", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__vamos__chan__mode__modify__vff(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 281, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_mode_modify_vff");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_mode_modify_vff", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(282);
/* BTS_Tests_VAMOS.ttcn, line 282 */
ChanNrModeTest test(ChanNrModeTestVFF(1).valueof());
current_location.update_lineno(283);
/* BTS_Tests_VAMOS.ttcn, line 283 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__mode__modify);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_mode_modify_vff was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__mode__modify__dyn__ipa__vff(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 285, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_mode_modify_dyn_ipa_vff");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_mode_modify_dyn_ipa_vff", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(286);
/* BTS_Tests_VAMOS.ttcn, line 286 */
ChanNrModeTest test(ChanNrModeTestVFF(3).valueof());
current_location.update_lineno(287);
/* BTS_Tests_VAMOS.ttcn, line 287 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__mode__modify);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_mode_modify_dyn_ipa_vff was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__mode__modify__dyn__osmo__vff(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 289, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_mode_modify_dyn_osmo_vff");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_mode_modify_dyn_osmo_vff", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(290);
/* BTS_Tests_VAMOS.ttcn, line 290 */
ChanNrModeTest test(ChanNrModeTestVFF(4).valueof());
current_location.update_lineno(291);
/* BTS_Tests_VAMOS.ttcn, line 291 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__mode__modify);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_mode_modify_dyn_osmo_vff was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__mode__modify__vhh(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 295, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_mode_modify_vhh");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_mode_modify_vhh", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(296);
/* BTS_Tests_VAMOS.ttcn, line 296 */
ChanNrModeTest test(ChanNrModeTestVHH(5).valueof());
current_location.update_lineno(297);
/* BTS_Tests_VAMOS.ttcn, line 297 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__mode__modify);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_mode_modify_vhh was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__mode__modify__dyn__osmo__vhh(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 299, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_mode_modify_dyn_osmo_vhh");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_mode_modify_dyn_osmo_vhh", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(300);
/* BTS_Tests_VAMOS.ttcn, line 300 */
ChanNrModeTest test(ChanNrModeTestVHH(4).valueof());
current_location.update_lineno(301);
/* BTS_Tests_VAMOS.ttcn, line 301 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__mode__modify);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_mode_modify_dyn_osmo_vhh was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__mode__modify__hvhh(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 305, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_mode_modify_hvhh");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_mode_modify_hvhh", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(306);
/* BTS_Tests_VAMOS.ttcn, line 306 */
ChanNrModeTest test(ChanNrModeTestHVHH(5).valueof());
current_location.update_lineno(307);
/* BTS_Tests_VAMOS.ttcn, line 307 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__mode__modify);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_mode_modify_hvhh was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__vamos__chan__mode__modify__dyn__osmo__hvhh(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 309, TTCN_Location::LOCATION_TESTCASE, "TC_vamos_chan_mode_modify_dyn_osmo_hvhh");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_VAMOS", "TC_vamos_chan_mode_modify_dyn_osmo_hvhh", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(310);
/* BTS_Tests_VAMOS.ttcn, line 310 */
ChanNrModeTest test(ChanNrModeTestHVHH(4).valueof());
current_location.update_lineno(311);
/* BTS_Tests_VAMOS.ttcn, line 311 */
f__TC__vamos__exec__async(test, &f__TC__vamos__chan__mode__modify);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_vamos_chan_mode_modify_dyn_osmo_hvhh was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void module_control_part()
{
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 314, TTCN_Location::LOCATION_CONTROLPART, "BTS_Tests_VAMOS");
TTCN_Runtime::begin_controlpart("BTS_Tests_VAMOS");
TTCN_ControlPartEnder ender_("BTS_Tests_VAMOS");
current_location.update_lineno(316);
/* BTS_Tests_VAMOS.ttcn, line 316 */
testcase_TC__vamos__chan__act__vff(FALSE, 0.0);
current_location.update_lineno(317);
/* BTS_Tests_VAMOS.ttcn, line 317 */
testcase_TC__vamos__chan__act__vhh(FALSE, 0.0);
current_location.update_lineno(318);
/* BTS_Tests_VAMOS.ttcn, line 318 */
testcase_TC__vamos__chan__act__hvhh(FALSE, 0.0);
current_location.update_lineno(319);
/* BTS_Tests_VAMOS.ttcn, line 319 */
testcase_TC__vamos__chan__act__dyn__ipa__vff(FALSE, 0.0);
current_location.update_lineno(320);
/* BTS_Tests_VAMOS.ttcn, line 320 */
testcase_TC__vamos__chan__act__dyn__osmo__vff(FALSE, 0.0);
current_location.update_lineno(321);
/* BTS_Tests_VAMOS.ttcn, line 321 */
testcase_TC__vamos__chan__act__dyn__osmo__vhh(FALSE, 0.0);
current_location.update_lineno(322);
/* BTS_Tests_VAMOS.ttcn, line 322 */
testcase_TC__vamos__chan__act__dyn__osmo__hvhh(FALSE, 0.0);
current_location.update_lineno(325);
/* BTS_Tests_VAMOS.ttcn, line 325 */
testcase_TC__vamos__chan__mode__modify__vff(FALSE, 0.0);
current_location.update_lineno(326);
/* BTS_Tests_VAMOS.ttcn, line 326 */
testcase_TC__vamos__chan__mode__modify__vhh(FALSE, 0.0);
current_location.update_lineno(327);
/* BTS_Tests_VAMOS.ttcn, line 327 */
testcase_TC__vamos__chan__mode__modify__hvhh(FALSE, 0.0);
current_location.update_lineno(328);
/* BTS_Tests_VAMOS.ttcn, line 328 */
testcase_TC__vamos__chan__mode__modify__dyn__ipa__vff(FALSE, 0.0);
current_location.update_lineno(329);
/* BTS_Tests_VAMOS.ttcn, line 329 */
testcase_TC__vamos__chan__mode__modify__dyn__osmo__vff(FALSE, 0.0);
current_location.update_lineno(330);
/* BTS_Tests_VAMOS.ttcn, line 330 */
testcase_TC__vamos__chan__mode__modify__dyn__osmo__vhh(FALSE, 0.0);
current_location.update_lineno(331);
/* BTS_Tests_VAMOS.ttcn, line 331 */
testcase_TC__vamos__chan__mode__modify__dyn__osmo__hvhh(FALSE, 0.0);
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "BTS_Tests_VAMOS");
BTS__Tests::module_object.pre_init_module();
module_object.add_function("f_TC_vamos_exec_async", (genericfunc_t)&f__TC__vamos__exec__async, (genericfunc_t)&start_f__TC__vamos__exec__async);
module_object.add_function("f_TC_vamos_chan_act", (genericfunc_t)&f__TC__vamos__chan__act, (genericfunc_t)&start_f__TC__vamos__chan__act);
module_object.add_testcase_nonpard("TC_vamos_chan_act_vff", testcase_TC__vamos__chan__act__vff);
module_object.add_testcase_nonpard("TC_vamos_chan_act_dyn_ipa_vff", testcase_TC__vamos__chan__act__dyn__ipa__vff);
module_object.add_testcase_nonpard("TC_vamos_chan_act_dyn_osmo_vff", testcase_TC__vamos__chan__act__dyn__osmo__vff);
module_object.add_testcase_nonpard("TC_vamos_chan_act_vhh", testcase_TC__vamos__chan__act__vhh);
module_object.add_testcase_nonpard("TC_vamos_chan_act_dyn_osmo_vhh", testcase_TC__vamos__chan__act__dyn__osmo__vhh);
module_object.add_testcase_nonpard("TC_vamos_chan_act_hvhh", testcase_TC__vamos__chan__act__hvhh);
module_object.add_testcase_nonpard("TC_vamos_chan_act_dyn_osmo_hvhh", testcase_TC__vamos__chan__act__dyn__osmo__hvhh);
module_object.add_function("f_TC_vamos_chan_mode_modify", (genericfunc_t)&f__TC__vamos__chan__mode__modify, (genericfunc_t)&start_f__TC__vamos__chan__mode__modify);
module_object.add_testcase_nonpard("TC_vamos_chan_mode_modify_vff", testcase_TC__vamos__chan__mode__modify__vff);
module_object.add_testcase_nonpard("TC_vamos_chan_mode_modify_dyn_ipa_vff", testcase_TC__vamos__chan__mode__modify__dyn__ipa__vff);
module_object.add_testcase_nonpard("TC_vamos_chan_mode_modify_dyn_osmo_vff", testcase_TC__vamos__chan__mode__modify__dyn__osmo__vff);
module_object.add_testcase_nonpard("TC_vamos_chan_mode_modify_vhh", testcase_TC__vamos__chan__mode__modify__vhh);
module_object.add_testcase_nonpard("TC_vamos_chan_mode_modify_dyn_osmo_vhh", testcase_TC__vamos__chan__mode__modify__dyn__osmo__vhh);
module_object.add_testcase_nonpard("TC_vamos_chan_mode_modify_hvhh", testcase_TC__vamos__chan__mode__modify__hvhh);
module_object.add_testcase_nonpard("TC_vamos_chan_mode_modify_dyn_osmo_hvhh", testcase_TC__vamos__chan__mode__modify__dyn__osmo__hvhh);
}

void post_init_module()
{
TTCN_Location current_location("BTS_Tests_VAMOS.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "BTS_Tests_VAMOS");
BTS__Tests::module_object.post_init_module();
current_location.update_lineno(152);
/* BTS_Tests_VAMOS.ttcn, line 152 */
template_ts__RSL__IE__OsmoTSC.iei() = RSL__Types::RSL__IE__Type::RSL__IE__OSMO__TRAINING__SEQUENCE;
{
RSL__Types::RSL__IE__OSMO__TrainingSequence_template& tmp_48 = template_ts__RSL__IE__OsmoTSC.body().osmo__training__sequence();
tmp_48.len() = 0;
tmp_48.tsc__set() = Osmocom__Types::f__rnd__int(4);
tmp_48.tsc() = Osmocom__Types::f__rnd__int(8);
}
}

boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments)
{
if (!strcmp(function_name, "f_TC_vamos_exec_async")) {
ChanNrModeTest test;
BTS__Tests::void__fn handler;
test.decode_text(function_arguments);
handler.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_vamos_exec_async(");
test.log();
TTCN_Logger::log_event_str(", ");
handler.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__TC__vamos__exec__async(test, handler);
TTCN_Runtime::function_finished("f_TC_vamos_exec_async");
return TRUE;
} else if (!strcmp(function_name, "f_TC_vamos_chan_act")) {
CHARSTRING id;
id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_vamos_chan_act(");
id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__TC__vamos__chan__act(id);
TTCN_Runtime::function_finished("f_TC_vamos_chan_act");
return TRUE;
} else if (!strcmp(function_name, "f_TC_vamos_chan_mode_modify")) {
CHARSTRING id;
id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_vamos_chan_mode_modify(");
id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__TC__vamos__chan__mode__modify(id);
TTCN_Runtime::function_finished("f_TC_vamos_chan_mode_modify");
return TRUE;
} else return FALSE;
}


} /* end of namespace */
