Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
ca620c5b
Commit
ca620c5b
authored
Aug 26, 2019
by
Maxime Perrotin
Browse files
Fix and improve templates
parent
2167e8a4
Changes
8
Hide whitespace changes
Inline
Side-by-side
templates/concurrency_view/pohic_wrappers_body/ri.tmplt
View file @
ca620c5b
...
...
@@ -56,7 +56,11 @@ size_IN_buf_@_LOWER:Param_Names_@;
@@END_TABLE@@
// calling threads: @_Calling_Threads_@ partition: @_Partition_Name_@
@@ELSIF@@ @_Kind_@ = UNPROTECTED_OPERATION
// Unprotected call
@@TABLE@@
@@IF@@ not @_EXIST:Param_Names_@
@_LOWER:Remote_Function_Names_@_@_LOWER:Remote_Interface_Names_@();
@@ELSE@@
@_LOWER:Remote_Function_Names_@_@_LOWER:Remote_Interface_Names_@
@@INLINE( \()(,\n )(\);\n)@@
@@TABLE@@
...
...
@@ -67,7 +71,7 @@ size_IN_buf_@_LOWER:Param_Names_@;
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
@@END_IF@@
@@END_TABLE@@
@@ELSE@@ @@-- Protected call
// puts("[TASTE] Protected call of @_Name_@");
...
...
templates/skeletons/blackbox-c-header/interface.tmplt
View file @
ca620c5b
...
...
@@ -10,10 +10,18 @@
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Param_Encodings_@ : |_ Corresponding encoding (Default, Native, UPER, ACN)
@@IF@@ @_Direction_@ = "PI"
@@IF@@ @_Param_Names'Length_@ = 0
void @_LOWER:Parent_Function_@_@_LOWER:Name_@(void);
@@ELSE@@
void @_LOWER:Parent_Function_@_@_LOWER:Name_@
@@END_IF@@
@@ELSE@@
@@IF@@ @_Param_Names'Length_@ = 0
extern void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@(void);
@@ELSE@@
extern void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@END_IF@@
@@END_IF@@
@@INLINE( \()(,\n )(\);\n)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
...
...
templates/skeletons/context_parameters.tmplt
View file @
ca620c5b
...
...
@@ -8,29 +8,29 @@
@@-- @_CP_Sort_@ : ... corresponding ASN.1 type
@@-- @_CP_ASN1_Module_@ : ... in ASN.1 module
@@-- @_CP_Value_@ : ... with default value
Context-@_REPLACE
(
(_
)
/-):LOWER:Name_@ DEFINITIONS ::=
Context-@_REPLACE
_ALL
(_/-):LOWER:Name_@ DEFINITIONS ::=
BEGIN
IMPORTS
@@INLINE( )(\n )(;\n)@@
@@TABLE@@
@_Sort_Set_@ FROM @_Module_Set_@
@_
REPLACE_ALL(_/-):
Sort_Set_@ FROM @_
REPLACE_ALL(_/-):
Module_Set_@
@@END_TABLE@@
@@END_INLINE@@
-- Group all context parameters of this function in a record
Context-@_REPLACE
(
(_
)
/-):LOWER:Name_@ ::= SEQUENCE {
Context-@_REPLACE
_ALL
(_/-):LOWER:Name_@ ::= SEQUENCE {
@@INLINE( )(,\n )(\n)@@
@@TABLE@@
@_REPLACE((_)/-):LOWER:CP_Name_@ @_CP_Sort_@
@_REPLACE
_ALL
((_)/-):LOWER:CP_Name_@ @_
REPLACE_ALL(_/-):
CP_Sort_@
@@END_TABLE@@
@@END_INLINE@@
}
-- Declare a constant with the values set by the user in the interface view
@_REPLACE
(
(_
)
/-):LOWER:Name_@-ctxt Context-@_REPLACE
(
(_
)
/-):LOWER:Name_@ ::= {
@_REPLACE
_ALL
(_/-):LOWER:Name_@-ctxt Context-@_REPLACE
_ALL
(_/-):LOWER:Name_@ ::= {
@@INLINE( )(,\n )(\n)@@
@@TABLE@@
@_REPLACE
(
(_
)
/-):LOWER:CP_Name_@ @_CP_Value_@
@_REPLACE
_ALL
(_/-):LOWER:CP_Name_@ @_CP_Value_@
@@END_TABLE@@
@@END_INLINE@@
}
...
...
templates/skeletons/gui-body/function.tmplt
View file @
ca620c5b
...
...
@@ -36,10 +36,10 @@
#include "queue_manager.h"
#include "@_LOWER:Name_@.h"
#include "@_
LOWER:
Name_@_enums_def.h"
#include "@_Name_@_enums_def.h"
typedef struct _PI_Messages {
T_@_
LOWER:
Name_@_PI_list msg_id;
T_@_Name_@_PI_list msg_id;
union {
@@TABLE@@
@@IF@@ @_ASync_PI_Param_Type_@ /= ""
...
...
@@ -50,7 +50,7 @@ typedef struct _PI_Messages {
} PI_Messages;
typedef struct _RI_Messages {
T_@_
LOWER:
Name_@_RI_list msg_id;
T_@_Name_@_RI_list msg_id;
union {
@@TABLE@@
@@IF@@ @_ASync_RI_Param_Type_@ /= ""
...
...
@@ -132,7 +132,7 @@ void @_LOWER:Name_@_PI_poll(void)
struct mq_attr msgq_attr;
char* msgcontent = NULL;
T_@_
LOWER:
Name_@_RI_list message_rec
i
eved_type;
T_@_Name_@_RI_list message_rece
i
ved_type;
if ((msgcontent = (char*)malloc(sizeof(RI_Messages))) == NULL) {
perror("Error when allocating memory in GUI polling function");
...
...
@@ -144,8 +144,8 @@ void @_LOWER:Name_@_PI_poll(void)
while (!retrieve_message_from_queue(@_LOWER:Name_@_RI_queue_id,
sizeof(RI_Messages),
msgcontent,
(int *)&message_rec
i
eved_type)) {
switch(message_rec
i
eved_type) {
(int *)&message_rece
i
ved_type)) {
switch(message_rece
i
ved_type) {
@@TABLE@@
case i_@_List_Of_ASync_RIs_@:
@_LOWER:Name_@_RI_@_LOWER:List_Of_ASync_RIs_@((asn1Scc@_REPLACE_ALL(-/_):ASync_RI_Param_Type_@ *)msgcontent);
...
...
templates/skeletons/gui-enum-defs/function-filename.tmplt
View file @
ca620c5b
...
...
@@ -3,4 +3,5 @@
@@-- @_Name_@ : The name of the function
@@-- @_Is_Type_@ : True if function type
@@-- @_Instance_Of_@ : Name of instance or empty string
@_LOWER:Name_@_enums_def.h
@@-- Don't use LOWER because the enums_def.h is also included by DMT's gui_api.c
@_Name_@_enums_def.h
templates/skeletons/gui-enum-defs/function.tmplt
View file @
ca620c5b
...
...
@@ -40,7 +40,7 @@ typedef enum {
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
} T_@_
LOWER:
Name_@_PI_list;
} T_@_Name_@_PI_list;
typedef enum {
@@INLINE( )(,\n )()@@
...
...
@@ -48,4 +48,4 @@ typedef enum {
i_@_List_Of_ASync_RIs_@
@@END_TABLE@@
@@END_INLINE@@
} T_@_
LOWER:
Name_@_RI_list;
} T_@_Name_@_RI_list;
templates/skeletons/gui-runtime-header/function.tmplt
View file @
ca620c5b
...
...
@@ -85,18 +85,18 @@ int create_exchange_queue(char* queue_name,
// queue_id : [in] Handle to the queue adressed as returned by
// max_message_length : [in] Maximum size of an element to be stored in the queue
// (functional data plus discriminant) in bytes
// message_data_rec
i
eved: [out] Pointer on the functional data retrieved in the queue
// message_data_rece
i
ved: [out] Pointer on the functional data retrieved in the queue
// Note that this buffer only contains the functional part
// of the message and not the first field allowing to identify
// the message type.
// message_rec
i
eved_type: [out] Identifier of the type of message rec
i
eved.
// message_rece
i
ved_type: [out] Identifier of the type of message rece
i
ved.
//
// Returns : 0 on success, -1 otherwise
//
int retrieve_message_from_queue(mqd_t queue_id,
long max_message_length,
void* message_data_rec
i
eved,
int* message_rec
i
eved_type);
void* message_data_rece
i
ved,
int* message_rece
i
ved_type);
//
//This function writes a single message from a queue create_exchange_queue
...
...
@@ -107,7 +107,7 @@ int retrieve_message_from_queue(mqd_t queue_id,
// Note that this buffer only contains the functional part
// of the message and not the first field allowing to identify
// the message type.
// message_rec
i
eved_type: [in] Identifier of the type of message to be sent
// message_rece
i
ved_type: [in] Identifier of the type of message to be sent
//
// Returns : 0 on success, -1 otherwise
//
...
...
templates/skeletons/makefile.tmplt
View file @
ca620c5b
...
...
@@ -125,8 +125,11 @@ dataview/Python/built: dataview/C/built
cp
dataview/C/timeInMS.[ch] dataview/C/debug_messages.c @_LOWER:Function_Names_@/GUI/wrappers/python
cd
@_LOWER:Function_Names_@/GUI/wrappers/python
&&
\
gcc
-g
-fPIC
-c
`
python-config
--cflags
`
gui_api.c ../../src/queue_manager.c timeInMS.c debug_messages.c
-I
.
-I
../../src
&&
\
gcc
-g
-shared
-o
PythonAccess.so gui_api.o queue_manager.o timeInMS.o debug_messages.o
`
python-config
--ldflags
`
-lrt
&&
mv
*
..
&&
cd
..
&&
rmdir
python
mkdir
-p
binaries/@_LOWER:Function_Names_@_GUI
&&
cp
-f
@_LOWER:Function_Names_@/GUI/wrappers/
*
binaries/@_LOWER:Function_Names_@_GUI
gcc
-g
-shared
-o
PythonAccess.so gui_api.o queue_manager.o timeInMS.o debug_messages.o
`
python-config
--ldflags
`
-lrt
mkdir
-p
binaries/@_LOWER:Function_Names_@_GUI
cp
-f
@_LOWER:Function_Names_@/GUI/wrappers/python/
*
binaries/@_LOWER:Function_Names_@_GUI
cp
-f
@_LOWER:Function_Names_@/GUI/wrappers/
*
.py binaries/@_LOWER:Function_Names_@_GUI
cp
-f
@_LOWER:Function_Names_@/GUI/wrappers/
*
.ui binaries/@_LOWER:Function_Names_@_GUI
@@END_IF@@
@@END_TABLE@@
touch
$@
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment