Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e42f32929d536e23cf241186a5237d83409f44d0 (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
/*******************************************************************************
 * Copyright (c) 2012 Draeger Medical GmbH (http://www.draeger.com).
 * 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:
 * 		Peter Karlitschek (initial contribution)
 *
 *******************************************************************************/

#ifndef MSCLOGGER_H_
#define MSCLOGGER_H_

#include "osal/etMutex.h"
#include "common/containers/String.h"
#include "common/containers/Vector.h"

namespace etRuntime {

class MSCFilter;

class MSCLogger {
public:
	MSCLogger();
	virtual ~MSCLogger();

	void setMSC(const String& msc_name, const String& path);

	/* synchronized */
	void open();
	void addMessageAsyncOut(const String& source, const String& target, const String& message);
	void addMessageAsyncIn(const String& source, const String& target, const String& message);
	void addMessageSyncCall(const String& source, const String& target, const String& message);
	void addMessageSyncReturn(const String& source, const String& target, const String& message);
	void addMessageActorCreate(const String& source, const String& target);
	void addMessageActorDestroy(const String& source, const String& target);
	void addNote(const String& actor, const String& note);
	void addMessageCreate(const String& source, const String& target);
	void addActorState(const String& actor, const String& state);
	void addVisibleComment(const String& comment);
	void close();
	/* --- */

	const String& getObjectName(void) { return m_objectName; }
	void setObjectName(const String& name) { m_objectName = name; }

	Vector<String>& getCommandList() {	return m_commandList; };
	MSCFilter* getMSCFilter(){ return m_filter; };

private:

	void createLine(const String& source, const String& mid, const String& target, const String& message);
	void saveMSCforTrace2UML(etFileHandle handle);

	Vector<String> m_commandList;
	MSCFilter* m_filter;

	String m_path;
	String m_msc_name ;
	etBool m_is_open;

	etMutex m_mutex;

	String m_objectName;

	MSCLogger(const MSCLogger& right);
	MSCLogger& operator=(const MSCLogger& right);


};


} /* namespace etRuntime */
#endif /* MSCLOGGER_H_ */

Back to the top