Medical Imaging Interaction Toolkit  2018.4.99-9a29ffc6
Medical Imaging Interaction Toolkit
mitkBaseDataSerializer.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkBaseDataSerializer.h"
15 #include <itksys/SystemTools.hxx>
16 
17 mitk::BaseDataSerializer::BaseDataSerializer() : m_FilenameHint("unnamed"), m_WorkingDirectory("")
18 {
19 }
20 
22 {
23 }
24 
26 {
27  MITK_INFO << this->GetNameOfClass() << " is asked to serialize an object " << (const void *)this->m_Data
28  << " into a directory " << m_WorkingDirectory << " using a filename hint " << m_FilenameHint;
29 
30  return "";
31 }
32 
34 {
35  // tmpname
36  static unsigned long count = 0;
37  unsigned long n = count++;
38  std::ostringstream name;
39  for (int i = 0; i < 6; ++i)
40  {
41  name << char('a' + (n % 26));
42  n /= 26;
43  }
44  std::string myname;
45  myname.append(name.str());
46  return myname;
47 }
#define MITK_INFO
Definition: mitkLogMacros.h:18
std::string GetUniqueFilenameInWorkingDirectory()
BaseData::ConstPointer m_Data
virtual std::string Serialize()
Serializes given BaseData object.