Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 70f24d7c27c654723028c0e067e8edaa6d5c9412 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*******************************************************************************
 * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * CONTRIBUTORS:
 * 		Thomas Schuetz (initial contribution)
 *
 *******************************************************************************/

#ifndef _ETMSCLOGGER_H_
#define _ETMSCLOGGER_H_

#include "etRuntimeConfig.h"

void etMSCLogger_open(char* logPath, char* mscName);
void etMSCLogger_close(void);

void etMSCLogger_setObjectName(char* objectName);
char* etMSCLogger_getObjectName(void);

void etMSCLogger_syncCall(char* sourceName, char* messageName, char* targetName);
void etMSCLogger_syncReturn(char* sourceName, char* targetName);

void etMSCLogger_asyncOut(char* sourceName, char* messageName, char* targetName);
void etMSCLogger_asyncIn(char* sourceName, char* messageName, char* targetName);

void etMSCLogger_setState(char* objectName, char* stateName);

#ifdef ET_MSC_LOGGER_ACTIVATE
	#define ET_MSC_LOGGER_OPEN(object) \
		etMSCLogger_open("tmp", "msc"); \
		etMSCLogger_setObjectName(object);

	#define ET_MSC_LOGGER_CLOSE etMSCLogger_close();

	#define ET_MSC_LOGGER_CHANGE_STATE(objectName, stateName) \
		etMSCLogger_setState(objectName, stateName);

	#ifdef ET_SYNC_MSC_LOGGER_ACTIVATE
		#define ET_MSC_LOGGER_SYNC_ENTRY(object, message) 			\
			char* sourceName = etMSCLogger_getObjectName(); 	\
			char* targetName = object;							\
			etMSCLogger_syncCall(sourceName, message, targetName); 	\
			etMSCLogger_setObjectName(targetName);
		#define ET_MSC_LOGGER_SYNC_EXIT \
			etMSCLogger_syncReturn(sourceName, targetName); \
			etMSCLogger_setObjectName(sourceName);
	#else
		#define ET_MSC_LOGGER_SYNC_ENTRY(object, message)
		#define ET_MSC_LOGGER_SYNC_EXIT
	#endif


	#ifdef ET_ASYNC_MSC_LOGGER_ACTIVATE
		#define ET_MSC_LOGGER_ASYNC_OUT(sourceName, message, targetName) 			\
			etMSCLogger_asyncOut(sourceName, message, targetName);

		#define ET_MSC_LOGGER_ASYNC_IN(sourceName, message, targetName) 			\
			etMSCLogger_asyncIn(sourceName, message, targetName);
	#else
		#define ET_MSC_LOGGER_ASYNC_OUT(sourceName, message, targetName)
		#define ET_MSC_LOGGER_ASYNC_IN(sourceName, message, targetName)
	#endif


#else
	#define ET_MSC_LOGGER_OPEN
	#define ET_MSC_LOGGER_CLOSE

	#define ET_MSC_LOGGER_SYNC_ENTRY(object, message)
	#define ET_MSC_LOGGER_SYNC_EXIT

	#define ET_MSC_LOGGER_ASYNC_OUT(sourceName, message, targetName)
	#define ET_MSC_LOGGER_ASYNC_IN(sourceName, message, targetName)

	#define ET_MSC_LOGGER_CHANGE_STATE(objectName, stateName)
#endif


#endif /* _ETMSCLOGGER_H_ */

Back to the top