cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstMultiTask
mtsQtApplication.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4
/*
5
Author(s): Peter Kazanzides
6
Created on: 2012-06-26
7
8
(C) Copyright 2012-2023 Johns Hopkins University (JHU), All Rights Reserved.
9
10
--- begin cisst license - do not edit ---
11
12
This software is provided "as is" under an open source license, with
13
no warranty. The complete license can be found in license.txt and
14
http://www.cisst.org/cisst/license.txt.
15
16
--- end cisst license ---
17
*/
18
19
#ifndef _mtsQtApplication_h
20
#define _mtsQtApplication_h
21
22
#include <
cisstMultiTask/mtsGenericObject.h
>
23
#include <
cisstMultiTask/mtsTaskContinuous.h
>
24
25
// Always include last
26
#include <
cisstMultiTask/mtsExportQt.h
>
27
28
class
QApplication;
29
class
QBasicTimer;
30
class
BasicTimerHandler;
31
36
37
50
51
class
CISST_EXPORT
mtsQtApplicationConstructorArg
:
public
mtsGenericObject
52
{
53
CMN_DECLARE_SERVICES(
CMN_DYNAMIC_CREATION
,
CMN_LOG_ALLOW_DEFAULT
);
54
55
std::string Name;
56
std::vector<std::string> Args;
// argc, argv
57
58
public
:
59
mtsQtApplicationConstructorArg
();
60
mtsQtApplicationConstructorArg
(
const
std::string &name,
int
argc,
char
**argv);
61
mtsQtApplicationConstructorArg
(
const
mtsQtApplicationConstructorArg
&other);
62
virtual
~mtsQtApplicationConstructorArg
();
63
64
std::string
GetName
()
const
{
return
Name; }
65
int
GetArgc
()
const
{
return
Args.size(); }
66
void
GetArgv
(
char
***argvp)
const
;
67
68
void
SerializeRaw
(std::ostream & outputStream)
const override
;
69
void
DeSerializeRaw
(std::istream & inputStream)
override
;
70
71
void
ToStream
(std::ostream & outputStream)
const override
;
72
74
void
ToStreamRaw
(std::ostream & outputStream,
const
char
delimiter =
' '
,
75
bool
headerOnly =
false
,
const
std::string & headerPrefix =
""
)
const override
;
76
79
bool
FromStreamRaw
(std::istream & inputStream,
const
char
delimiter =
' '
)
override
;
80
};
81
82
CMN_DECLARE_SERVICES_INSTANTIATION
(
mtsQtApplicationConstructorArg
);
83
84
class
CISST_EXPORT
mtsQtApplication
:
public
mtsTaskContinuous
85
{
86
CMN_DECLARE_SERVICES(
CMN_DYNAMIC_CREATION_ONEARG
,
CMN_LOG_ALLOW_ALL
)
87
88
QApplication * QtApp;
// Could also use global variable qApp
89
int
ArgcCopy;
90
char
**ArgvCopy;
91
QBasicTimer * Timer;
92
BasicTimerHandler * TimerHandler;
93
94
public
:
95
mtsQtApplication
(
const
std::string &name,
int
&argc,
char
**argv);
96
mtsQtApplication
(
const
mtsQtApplicationConstructorArg
&arg);
97
virtual
~mtsQtApplication
();
98
99
void
Startup
(
void
)
override
;
100
void
Run
(
void
)
override
;
101
void
Process
(
void
);
102
};
103
104
CMN_DECLARE_SERVICES_INSTANTIATION
(
mtsQtApplication
);
105
106
#endif
// _mtsQtApplication_h
mtsGenericObject::mtsGenericObject
mtsGenericObject(void)
Definition
mtsGenericObject.h:77
mtsQtApplicationConstructorArg
Definition
mtsQtApplication.h:52
mtsQtApplicationConstructorArg::SerializeRaw
void SerializeRaw(std::ostream &outputStream) const override
mtsQtApplicationConstructorArg::DeSerializeRaw
void DeSerializeRaw(std::istream &inputStream) override
mtsQtApplicationConstructorArg::GetArgv
void GetArgv(char ***argvp) const
mtsQtApplicationConstructorArg::ToStreamRaw
void ToStreamRaw(std::ostream &outputStream, const char delimiter=' ', bool headerOnly=false, const std::string &headerPrefix="") const override
mtsQtApplicationConstructorArg::ToStream
void ToStream(std::ostream &outputStream) const override
mtsQtApplicationConstructorArg::FromStreamRaw
bool FromStreamRaw(std::istream &inputStream, const char delimiter=' ') override
mtsQtApplicationConstructorArg::mtsQtApplicationConstructorArg
mtsQtApplicationConstructorArg(const mtsQtApplicationConstructorArg &other)
mtsQtApplicationConstructorArg::GetName
std::string GetName() const
Definition
mtsQtApplication.h:64
mtsQtApplicationConstructorArg::GetArgc
int GetArgc() const
Definition
mtsQtApplication.h:65
mtsQtApplicationConstructorArg::~mtsQtApplicationConstructorArg
virtual ~mtsQtApplicationConstructorArg()
mtsQtApplicationConstructorArg::mtsQtApplicationConstructorArg
mtsQtApplicationConstructorArg(const std::string &name, int argc, char **argv)
mtsQtApplicationConstructorArg::mtsQtApplicationConstructorArg
mtsQtApplicationConstructorArg()
mtsQtApplication
Definition
mtsQtApplication.h:85
mtsQtApplication::mtsQtApplication
mtsQtApplication(const mtsQtApplicationConstructorArg &arg)
mtsQtApplication::~mtsQtApplication
virtual ~mtsQtApplication()
mtsQtApplication::Startup
void Startup(void) override
mtsQtApplication::Run
void Run(void) override
mtsQtApplication::Process
void Process(void)
mtsQtApplication::mtsQtApplication
mtsQtApplication(const std::string &name, int &argc, char **argv)
mtsTaskContinuous::mtsTaskContinuous
mtsTaskContinuous(const std::string &name, unsigned int sizeStateTable=256, bool newThread=true)
CMN_DYNAMIC_CREATION_ONEARG
const int CMN_DYNAMIC_CREATION_ONEARG
Definition
cmnClassRegisterMacros.h:330
CMN_DECLARE_SERVICES_INSTANTIATION
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition
cmnClassRegisterMacros.h:199
CMN_DYNAMIC_CREATION
const int CMN_DYNAMIC_CREATION
Definition
cmnClassRegisterMacros.h:328
CISST_EXPORT
#define CISST_EXPORT
Definition
cmnExportMacros.h:50
CMN_LOG_ALLOW_DEFAULT
#define CMN_LOG_ALLOW_DEFAULT
Definition
cmnLogLoD.h:76
CMN_LOG_ALLOW_ALL
#define CMN_LOG_ALLOW_ALL
Definition
cmnLogLoD.h:75
mtsExportQt.h
Rules of exporting.
mtsGenericObject.h
Defines mtsGenericObject.
mtsTaskContinuous.h
Defines a continuously executing task.
Generated by
1.18.0