OpenASIP
2.0
src
applibs
Simulator
RunCommand.cc
Go to the documentation of this file.
1
/*
2
Copyright (c) 2002-2009 Tampere University.
3
4
This file is part of TTA-Based Codesign Environment (TCE).
5
6
Permission is hereby granted, free of charge, to any person obtaining a
7
copy of this software and associated documentation files (the "Software"),
8
to deal in the Software without restriction, including without limitation
9
the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
and/or sell copies of the Software, and to permit persons to whom the
11
Software is furnished to do so, subject to the following conditions:
12
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
15
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
DEALINGS IN THE SOFTWARE.
23
*/
24
/**
25
* @file RunCommand.cc
26
*
27
* Implementation of RunCommand class
28
*
29
* @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
30
* @note rating: red
31
*/
32
33
#include "
RunCommand.hh
"
34
#include "
Application.hh
"
35
#include "
FileSystem.hh
"
36
#include "
SimulatorFrontend.hh
"
37
#include "
SimulatorInterpreterContext.hh
"
38
#include "
Exception.hh
"
39
#include "
SimulatorToolbox.hh
"
40
#include "
SimulatorTextGenerator.hh
"
41
42
/**
43
* Constructor.
44
*
45
* Sets the name of the command to the base class.
46
*/
47
RunCommand::RunCommand
() :
SimControlLanguageCommand
(
"run"
) {
48
}
49
50
/**
51
* Destructor.
52
*
53
* Does nothing.
54
*/
55
RunCommand::~RunCommand
() {
56
}
57
58
/**
59
* Executes the "run" command.
60
*
61
* Starts the simulation.
62
*
63
* @param arguments No arguments needed.
64
* @return Always true.
65
* @exception NumberFormatException Is never thrown by this command.
66
*
67
*/
68
bool
69
RunCommand::execute
(
const
std::vector<DataObject>&) {
70
if
(!
checkSimulationNotAlreadyRunning
() ||
71
!
checkSimulationInitialized
()) {
72
73
return
false
;
74
}
75
76
simulatorFrontend
().
run
();
77
78
printStopInformation
();
79
80
return
true
;
81
}
82
83
/**
84
* Returns the help text for this command.
85
*
86
* Help text is searched from SimulatorTextGenerator.
87
*
88
* @return The help text.
89
* @todo Use SimulatorTextGenerator to get the help text.
90
*/
91
std::string
92
RunCommand::helpText
()
const
{
93
return
SimulatorToolbox::textGenerator
().
text
(
94
Texts::TXT_INTERP_HELP_RUN
).str();
95
}
96
Texts::TXT_INTERP_HELP_RUN
@ TXT_INTERP_HELP_RUN
Help text for command "run" of the CLI.
Definition:
SimulatorTextGenerator.hh:69
FileSystem.hh
SimControlLanguageCommand::checkSimulationNotAlreadyRunning
bool checkSimulationNotAlreadyRunning()
Definition:
SimControlLanguageCommand.cc:111
SimulatorInterpreterContext.hh
Exception.hh
RunCommand.hh
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition:
TextGenerator.cc:94
SimulatorFrontend::run
virtual void run()
Definition:
SimulatorFrontend.cc:997
SimControlLanguageCommand::printStopInformation
virtual void printStopInformation()
Definition:
SimControlLanguageCommand.cc:243
SimulatorToolbox.hh
RunCommand::execute
virtual bool execute(const std::vector< DataObject > &arguments)
Definition:
RunCommand.cc:69
Application.hh
SimulatorToolbox::textGenerator
static SimulatorTextGenerator & textGenerator()
Definition:
SimulatorToolbox.cc:75
RunCommand::RunCommand
RunCommand()
Definition:
RunCommand.cc:47
SimulatorTextGenerator.hh
SimControlLanguageCommand::checkSimulationInitialized
bool checkSimulationInitialized()
Definition:
SimControlLanguageCommand.cc:88
SimulatorFrontend.hh
RunCommand::helpText
virtual std::string helpText() const
Definition:
RunCommand.cc:92
RunCommand::~RunCommand
virtual ~RunCommand()
Definition:
RunCommand.cc:55
SimControlLanguageCommand
Definition:
SimControlLanguageCommand.hh:63
SimControlLanguageCommand::simulatorFrontend
SimulatorFrontend & simulatorFrontend()
Definition:
SimControlLanguageCommand.cc:214
Generated by
1.8.17