@@-- The following tags are available in this template: @@-- @@-- @_Name_@ : The name of the interface @@-- @_Direction_@ : "PI" or "RI" @@-- @_Kind_@ : The RCM Kind @@-- @_Parent_Function_@ : The name of the function @@-- @_Language_@ : The implementation language of the function @@-- @_Property_Names_@ : All AADL properties (names) associated to the function @@-- @_Property_Values_@ : ... and corresponding values @@-- @_Param_Names_@ : List of parameter names @@-- @_Param_Types_@ : |_ Corresponding parameter types @@-- @_Param_Directions_@ : |_ Corresponding direction @@-- @_Param_Encodings_@ : |_ Corresponding encoding (Default, Native, UPER, ACN) @@IF@@ @_EXIST:Param_Names_@ void @_LOWER:Parent_Function_@_@_LOWER:Name_@ @@INLINE( \()(,\n )(\)\n)@@ @@TABLE@@ @@IF@@ @_Param_Directions_@ = "PARAM_IN" void *IN_@_LOWER:Param_Names_@, size_t IN_@_LOWER:Param_Names_@_len @@ELSE@@ void *OUT_@_LOWER:Param_Names_@, size_t *OUT_@_LOWER:Param_Names_@_len @@END_IF@@ @@END_TABLE@@ @@END_INLINE@@ { @@TABLE@@ @@-- decode input parameters into static variables @@IF@@ @_Param_Directions_@ = "PARAM_IN" static asn1Scc@_REPLACE_ALL(-/_):Param_Types_@ IN_@_UPPER:Param_Names_@; @@ELSE@@ static asn1Scc@_REPLACE_ALL(-/_):Param_Types_@ OUT_@_UPPER:Param_Names_@; @@END_IF@@ #ifdef __unix__ @@IF@@ @_Param_Directions_@ = "PARAM_IN" asn1Scc@_REPLACE_ALL(-/_):Param_Types_@_Initialize(&IN_@_UPPER:Param_Names_@); @@ELSE@@ asn1Scc@_REPLACE_ALL(-/_):Param_Types_@_Initialize(&OUT_@_UPPER:Param_Names_@); @@END_IF@@ #endif @@IF@@ @_Param_Directions_@ = "PARAM_IN" if (0 != Decode_@_Param_Encodings_@_@_REPLACE_ALL(-/_):Param_Types_@ (&IN_@_UPPER:Param_Names_@, IN_@_LOWER:Param_Names_@, IN_@_LOWER:Param_Names_@_len)) { #ifdef __unix__ puts("Error decoding @_Param_Types_@ in function @_LOWER:Parent_Function_@_@_LOWER:Name_@"); #endif return; } @@END_IF@@ @@END_TABLE@@ // Declare user code function as external (it may not have a .h if it is in Ada) extern void @_LOWER:Parent_Function_@_PI_@_Name_@ @@INLINE( \()(,\n )(\);\n)@@ @@TABLE@@ @@IF@@ @_Param_Directions_@ = "PARAM_IN" const asn1Scc@_REPLACE_ALL(-/_):Param_Types_@ * @@ELSE@@ asn1Scc@_REPLACE_ALL(-/_):Param_Types_@ * @@END_IF@@ @@END_TABLE@@ @@END_INLINE@@ // Call user code @_LOWER:Parent_Function_@_PI_@_Name_@ @@INLINE( \()(,\n )(\);\n)@@ @@TABLE@@ @@IF@@ @_Param_Directions_@ = "PARAM_IN" &IN_@_UPPER:Param_Names_@ @@ELSE@@ &OUT_@_UPPER:Param_Names_@ @@END_IF@@ @@END_TABLE@@ @@END_INLINE@@ @@TABLE@@ @@-- encode output parameters @@IF@@ @_Param_Directions_@ = "PARAM_OUT" *OUT_@_LOWER:Param_Names_@_len = Encode_@_Param_Encodings_@_@_REPLACE_ALL(-/_):Param_Types_@ (OUT_@_LOWER:Param_Names_@, sizeof (asn1Scc@_REPLACE_ALL(-/_):Param_Types_@), &OUT_@_UPPER:Param_Names_@); @@END_IF@@ @@END_TABLE@@ } @@ELSE@@ @@-- parameterless functions void @_LOWER:Parent_Function_@_@_LOWER:Name_@() { // Directly call user code, no parameters to pass // This could be done directly from the concurrency glue... extern void @_LOWER:Parent_Function_@_PI_@_Name_@(void); @_LOWER:Parent_Function_@_PI_@_Name_@(); // puts ("@_LOWER:Parent_Function_@_@_LOWER:Name_@ called"); } @@END_IF@@