VTK
dox
opt
build
vtk6-6.3.0+dfsg2
Testing
Core
vtkTestErrorObserver.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: TestErrorObserver.h
5
6
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7
All rights reserved.
8
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10
This software is distributed WITHOUT ANY WARRANTY; without even
11
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
PURPOSE. See the above copyright notice for more information.
13
14
=========================================================================*/
15
#ifndef vtkTestErrorObserver_h
16
#define vtkTestErrorObserver_h
17
18
#include <
vtkCommand.h
>
19
#include <string>
20
21
namespace
vtkTest
22
{
23
class
ErrorObserver
:
public
::vtkCommand
24
{
25
public
:
26
ErrorObserver
():
27
Error(false),
28
Warning(false),
29
ErrorMessage(
""
),
30
WarningMessage(
""
) {}
31
static
ErrorObserver
*
New
()
32
{
33
return
new
ErrorObserver
;
34
}
35
bool
GetError
()
const
36
{
37
return
this->Error;
38
}
39
bool
GetWarning
()
const
40
{
41
return
this->Warning;
42
}
43
void
Clear
()
44
{
45
this->Error =
false
;
46
this->Warning =
false
;
47
this->ErrorMessage =
""
;
48
this->WarningMessage =
""
;
49
}
50
virtual
void
Execute
(
vtkObject
*
vtkNotUsed
(caller),
51
unsigned
long
event
,
52
void
*calldata)
53
{
54
switch
(
event
)
55
{
56
case
vtkCommand::ErrorEvent:
57
ErrorMessage +=
static_cast<
char
*
>
(calldata);
58
this->Error =
true
;
59
break
;
60
case
vtkCommand::WarningEvent:
61
WarningMessage +=
static_cast<
char
*
>
(calldata);
62
this->Warning =
true
;
63
break
;
64
}
65
}
66
std::string
GetErrorMessage
()
67
{
68
return
ErrorMessage;
69
}
70
std::string
GetWarningMessage
()
71
{
72
return
WarningMessage;
73
}
74
private
:
75
bool
Error;
76
bool
Warning;
77
std::string
ErrorMessage;
78
std::string
WarningMessage;
79
};
80
}
81
#endif
vtkTest::ErrorObserver::ErrorObserver
ErrorObserver()
Definition:
vtkTestErrorObserver.h:26
vtkCommand
superclass for callback/observer methods
Definition:
vtkCommand.h:326
vtkTest::ErrorObserver::GetWarningMessage
std::string GetWarningMessage()
Definition:
vtkTestErrorObserver.h:70
vtkTest::ErrorObserver
Definition:
vtkTestErrorObserver.h:24
vtkTest::ErrorObserver::GetError
bool GetError() const
Definition:
vtkTestErrorObserver.h:35
vtkObject
abstract base class for most VTK objects
Definition:
vtkObject.h:62
vtkTest::ErrorObserver::New
static ErrorObserver * New()
Definition:
vtkTestErrorObserver.h:31
vtkTest::ErrorObserver::Clear
void Clear()
Definition:
vtkTestErrorObserver.h:43
vtkCommand.h
vtkgl::event
struct _cl_event * event
Definition:
vtkgl.h:14387
vtkTest::ErrorObserver::GetWarning
bool GetWarning() const
Definition:
vtkTestErrorObserver.h:39
vtkTest
Definition:
vtkTestErrorObserver.h:22
vtkNotUsed
#define vtkNotUsed(x)
Definition:
vtkSetGet.h:557
vtkTest::ErrorObserver::Execute
virtual void Execute(vtkObject *vtkNotUsed(caller), unsigned long event, void *calldata)
Definition:
vtkTestErrorObserver.h:50
vtkTest::ErrorObserver::GetErrorMessage
std::string GetErrorMessage()
Definition:
vtkTestErrorObserver.h:66
vtkgl::string
GLsizei const GLchar ** string
Definition:
vtkgl.h:12011
Generated by
1.8.20