forked from Slicer/SlicerExecutionModel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModuleProcessInformation.h
68 lines (52 loc) · 1.63 KB
/
ModuleProcessInformation.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
/*=========================================================================
Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: Module Description Parser
Module: $HeadURL$
Date: $Date$
Version: $Revision$
==========================================================================*/
#ifndef __ModuleProcessInformation_h
#define __ModuleProcessInformation_h
#include <ostream>
#include <cstring>
#include <string.h>
#if defined(_WIN32)
#pragma warning ( disable : 4996 )
#endif
extern "C" {
struct ModuleProcessInformation
{
/** Inputs from calling application to the module **/
unsigned char Abort;
/** Outputs from the module to the calling application **/
float Progress; /// Overall progress
float StageProgress; /// Progress of a single stage in an algorithm
char ProgressMessage[1024];
void (*ProgressCallbackFunction)(void *);
void *ProgressCallbackClientData;
double ElapsedTime;
ModuleProcessInformation()
{
ProgressCallbackFunction = 0;
ProgressCallbackClientData = 0;
Initialize();
}
void Initialize()
{
Abort = 0;
Progress = 0;
StageProgress = 0;
strcpy(ProgressMessage, "");
ElapsedTime = 0.0;
};
void SetProgressCallback( void (*fun)(void *), void *who )
{
ProgressCallbackFunction = fun;
ProgressCallbackClientData = who;
};
};
};
std::ostream& operator<<(std::ostream &os, const ModuleProcessInformation &p);
#endif