trikRuntime
applicationInitHelper.h
Go to the documentation of this file.
1 /* Copyright 2015 CyberTech Labs Ltd.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/QCoreApplication>
18 #include <QtCore/QScopedPointer>
19 
20 #include "commandLineParser.h"
21 
22 namespace trikKernel {
23 
24 class LoggingHelper;
25 
31 {
32 public:
35  explicit ApplicationInitHelper(QCoreApplication &app);
36 
38 
41 
44  bool parseCommandLine();
45 
47  void init();
48 
50  QString configPath() const;
51 
52 private:
54  QCoreApplication &mApp;
55 
57  trikKernel::CommandLineParser mCommandLineParser;
58 
60  QString mConfigPath;
61 
63  QScopedPointer<LoggingHelper> mLoggingHelper;
64 };
65 
66 }
Definition: analogSensor.h:23
QString configPath() const
Returns path to a directory with config files, which is possibly received from command line...
Definition: applicationInitHelper.cpp:118
~ApplicationInitHelper()
Definition: applicationInitHelper.cpp:80
bool parseCommandLine()
Parses command line arguments.
Definition: applicationInitHelper.cpp:89
Helper class for correct initialization of trikRuntime applications — TrikRun, TrikGui and TrikServe...
Definition: applicationInitHelper.h:30
void init()
Continues initialization of the application after the command line is parsed.
Definition: applicationInitHelper.cpp:99
Parser of command-line parameters.
Definition: commandLineParser.h:33
ApplicationInitHelper(QCoreApplication &app)
Constructor.
Definition: applicationInitHelper.cpp:39
trikKernel::CommandLineParser & commandLineParser()
Returns temporary reference to command line options parser.
Definition: applicationInitHelper.cpp:84