Commit 757ed646 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add templates to generate invoke_ri.c

parent 41659417
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the function
@_LOWER:Name_@_invoke_ri.c
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the function
@@-- @_Language_@ : The implementation language
@@-- @_List_Of_PIs_@ : List of all Provided Interfaces (just names)
@@-- @_List_Of_RIs_@ : List of all Required Interfaces (just names)
@@-- @_List_Of_Sync_PIs@ : List of synchronous Provided Interfaces
@@-- @_List_Of_Sync_RIs@ : List of synchronous Required Interfaces
@@-- @_Sync_RIs_Parent@ : ... and corresponding Parent function name
@@-- @_List_Of_ASync_PIs@ : List of asynchronous Provided Interfaces
@@-- @_List_Of_ASync_RIs@ : List of asynchronous Required Interfaces
@@-- @_Async_RIs_Parent@ : ... and corresponding Parent function name
@@-- @_ASN1_Modules_@ : List of ASN.1 Modules names
@@-- @_ASN1_Files_@ : List of ASN.1 Files with path
@@-- @_Timers_@ : List of timers (just names)
@@-- @_Has_Context_@ : Flag, True if there are context parameters
@@-- @_CP_Names_@ : List of Context Parameter names
@@-- @_CP_Types_@ : List of Context Parameter types
@@-- @_Provided_Interfaces_@ : From template: Provided interfaces with params
@@-- @_Required_Interfaces_@ : From template: Required interfaces with params
@@-- @_Property_Names_@ : List of User-defined properties (names)
@@-- @_Property_Values_@ : List of User-defined properties (values)
@@-- @_Is_Type_@ : Flag, True if function is a component type
@@-- @_Instance_Of_@ : Optional name of component type
/* Body file for function @_Name_@
* Generated by TASTE on @_NOW_@
* You can edit this file, it will not be overwritten
* Provided interfaces : @_List_Of_PIs_@
* Required interfaces : @_List_Of_RIs_@
* User-defined properties for this function:
@@TABLE@@
* |_ @_Property_Names_@ = @_Property_Values_@
@@END_TABLE@@
* Timers : @_Timers_@
*/
#include <stdlib.h>
#ifdef __unix__
// #include <stdio.h>
// #include "PrintTypesAsASN1.h"
// #include "timeInMS.h"
#endif
//#include "C_ASN1_Types.h"
#include "../../../dataview/C/dataview-uniq.h"
@@-- For blackbox devices, don't generate the RI code here, because their parameters are different
@@-- (they are already encoded, not using native ASN.1 types)
@@IF@@ @_Language_@ /= "Blackbox_C"
@@TABLE@@
@_Required_Interfaces_@
@@END_TABLE@@
@@END_IF@@
@@-- 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_@_RI_@_LOWER:Name_@
@@INLINE( \()(,\n )(\)\n)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
const asn1Scc@_REPLACE_ALL((-)/_):Param_Types_@ *IN_@_LOWER:Param_Names_@
@@ELSE@@
asn1Scc@_REPLACE_ALL((-)/_):Param_Types_@ *OUT_@_LOWER:Param_Names_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@
void @_LOWER:Parent_Function_@_RI_@_LOWER:Name_@(void)
@@END_IF@@
{
puts ("@_LOWER:Parent_Function_@_RI_@_LOWER:Name_@ called");
}
@@-- This template must return either TRUE or something else (meaning FALSE)
@@-- It is used to determine if the other templates in this folder will be
@@-- processed or ignored.
@@-- One folder can contain two templates: one for a function, and one for
@@-- a corresponding makefile (or build script)
@@-- The name of the function is read from template "function-filename.tmplt"
@@-- The name of the makefile is read from template "makefile-filename.tmplt"
@@-- These files are optional, if absent no error is raised
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the function
@@-- @_Is_Type_@ : True if function type
@@-- @_Instance_Of_@ : Name of instance or empty string
@@-- @_Language_@ : Implementation language for the function
@@-- @_Filename_Is_Present_@ : True if target function output already exists
@@-- @_Makefile_Is_Present_@ : True if target build script already exists
@@-- @_C_Middleware_@ : True if middleware is in C (e.g. PO-HI-C)
@@IF@@ not @_Is_Type_@ and (@_Language_@ = "C" or @_Language_@ = "GUI" or @_Language_@ = "Ada" or @_Language_@ = "VDM" or @_Language_@ = "QGenAda" or @_Language_@ = "QGenC" or @_Language_@ = "RTDS" or @_Language_@ = "CPP" or @_Language_@ = "SDL" or @_Language_@ = "Blackbox_C" or @_Language_@ = "MicroPython")
TRUE
@@END_IF@@
......@@ -23,7 +23,6 @@ dataviews:
; do cat $$f; echo; done > dataview/dataview-uniq.asn
@@END_INLINE@@
@@-- Then generate Dataviews once per target language
echo @_Unique_Languages_@
@@TABLE@@
@@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL"
@@SET@@ Lang=Ada
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment