// This C++ header 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. #ifndef Mutex_HH #define Mutex_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 #include "Misc_Helpers.hh" #if TTCN3_VERSION != 110100 #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 Mutex_HH #endif namespace Mutex { /* Forward declarations of classes */ class MutexPT; class MUTEX__LOCK_call; class MUTEX__LOCK_call_redirect; class MUTEX__LOCK_reply; class MUTEX__LOCK_reply_redirect; class MUTEX__LOCK_template; class MUTEX__UNLOCK_call; class MUTEX__UNLOCK_call_redirect; class MUTEX__UNLOCK_template; } /* end of namespace */ #ifndef Mutex_HH #define Mutex_HH namespace Mutex { /* Type definitions */ typedef COMPONENT MutexCT; typedef COMPONENT_template MutexCT_template; typedef COMPONENT MutexDispCT; typedef COMPONENT_template MutexDispCT_template; typedef COMPONENT TestCT; typedef COMPONENT_template TestCT_template; typedef COMPONENT TestChildCT; typedef COMPONENT_template TestChildCT_template; /* Class definitions */ class MutexPT : public PORT { enum proc_selection { CALL_0, CALL_1, REPLY_0 }; struct proc_queue_item { proc_selection item_selection; union { MUTEX__LOCK_call *call_0; MUTEX__UNLOCK_call *call_1; MUTEX__LOCK_reply *reply_0; }; component sender_component; proc_queue_item *next_item; } *proc_queue_head, *proc_queue_tail; void append_to_proc_queue(proc_queue_item *new_item); void remove_proc_queue_head(); protected: void clear_queue(); public: MutexPT(const char *par_port_name = NULL); ~MutexPT(); void call(const MUTEX__LOCK_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect = NULL); void call(const MUTEX__LOCK_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect = NULL); void call(const MUTEX__LOCK_template& call_template, boolean broadcast = FALSE, FLOAT* timestamp_redirect = NULL); void call(const MUTEX__UNLOCK_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect = NULL); void call(const MUTEX__UNLOCK_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect = NULL); void call(const MUTEX__UNLOCK_template& call_template, boolean broadcast = FALSE, FLOAT* timestamp_redirect = NULL); void reply(const MUTEX__LOCK_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect = NULL); void reply(const MUTEX__LOCK_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect = NULL); void reply(const MUTEX__LOCK_template& reply_template, boolean broadcast = FALSE, FLOAT* timestamp_redirect = NULL); public: alt_status getcall(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*); alt_status check_getcall(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*); alt_status getcall(const MUTEX__LOCK_template& getcall_template, const COMPONENT_template& sender_template, const MUTEX__LOCK_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*); alt_status check_getcall(const MUTEX__LOCK_template& getcall_template, const COMPONENT_template& sender_template, const MUTEX__LOCK_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*); alt_status getcall(const MUTEX__UNLOCK_template& getcall_template, const COMPONENT_template& sender_template, const MUTEX__UNLOCK_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*); alt_status check_getcall(const MUTEX__UNLOCK_template& getcall_template, const COMPONENT_template& sender_template, const MUTEX__UNLOCK_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*); alt_status getreply(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*); alt_status check_getreply(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*); alt_status getreply(const MUTEX__LOCK_template& getreply_template, const COMPONENT_template& sender_template, const MUTEX__LOCK_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*); alt_status check_getreply(const MUTEX__LOCK_template& getreply_template, const COMPONENT_template& sender_template, const MUTEX__LOCK_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*); private: void incoming_call(const MUTEX__LOCK_call& incoming_par, component sender_component); void incoming_call(const MUTEX__UNLOCK_call& incoming_par, component sender_component); void incoming_reply(const MUTEX__LOCK_reply& incoming_par, component sender_component); protected: boolean process_call(const char *signature_name, Text_Buf& incoming_buf, component sender_component); boolean process_reply(const char *signature_name, Text_Buf& incoming_buf, component sender_component); }; class MUTEX__LOCK_call { public: inline void encode_text(Text_Buf&) const { } inline void decode_text(Text_Buf&) { } void log() const; }; class MUTEX__LOCK_call_redirect { public: inline void set_parameters(const MUTEX__LOCK_call&) const { } }; class MUTEX__LOCK_reply { INTEGER param_ref; public: inline INTEGER& ref() { return param_ref; } inline const INTEGER& ref() const { return param_ref; } void encode_text(Text_Buf& text_buf) const; void decode_text(Text_Buf& text_buf); void log() const; }; class MUTEX__LOCK_reply_redirect { INTEGER *ptr_ref; public: MUTEX__LOCK_reply_redirect(INTEGER *par_ref = NULL) : ptr_ref(par_ref) { } virtual ~MUTEX__LOCK_reply_redirect() { } virtual void set_parameters(const MUTEX__LOCK_reply& reply_par) const; }; class MUTEX__LOCK_template { INTEGER_template param_ref; public: MUTEX__LOCK_template(); inline INTEGER_template& ref() { return param_ref; } inline const INTEGER_template& ref() const { return param_ref; } inline MUTEX__LOCK_call create_call() const { return MUTEX__LOCK_call(); } MUTEX__LOCK_reply create_reply() const; inline boolean match_call(const MUTEX__LOCK_call&, boolean legacy = FALSE) const { return TRUE; } boolean match_reply(const MUTEX__LOCK_reply& match_value, boolean legacy = FALSE) const; void log() const; void log_match_call(const MUTEX__LOCK_call& match_value, boolean legacy = FALSE) const; void log_match_reply(const MUTEX__LOCK_reply& match_value, boolean legacy = FALSE) const; void encode_text(Text_Buf& text_buf) const; void decode_text(Text_Buf& text_buf); }; class MUTEX__UNLOCK_call { INTEGER param_ref; public: inline INTEGER& ref() { return param_ref; } inline const INTEGER& ref() const { return param_ref; } void encode_text(Text_Buf& text_buf) const; void decode_text(Text_Buf& text_buf); void log() const; }; class MUTEX__UNLOCK_call_redirect { INTEGER *ptr_ref; public: MUTEX__UNLOCK_call_redirect(INTEGER *par_ref = NULL) : ptr_ref(par_ref) { } virtual ~MUTEX__UNLOCK_call_redirect() { } virtual void set_parameters(const MUTEX__UNLOCK_call& call_par) const; }; class MUTEX__UNLOCK_template { INTEGER_template param_ref; public: MUTEX__UNLOCK_template(); inline INTEGER_template& ref() { return param_ref; } inline const INTEGER_template& ref() const { return param_ref; } MUTEX__UNLOCK_call create_call() const; boolean match_call(const MUTEX__UNLOCK_call& match_value, boolean legacy = FALSE) const; void log() const; void log_match_call(const MUTEX__UNLOCK_call& match_value, boolean legacy = FALSE) const; void encode_text(Text_Buf& text_buf) const; void decode_text(Text_Buf& text_buf); }; /* Function prototypes */ extern void f__MutexDisp__main(); extern void start_f__MutexDisp__main(const COMPONENT& component_reference); extern COMPONENT f__MutexDisp__start(); extern void f__MutexDisp__connect(const COMPONENT& vc__disp, const COMPONENT& vc__conn); extern void f__Mutex__lock(const CHARSTRING& file, const INTEGER& line, const FLOAT& Tval); extern void start_f__Mutex__lock(const COMPONENT& component_reference, const CHARSTRING& file, const INTEGER& line, const FLOAT& Tval); extern void f__Mutex__unlock(const CHARSTRING& file, const INTEGER& line); extern void start_f__Mutex__unlock(const COMPONENT& component_reference, const CHARSTRING& file, const INTEGER& line); extern void f__TC__selftest(); extern void start_f__TC__selftest(const COMPONENT& component_reference); extern verdicttype testcase_TC__selftest(boolean has_timer, double timer_value); extern void pre_init_module(); extern void post_init_module(); extern boolean init_comp_type(const char *component_type, boolean init_base_comps); extern boolean init_system_port(const char* component_type, const char* port_name); extern boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments); /* Global variable declarations */ extern const TTCN_Typedescriptor_t& MutexCT_descr_; extern MutexPT MutexCT_component_LOCK; extern MutexPT MutexCT_component_UNLOCK; extern INTEGER MutexCT_component_g__mutex__ref; extern const TTCN_Typedescriptor_t& MutexDispCT_descr_; extern const FLOAT& f__Mutex__lock_Tval_defval; extern FLOAT const_f__Mutex__lock_Tval_defval; extern const TTCN_Typedescriptor_t& TestCT_descr_; extern const TTCN_Typedescriptor_t& TestChildCT_descr_; extern const CHARSTRING cs_0, cs_1, cs_2; extern const unsigned char module_checksum[]; extern TTCN_Module module_object; extern const RuntimeVersionChecker ver_checker; } /* end of namespace */ #endif