Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
VTK
VTK
Commits
71cdd1ec
Commit
71cdd1ec
authored
Mar 01, 1994
by
Will Schroeder
Browse files
ENH: Added vlErrorMacro()
parent
e3e2cb16
Changes
6
Hide whitespace changes
Inline
Side-by-side
include/SetGet.hh
View file @
71cdd1ec
...
...
@@ -231,6 +231,13 @@ type *Get##name () { \
// vlDebugMacro(<< "this is debug info" << this->SomeVariable << "\n");
//
#define vlDebugMacro(x) \
if (Debug) cerr << "In " __FILE__ << ", line " << __LINE__ << "\n : " x
if (Debug) cerr << "In " __FILE__ << ", line " << __LINE__ << "\n" << this->GetClassName() << ": " x
//
// This macro is used to print out errors
// vlErrorMacro(<< "Error message" << variable << "\n");
//
#define vlErrorMacro(x) \
cerr << "In " __FILE__ << ", line " << __LINE__ << "\n" << this->GetClassName() << ": " x
#endif
src/CArray.cc
View file @
71cdd1ec
...
...
@@ -124,7 +124,7 @@ char *vlCharArray::Resize(const int sz)
if
(
(
newArray
=
new
char
[
newSize
])
==
0
)
{
cerr
<<
"Cannot allocate memory
\n
"
;
vlErrorMacro
(
<<
"Cannot allocate memory
\n
"
)
;
return
0
;
}
...
...
src/FArray.cc
View file @
71cdd1ec
...
...
@@ -126,7 +126,7 @@ float *vlFloatArray::Resize(const int sz)
if
(
(
newArray
=
new
float
[
newSize
])
==
0
)
{
cerr
<<
"Cannot allocate memory
\n
"
;
vlErrorMacro
(
<<
"Cannot allocate memory
\n
"
)
;
return
0
;
}
...
...
src/IntArray.cc
View file @
71cdd1ec
...
...
@@ -122,7 +122,7 @@ int *vlIntArray::Resize(const int sz)
if
(
(
newArray
=
new
int
[
newSize
])
==
0
)
{
cerr
<<
"Cannot allocate memory
\n
"
;
vlErrorMacro
(
<<
"Cannot allocate memory
\n
"
)
;
return
0
;
}
...
...
src/Object.cc
View file @
71cdd1ec
...
...
@@ -34,32 +34,22 @@ vlObject::~vlObject()
{
if
(
this
->
RefCount
>
0
)
{
cerr
<<
this
->
GetClassName
()
<<
": Trying to delete object with non-zero refCount
\n\n
"
;
}
if
(
this
->
Debug
)
{
cerr
<<
this
->
GetClassName
()
<<
" "
<<
this
<<
", Destructing!
\n\n
"
;
vlErrorMacro
(
<<
": Trying to delete object with non-zero refCount
\n\n
"
);
}
vlDebugMacro
(
<<
this
<<
", Destructing!
\n\n
"
);
}
void
vlObject
::
Register
(
void
*
p
)
{
this
->
RefCount
++
;
if
(
this
->
Debug
)
{
cerr
<<
this
->
GetClassName
()
<<
" "
<<
this
<<
", Registered by "
<<
(
void
*
)
p
<<
"
\n\n
"
;
}
vlDebugMacro
(
<<
this
<<
", Registered by "
<<
(
void
*
)
p
<<
"
\n\n
"
);
}
void
vlObject
::
UnRegister
(
void
*
p
)
{
if
(
this
->
Debug
)
{
cerr
<<
this
->
GetClassName
()
<<
" "
<<
this
<<
", UnRegistered by "
<<
(
void
*
)
p
<<
"
\n\n
"
;
}
vlDebugMacro
(
<<
this
<<
", UnRegistered by "
<<
(
void
*
)
p
<<
"
\n\n
"
);
if
(
--
this
->
RefCount
<=
0
)
delete
this
;
}
...
...
src/SArray.cc
View file @
71cdd1ec
...
...
@@ -125,7 +125,7 @@ short *vlShortArray::Resize(const int sz)
if
(
(
newArray
=
new
short
[
newSize
])
==
0
)
{
cerr
<<
"Cannot allocate memory
\n
"
;
vlErrorMacro
(
<<
"Cannot allocate memory
\n
"
)
;
return
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment