00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #include "mitkTrackingTool.h" 00019 #include <itkMutexLockHolder.h> 00020 00021 typedef itk::MutexLockHolder<itk::FastMutexLock> MutexLockHolder; 00022 00023 00024 mitk::TrackingTool::TrackingTool() 00025 : itk::Object(), m_ToolName(""), m_ErrorMessage("") 00026 { 00027 m_MyMutex = itk::FastMutexLock::New(); 00028 } 00029 00030 00031 mitk::TrackingTool::~TrackingTool() 00032 { 00033 m_MyMutex->Unlock(); 00034 m_MyMutex = NULL; 00035 } 00036 00037 00038 const char* mitk::TrackingTool::GetToolName() const 00039 { 00040 MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex 00041 return this->m_ToolName.c_str(); 00042 } 00043 00044 00045 const char* mitk::TrackingTool::GetErrorMessage() const 00046 { 00047 MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex 00048 return this->m_ErrorMessage.c_str(); 00049 }