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

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

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

#ifndef IPA__CodecPort_HH
#define IPA__CodecPort_HH

#ifdef TITAN_RUNTIME_2
#error Generated code does not match with used runtime.\
 Code was generated without -R option but -DTITAN_RUNTIME_2 was used.
#endif

/* Header file includes */

#include <TTCN3.hh>
#include "IPL4asp_PortType.hh"
#include "IPA_Types.hh"

#if TTCN3_VERSION != 90000
#error Version mismatch detected.\
 Please check the version of the TTCN-3 compiler and the base library.\
 Run make clean and rebuild the project if the version of the compiler changed recently.
#endif

#ifndef LINUX
#error This file should be compiled on LINUX
#endif

#undef IPA__CodecPort_HH
#endif

namespace IPA__CodecPort {

/* Forward declarations of classes */

class IPA__RecvFrom;
class IPA__RecvFrom_template;
class IPA__Send;
class IPA__Send_template;
class IPA__CODEC__PT;

} /* end of namespace */

#ifndef IPA__CodecPort_HH
#define IPA__CodecPort_HH

namespace IPA__CodecPort {

/* Class definitions */

class IPA__RecvFrom {
  INTEGER field_connId;
  IPA__Types::IpaStreamId field_streamId;
  OPTIONAL< IPA__Types::IpaExtStreamId > field_streamIdExt;
  OCTETSTRING field_msg;
public:
  IPA__RecvFrom();
  IPA__RecvFrom(const INTEGER& par_connId,
    const IPA__Types::IpaStreamId& par_streamId,
    const OPTIONAL< IPA__Types::IpaExtStreamId >& par_streamIdExt,
    const OCTETSTRING& par_msg);
  IPA__RecvFrom(const IPA__RecvFrom& other_value);
  inline boolean is_component() { return FALSE; }
  void clean_up();
const TTCN_Typedescriptor_t* get_descriptor() const;
  IPA__RecvFrom& operator=(const IPA__RecvFrom& other_value);
  boolean operator==(const IPA__RecvFrom& other_value) const;
  inline boolean operator!=(const IPA__RecvFrom& other_value) const
    { return !(*this == other_value); }

  boolean is_bound() const;

inline boolean is_present() const { return is_bound(); }
  boolean is_value() const;

  inline INTEGER& connId()
    {return field_connId;}
  inline const INTEGER& connId() const
    {return field_connId;}
  inline IPA__Types::IpaStreamId& streamId()
    {return field_streamId;}
  inline const IPA__Types::IpaStreamId& streamId() const
    {return field_streamId;}
  inline OPTIONAL< IPA__Types::IpaExtStreamId >& streamIdExt()
    {return field_streamIdExt;}
  inline const OPTIONAL< IPA__Types::IpaExtStreamId >& streamIdExt() const
    {return field_streamIdExt;}
  inline OCTETSTRING& msg()
    {return field_msg;}
  inline const OCTETSTRING& msg() const
    {return field_msg;}
  int size_of() const;
  void log() const;
  void set_implicit_omit();
  void set_param(Module_Param& param);
  void encode_text(Text_Buf& text_buf) const;
  void decode_text(Text_Buf& text_buf);
};

class IPA__RecvFrom_template : public Base_Template {
struct single_value_struct;
union {
single_value_struct *single_value;
struct {
unsigned int n_values;
IPA__RecvFrom_template *list_value;
} value_list;
struct {
IPA__RecvFrom_template* precondition;
IPA__RecvFrom_template* implied_template;
} implication_;
dynmatch_struct<IPA__RecvFrom>* dyn_match;
};

void set_specific();
void copy_value(const IPA__RecvFrom& other_value);
void copy_template(const IPA__RecvFrom_template& other_value);

public:
IPA__RecvFrom_template();
IPA__RecvFrom_template(template_sel other_value);
IPA__RecvFrom_template(const IPA__RecvFrom& other_value);
IPA__RecvFrom_template(const OPTIONAL<IPA__RecvFrom>& other_value);
IPA__RecvFrom_template(IPA__RecvFrom_template* p_precondition, IPA__RecvFrom_template* p_implied_template);
IPA__RecvFrom_template(Dynamic_Match_Interface<IPA__RecvFrom>* p_dyn_match);
IPA__RecvFrom_template(const IPA__RecvFrom_template& other_value);
~IPA__RecvFrom_template();
IPA__RecvFrom_template& operator=(template_sel other_value);
IPA__RecvFrom_template& operator=(const IPA__RecvFrom& other_value);
IPA__RecvFrom_template& operator=(const OPTIONAL<IPA__RecvFrom>& other_value);
IPA__RecvFrom_template& operator=(const IPA__RecvFrom_template& other_value);
boolean match(const IPA__RecvFrom& other_value, boolean legacy = FALSE) const;
boolean is_bound() const;
boolean is_value() const;
void clean_up();
IPA__RecvFrom valueof() const;
void set_type(template_sel template_type, unsigned int list_length);
IPA__RecvFrom_template& list_item(unsigned int list_index) const;
INTEGER_template& connId();
const INTEGER_template& connId() const;
IPA__Types::IpaStreamId_template& streamId();
const IPA__Types::IpaStreamId_template& streamId() const;
IPA__Types::IpaExtStreamId_template& streamIdExt();
const IPA__Types::IpaExtStreamId_template& streamIdExt() const;
OCTETSTRING_template& msg();
const OCTETSTRING_template& msg() const;
int size_of() const;
void log() const;
void log_match(const IPA__RecvFrom& match_value, boolean legacy = FALSE) const;
void encode_text(Text_Buf& text_buf) const;
void decode_text(Text_Buf& text_buf);
void set_param(Module_Param& param);
void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const;
boolean is_present(boolean legacy = FALSE) const;
boolean match_omit(boolean legacy = FALSE) const;
};

class IPA__Send {
  INTEGER field_connId;
  IPA__Types::IpaStreamId field_streamId;
  OPTIONAL< IPA__Types::IpaExtStreamId > field_streamIdExt;
  OCTETSTRING field_msg;
public:
  IPA__Send();
  IPA__Send(const INTEGER& par_connId,
    const IPA__Types::IpaStreamId& par_streamId,
    const OPTIONAL< IPA__Types::IpaExtStreamId >& par_streamIdExt,
    const OCTETSTRING& par_msg);
  IPA__Send(const IPA__Send& other_value);
  inline boolean is_component() { return FALSE; }
  void clean_up();
const TTCN_Typedescriptor_t* get_descriptor() const;
  IPA__Send& operator=(const IPA__Send& other_value);
  boolean operator==(const IPA__Send& other_value) const;
  inline boolean operator!=(const IPA__Send& other_value) const
    { return !(*this == other_value); }

  boolean is_bound() const;

inline boolean is_present() const { return is_bound(); }
  boolean is_value() const;

  inline INTEGER& connId()
    {return field_connId;}
  inline const INTEGER& connId() const
    {return field_connId;}
  inline IPA__Types::IpaStreamId& streamId()
    {return field_streamId;}
  inline const IPA__Types::IpaStreamId& streamId() const
    {return field_streamId;}
  inline OPTIONAL< IPA__Types::IpaExtStreamId >& streamIdExt()
    {return field_streamIdExt;}
  inline const OPTIONAL< IPA__Types::IpaExtStreamId >& streamIdExt() const
    {return field_streamIdExt;}
  inline OCTETSTRING& msg()
    {return field_msg;}
  inline const OCTETSTRING& msg() const
    {return field_msg;}
  int size_of() const;
  void log() const;
  void set_implicit_omit();
  void set_param(Module_Param& param);
  void encode_text(Text_Buf& text_buf) const;
  void decode_text(Text_Buf& text_buf);
};

class IPA__Send_template : public Base_Template {
struct single_value_struct;
union {
single_value_struct *single_value;
struct {
unsigned int n_values;
IPA__Send_template *list_value;
} value_list;
struct {
IPA__Send_template* precondition;
IPA__Send_template* implied_template;
} implication_;
dynmatch_struct<IPA__Send>* dyn_match;
};

void set_specific();
void copy_value(const IPA__Send& other_value);
void copy_template(const IPA__Send_template& other_value);

public:
IPA__Send_template();
IPA__Send_template(template_sel other_value);
IPA__Send_template(const IPA__Send& other_value);
IPA__Send_template(const OPTIONAL<IPA__Send>& other_value);
IPA__Send_template(IPA__Send_template* p_precondition, IPA__Send_template* p_implied_template);
IPA__Send_template(Dynamic_Match_Interface<IPA__Send>* p_dyn_match);
IPA__Send_template(const IPA__Send_template& other_value);
~IPA__Send_template();
IPA__Send_template& operator=(template_sel other_value);
IPA__Send_template& operator=(const IPA__Send& other_value);
IPA__Send_template& operator=(const OPTIONAL<IPA__Send>& other_value);
IPA__Send_template& operator=(const IPA__Send_template& other_value);
boolean match(const IPA__Send& other_value, boolean legacy = FALSE) const;
boolean is_bound() const;
boolean is_value() const;
void clean_up();
IPA__Send valueof() const;
void set_type(template_sel template_type, unsigned int list_length);
IPA__Send_template& list_item(unsigned int list_index) const;
INTEGER_template& connId();
const INTEGER_template& connId() const;
IPA__Types::IpaStreamId_template& streamId();
const IPA__Types::IpaStreamId_template& streamId() const;
IPA__Types::IpaExtStreamId_template& streamIdExt();
const IPA__Types::IpaExtStreamId_template& streamIdExt() const;
OCTETSTRING_template& msg();
const OCTETSTRING_template& msg() const;
int size_of() const;
void log() const;
void log_match(const IPA__Send& match_value, boolean legacy = FALSE) const;
void encode_text(Text_Buf& text_buf) const;
void decode_text(Text_Buf& text_buf);
void set_param(Module_Param& param);
void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const;
boolean is_present(boolean legacy = FALSE) const;
boolean match_omit(boolean legacy = FALSE) const;
};

class IPA__CODEC__PT : public IPL4asp__PortType::IPL4asp__PT_PROVIDER {
enum msg_selection { MESSAGE_0, MESSAGE_1, MESSAGE_2 };
struct msg_queue_item : public msg_queue_item_base {
msg_selection item_selection;
union {
IPA__RecvFrom *message_0;
IPL4asp__Types::ASP__ConnId__ReadyToRelease *message_1;
Socket__API__Definitions::PortEvent *message_2;
};
component sender_component;
};

void remove_msg_queue_head();
protected:
void clear_queue();
public:
IPA__CODEC__PT(const char *par_port_name = NULL);
~IPA__CODEC__PT();
void send(const IPA__Send& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect = NULL);
void send(const IPA__Send& send_par, FLOAT* timestamp_redirect = NULL);
void send(const IPA__Send_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect = NULL);
void send(const IPA__Send_template& send_par, FLOAT* timestamp_redirect = NULL);
public:
PORT* get_provider_port();
public:
alt_status receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status check_receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status trigger(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status receive(const IPA__RecvFrom_template& value_template, IPA__RecvFrom *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status check_receive(const IPA__RecvFrom_template& value_template, IPA__RecvFrom *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status trigger(const IPA__RecvFrom_template& value_template, IPA__RecvFrom *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status receive(const IPL4asp__Types::ASP__ConnId__ReadyToRelease_template& value_template, IPL4asp__Types::ASP__ConnId__ReadyToRelease *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status check_receive(const IPL4asp__Types::ASP__ConnId__ReadyToRelease_template& value_template, IPL4asp__Types::ASP__ConnId__ReadyToRelease *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status trigger(const IPL4asp__Types::ASP__ConnId__ReadyToRelease_template& value_template, IPL4asp__Types::ASP__ConnId__ReadyToRelease *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status receive(const Socket__API__Definitions::PortEvent_template& value_template, Socket__API__Definitions::PortEvent *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status check_receive(const Socket__API__Definitions::PortEvent_template& value_template, Socket__API__Definitions::PortEvent *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
alt_status trigger(const Socket__API__Definitions::PortEvent_template& value_template, Socket__API__Definitions::PortEvent *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*);
private:
void incoming_message(const IPL4asp__Types::ASP__RecvFrom& incoming_par, component sender_component);
void incoming_message(const Socket__API__Definitions::PortEvent& incoming_par, component sender_component);
void incoming_message(const IPL4asp__Types::ASP__ConnId__ReadyToRelease& incoming_par, component sender_component);
protected:
void incoming_message(const IPL4asp__Types::ASP__RecvFrom& incoming_par);
void incoming_message(const Socket__API__Definitions::PortEvent& incoming_par);
void incoming_message(const IPL4asp__Types::ASP__ConnId__ReadyToRelease& incoming_par);
boolean process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING& slider);
};


/* Function prototypes */

extern IPA__Send_template t__IPA__Send(const INTEGER& conn__id, const IPA__Types::IpaStreamId& stream__id, const OCTETSTRING& msg, const IPA__Types::IpaExtStreamId_template& stream__id__ext);
extern void IPL4__to__IPA__RecvFrom(const IPL4asp__Types::ASP__RecvFrom& pin, IPA__RecvFrom& pout);
extern void IPA__to__IPL4__Send(const IPA__Send& pin, IPL4asp__Types::ASP__Send& pout);
extern void pre_init_module();
extern void post_init_module();

/* Global variable declarations */

extern const XERdescriptor_t IPA__RecvFrom_connId_xer_;
extern const TTCN_Typedescriptor_t IPA__RecvFrom_connId_descr_;
extern UNIVERSAL_CHARSTRING IPA__RecvFrom_streamId_default_coding;
extern const XERdescriptor_t IPA__RecvFrom_msg_xer_;
extern const TTCN_OERdescriptor_t IPA__RecvFrom_msg_oer_;
extern const TTCN_Typedescriptor_t IPA__RecvFrom_msg_descr_;
extern const TTCN_Typedescriptor_t IPA__RecvFrom_descr_;
extern UNIVERSAL_CHARSTRING IPA__RecvFrom_streamIdExt_default_coding;
extern const XERdescriptor_t IPA__Send_connId_xer_;
extern const TTCN_OERdescriptor_t IPA__Send_connId_oer_;
extern const TTCN_Typedescriptor_t IPA__Send_connId_descr_;
extern UNIVERSAL_CHARSTRING IPA__Send_streamId_default_coding;
extern const XERdescriptor_t IPA__Send_msg_xer_;
extern const TTCN_OERdescriptor_t IPA__Send_msg_oer_;
extern const TTCN_Typedescriptor_t IPA__Send_msg_descr_;
extern const TTCN_Typedescriptor_t IPA__Send_descr_;
extern UNIVERSAL_CHARSTRING IPA__Send_streamIdExt_default_coding;
extern const IPA__Types::IpaExtStreamId_template& t__IPA__Send_stream__id__ext_defval;
extern IPA__Types::IpaExtStreamId_template template_t__IPA__Send_stream__id__ext_defval;
extern const unsigned char module_checksum[];
extern TTCN_Module module_object;
extern const RuntimeVersionChecker ver_checker;

} /* end of namespace */

#endif
