Commit 39631e3b authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Work on instance support in c++

parent 5ec4f83f
@@-- 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
@_LOWER:Name_@.cc
@@-- 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
@@-- @_List_Of_ASync_PIs@ : List of asynchronous Provided Interfaces
@@-- @_List_Of_ASync_RIs@ : List of asynchronous Required Interfaces
@@-- @_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
/* C++ Body file for function type @_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 "@_LOWER:Name_@.h"
@@IF@@ @_Has_Context_@
// Include Context Parameters (constants defined in the Interface View)
#include "Context-@_REPLACE_ALL(_/-):LOWER:Name_@.h"
@@END_IF@@
void @_LOWER:Name_@_startup()
{
@_Name_@.startup();
}
@@TABLE@@
@_Provided_Interfaces_@
@@END_TABLE@@
@@-- 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
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@IF@@ @_Direction_@ = "PI"
@@INLINE@@
void @_LOWER:Parent_Function_@_PI_@_Name_@
@@IF@@ @_Param_Names'Length_@ > 0
@@INLINE(\()(, )(\))@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
const asn1Scc@_REPLACE_ALL((-)/_):Param_Types_@ *@_Param_Names_@
@@ELSE@@
asn1Scc@_REPLACE_ALL((-)/_):Param_Types_@ *@_Param_Names_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@ @@-- No params
()
@@END_IF@@
@@END_INLINE@@
{
@_Parent_Function_@.@_Name_@(@_Param_Names_@);
}
@@END_IF@@
@@-- 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
@@-- @_Zip_File_@ : Optional path to zip file
@@-- @_Use_POHIC_@ : Command line configuration
@@-- In addition all other command line configuration values are available
@@-- as well as all function attributes
@@IF@@ @_Language_@ = "CPP" and @_EXIST:Instance_Of_@
TRUE
@@END_IF@@
@@-- 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
@_LOWER:Name_@.h
@@-- 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
@@-- @_List_Of_ASync_PIs@ : List of asynchronous Provided Interfaces
@@-- @_List_Of_ASync_RIs@ : List of asynchronous Required Interfaces
@@-- @_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
/* C++ Function Instance
* Header file for function @_Name_@ in @_Language_@ language
* Generated by TASTE on @_NOW_@
* Context Parameters present : @_YES_NO:Has_Context_@
* Provided interfaces : @_List_Of_PIs_@
* Required interfaces : @_List_Of_RIs_@
* User-defined properties for this function:
@@TABLE@@
* |_ @_Property_Names_@ = @_Property_Values_@
@@END_TABLE@@
* DO NOT EDIT THIS FILE, IT WILL BE OVERWRITTEN DURING THE BUILD
*/
#pragma once
#include "dataview-uniq.h"
#include "@_LOWER:Instance_Of_@.h"
extern "C" {
// External declaration of required interfaces
@_Required_Interfaces_@
// Declaration of the function instance
@@IF@@ @_List_Of_RIs'Length_@ = 0 and @_Timers'Length_@ = 0
extern @_Instance_Of_@ @_Name_@();
@@ELSE@@
@@INLINE@@
extern @_Instance_Of_@ @_Name_@
@@INLINE(\()(, )(\);)@@
@@TABLE@@
@_LOWER:Name_@_RI_@_List_Of_RIs_@
@@END_TABLE@@
@@TABLE@@
@_LOWER:Name_@_RI_SET_@_Timers_@, @_LOWER:Name_@_RI_RESET_@_TImers_@
@@END_TABLE@@
@@END_INLINE@@
@@END_INLINE@@
@_Provided_Interfaces_@
}
@@-- 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
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@INLINE@@
@@IF@@ @_Direction_@ = "PI"
void @_LOWER:Parent_Function_@_PI_@_Name_@(
@@ELSE@@ @@-- RI
extern void @_LOWER:Parent_Function_@_RI_@_Name_@(
@@END_IF@@
@@INLINE(, )@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
const asn1Scc@_REPLACE_ALL((-)/_):Param_Types_@ *@_Param_Names_@
@@ELSE@@
asn1Scc@_REPLACE_ALL((-)/_):Param_Types_@ *@_Param_Names_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
);
@@END_INLINE@@
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the function
Makefile
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The function name
@@-- @_ASN1_Files_@ : List of all ASN.1 files
@@-- @_ASN1_Modules_@ : List of all ASN.1 modules
@@-- @_Is_Type_@ : Flag set to True for function type
@@-- @_Instance_Of_@ : Name of function type if instance
VISUAL?=kate
all: compile-linux
clean:
rm -rf obj
edit:
$(VISUAL) ../../dataview/C/dataview-uniq.h src/@_LOWER:Name_@.h src/@_LOWER:Name_@.cc
compile-linux:
mkdir -p obj && cd obj && g++ -c ../src/*.cc
@@-- 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@@ @_Language_@ = CPP and @_Instance_Of_@ /= ""
TRUE
@@END_IF@@
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