/
t3rts.h
121 lines (93 loc) · 3.88 KB
/
t3rts.h
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//
// Copyright (C) 2007 Mateusz Pusz
//
// This file is part of freettcn (Free TTCN) library.
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
/**
* @file t3rts.h
* @author Mateusz Pusz
* @date Sat Apr 7 22:10:55 2007
*
* @brief
*
*
*/
#ifndef __T3RTS_H__
#define __T3RTS_H__
#include <freettcn/tools/nonCopyable.h>
#include <freettcn/etsi/tci.h>
#include <freettcn/etsi/tri.h>
#include <freettcn/tools/tools.h>
#include <memory>
#include <map>
namespace freettcn {
namespace TE {
class CEnvironment;
class CExecutableTestSuite;
class CModule;
class CTestCase;
class CComponent;
class CBehaviour;
// class CTimer;
using namespace ORG_ETSI_TTCN3_TCI;
using namespace ORG_ETSI_TTCN3_TRI;
class CTTCN3RuntimeSystem : CNonCopyable
{
typedef std::map<const TriComponentId *, std::unique_ptr<CComponent>, CPtrCmp> CComponentMap;
const CEnvironment *_env;
const CExecutableTestSuite &_ets;
CModule *_rootModule;
bool _ctrlRunning;
const CTestCase *_activeTestCase;
CComponentMap _componentMap;
// CComponent *_ctrlComponent;
protected:
const CTestCase &ActiveTestCase() const;
CComponent *ComponentCheck(const TriComponentId &component) const;
bool Running() const;
public:
CTTCN3RuntimeSystem(const CExecutableTestSuite &ets);
~CTTCN3RuntimeSystem() = default;
void Environment(const CEnvironment &env) { _env = &env; }
void Reset();
void RootModule(const TciModuleId &moduleName);
CModule &RootModule() const;
CComponent &Component(const TriComponentId &component) const;
// CTimer &Timer(const TriTimerId &timerId) const;
const TriComponentId *ControlStart();
void ControlStop();
void TestCaseStart(const TciTestCaseId &testCaseId,
const TciParameterList *parameterList);
void TestCaseExecute(const TciTestCaseId &testCaseId,
const TriPortIdList *tsiPortList);
void TestCaseStop();
const TriComponentId *TestComponentCreate(TciTestComponentKind kind,
const TciType *componentType,
const Tstring *name);
void TestComponentStart(const TriComponentId &component,
const CBehaviour &behaviour,
const TciParameterList *parameterList);
void TestComponentStop(const TriComponentId &component);
void TestComponentKill(const TriComponentId &component);
void TestComponentTerminated(const TriComponentId &component,
const VerdictValue &verdict) const;
const TriComponentId *MTC() const;
void Connect(const TriPortId &port1, const TriPortId &port2);
void Disconnect(const TriPortId &port1, const TriPortId &port2);
void Map(const TriPortId &port1, const TriPortId &port2);
void Unmap(const TriPortId &port1, const TriPortId &port2);
void Timeout(const TriTimerId &timerId);
};
} // namespace TE
} // namespace freettcn
#endif /* __T3RTS_H__ */