Main Page
Modules
Namespaces
Classes
Files
File List
File Members
examples/progress/main.cpp
Go to the documentation of this file.
1
// Examples
2
#include "
ProgressExamples.h
"
3
4
// TerraLib
5
#include <
terralib/common/TerraLib.h
>
6
#include <
terralib/common/progress/ProgressManager.h
>
7
#include <
terralib/common/progress/ConsoleProgressViewer.h
>
8
9
// STL
10
#include <cstdlib>
11
#include <iostream>
12
#include <time.h>
13
14
15
int
main
(
int
argc,
char
*argv[])
16
{
17
try
18
{
19
//init components
20
TerraLib::getInstance
().
initialize
();
21
22
te::common::ConsoleProgressViewer
* cpv =
new
te::common::ConsoleProgressViewer
();
23
24
//console sleeper
25
std::cout << std::endl <<
"Console progress Test using multi tasks... "
<< std::endl;
26
ConsoleSleeper
();
27
28
//console sleeper multi thread
29
std::cout << std::endl <<
"Console progress Test using multi thread... "
<< std::endl;
30
ConsoleSleeperMultiThread
();
31
32
//qt sleeper
33
QtSleeper
(argc, argv);
34
35
delete
cpv;
36
37
TerraLib::getInstance
().
finalize
();
38
}
39
catch
(
const
std::exception& e)
40
{
41
std::cout << std::endl <<
"An exception has occurred in the Progress examples: "
<< e.what() << std::endl;
42
43
return
EXIT_FAILURE;
44
}
45
catch
(...)
46
{
47
std::cout << std::endl <<
"An unexpected exception has occurred in the Progress examples!"
<< std::endl;
48
49
return
EXIT_FAILURE;
50
}
51
52
return
EXIT_SUCCESS;
53
}
ConsoleSleeperMultiThread
void ConsoleSleeperMultiThread()
Definition:
ConsoleSleeperMultiThread.cpp:24
TerraLib.h
An utility class to control the startup and cleanup of the TerraLib Platform and its resources...
ProgressManager.h
A singleton class used to manage tasks progresses and their viewers.
ConsoleProgressViewer.h
A progress viewer implementation for the console.
ProgressExamples.h
These routines show how to use the progress bar.
ConsoleSleeper
void ConsoleSleeper()
Definition:
ConsoleSleeper.cpp:18
TerraLib::finalize
void finalize()
It finalizes the TerraLib Platform.
Definition:
common/TerraLib.cpp:67
te::common::Singleton< TerraLib >::getInstance
static TerraLib & getInstance()
It returns a reference to the singleton instance.
te::common::ConsoleProgressViewer
Definition:
ConsoleProgressViewer.h:64
main
int main(int argc, char *argv[])
Definition:
examples/progress/main.cpp:15
TerraLib::initialize
void initialize()
It initializes the TerraLib Platform.
Definition:
common/TerraLib.cpp:34
QtSleeper
void QtSleeper(int argc, char *argv[])
Definition:
QtSleeper.cpp:9
terralib5_src
examples
progress
main.cpp
Generated on Wed Jun 6 2018 12:16:10 for TerraLib by
1.8.11