Seg3D  2.4
Seg3D is a free volume segmentation and processing tool developed by the NIH Center for Integrative Biomedical Computing at the University of Utah Scientific Computing and Imaging (SCI) Institute.
itk_terminator.hxx
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2016 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 // File : itk_terminator.hxx
30 // Author : Pavel A. Koshevoy
31 // Created : Sun Sep 24 18:16:00 MDT 2006
32 // Copyright : (C) 2004-2008 University of Utah
33 // Description : a ITK filter terminator convenience class
34 
35 #ifndef ITK_TERMINATOR_HXX_
36 #define ITK_TERMINATOR_HXX_
37 
38 // local includes:
39 #include <Core/ITKCommon/ThreadUtils/the_terminator.hxx>
40 
41 #ifdef USE_ITK_TERMINATORS
42 #define itk_terminator_t the_terminator_t
43 
44 
45 //----------------------------------------------------------------
46 // terminator_t
47 //
48 template <typename process_t>
49 class terminator_t : public the_terminator_t
50 {
51 public:
52  terminator_t(process_t * proc):
53  itk_terminator_t(proc->GetNameOfClass()),
54  process_(proc)
55  {}
56 
57  // virtual:
58  void terminate()
59  {
60  process_->AbortGenerateDataOn();
61  itk_terminator_t::terminate();
62  }
63 
64 private:
65  typename process_t::Pointer process_;
66 };
67 
68 
69 #endif // USE_ITK_TERMINATORS
70 #endif // ITK_TERMINATOR_HXX_
Definition: the_terminator.hxx:58