changeset 4279:ab4d015af660

moving inline methods to source files for ABI compatibility
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Nov 2020 20:48:01 +0100
parents 9279de56a405
children 58e757ded69e
files OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py OrthancFramework/Sources/Cache/MemoryStringCache.cpp OrthancFramework/Sources/Cache/MemoryStringCache.h OrthancFramework/Sources/Compression/DeflateBaseCompressor.cpp OrthancFramework/Sources/Compression/DeflateBaseCompressor.h OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp OrthancFramework/Sources/DicomFormat/DicomImageInformation.h OrthancFramework/Sources/SystemToolbox.cpp OrthancFramework/Sources/SystemToolbox.h
diffstat 9 files changed, 149 insertions(+), 89 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py	Tue Nov 03 20:05:55 2020 +0100
+++ b/OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py	Tue Nov 03 20:48:01 2020 +0100
@@ -83,6 +83,8 @@
                  [ '-DORTHANC_BUILDING_FRAMEWORK_LIBRARY=1' ])
 
 
+FILES = []
+COUNT = 0
 
 def ExploreNamespace(node, namespace):
     for child in node.get_children():
@@ -116,6 +118,10 @@
                                     hasImplementation = True
 
                             if hasImplementation:
+                                global FILES, COUNT
+                                FILES.append(str(child.location.file))
+                                COUNT += 1
+                                
                                 print('Exported public method with an implementation: %s::%s()' %
                                       ('::'.join(fqn), i.spelling))
 
@@ -124,3 +130,11 @@
     if (node.kind == clang.cindex.CursorKind.NAMESPACE and
         node.spelling == 'Orthanc'):
         ExploreNamespace(node, [ 'Orthanc' ])
+
+
+print('\nTotal of possibly problematic methods: %d' % COUNT)
+
+print('\nFiles:\n')
+for i in sorted(list(set(FILES))):
+    print(i)
+    
--- a/OrthancFramework/Sources/Cache/MemoryStringCache.cpp	Tue Nov 03 20:05:55 2020 +0100
+++ b/OrthancFramework/Sources/Cache/MemoryStringCache.cpp	Tue Nov 03 20:48:01 2020 +0100
@@ -47,6 +47,15 @@
     }      
   };
 
+  size_t Orthanc::MemoryStringCache::GetMaximumSize()
+  {
+    return cache_.GetMaximumSize();
+  }
+
+  void MemoryStringCache::SetMaximumSize(size_t size)
+  {
+    cache_.SetMaximumSize(size);
+  }
 
   void MemoryStringCache::Add(const std::string& key,
                               const std::string& value)
@@ -54,6 +63,10 @@
     cache_.Acquire(key, new StringValue(value));
   }
 
+  void MemoryStringCache::Invalidate(const std::string &key)
+  {
+    cache_.Invalidate(key);
+  }
   
   bool MemoryStringCache::Fetch(std::string& value,
                                 const std::string& key)
--- a/OrthancFramework/Sources/Cache/MemoryStringCache.h	Tue Nov 03 20:05:55 2020 +0100
+++ b/OrthancFramework/Sources/Cache/MemoryStringCache.h	Tue Nov 03 20:48:01 2020 +0100
@@ -38,23 +38,14 @@
     MemoryObjectCache  cache_;
 
   public:
-    size_t GetMaximumSize()
-    {
-      return cache_.GetMaximumSize();
-    }
+    size_t GetMaximumSize();
     
-    void SetMaximumSize(size_t size)
-    {
-      cache_.SetMaximumSize(size);
-    }
+    void SetMaximumSize(size_t size);
 
     void Add(const std::string& key,
              const std::string& value);
     
-    void Invalidate(const std::string& key)
-    {
-      cache_.Invalidate(key);
-    }
+    void Invalidate(const std::string& key);
 
     bool Fetch(std::string& value,
                const std::string& key);
--- a/OrthancFramework/Sources/Compression/DeflateBaseCompressor.cpp	Tue Nov 03 20:05:55 2020 +0100
+++ b/OrthancFramework/Sources/Compression/DeflateBaseCompressor.cpp	Tue Nov 03 20:48:01 2020 +0100
@@ -30,6 +30,13 @@
 
 namespace Orthanc
 {
+  DeflateBaseCompressor::DeflateBaseCompressor() :
+    compressionLevel_(6),
+    prefixWithUncompressedSize_(false)
+  {
+  }
+
+
   void DeflateBaseCompressor::SetCompressionLevel(uint8_t level)
   {
     if (level >= 10)
@@ -61,4 +68,19 @@
     return size;
   }
 
+
+  void Orthanc::DeflateBaseCompressor::SetPrefixWithUncompressedSize(bool prefix)
+  {
+    prefixWithUncompressedSize_ = prefix;
+  }
+
+  bool DeflateBaseCompressor::HasPrefixWithUncompressedSize() const
+  {
+    return prefixWithUncompressedSize_;
+  }
+
+  uint8_t DeflateBaseCompressor::GetCompressionLevel() const
+  {
+    return compressionLevel_;
+  }
 }
--- a/OrthancFramework/Sources/Compression/DeflateBaseCompressor.h	Tue Nov 03 20:05:55 2020 +0100
+++ b/OrthancFramework/Sources/Compression/DeflateBaseCompressor.h	Tue Nov 03 20:48:01 2020 +0100
@@ -48,27 +48,14 @@
                                         size_t compressedSize);
 
   public:
-    DeflateBaseCompressor() : 
-      compressionLevel_(6),
-      prefixWithUncompressedSize_(false)
-    {
-    }
+    DeflateBaseCompressor();
 
     void SetCompressionLevel(uint8_t level);
     
-    void SetPrefixWithUncompressedSize(bool prefix)
-    {
-      prefixWithUncompressedSize_ = prefix;
-    }
+    void SetPrefixWithUncompressedSize(bool prefix);
 
-    bool HasPrefixWithUncompressedSize() const
-    {
-      return prefixWithUncompressedSize_;
-    }
+    bool HasPrefixWithUncompressedSize() const;
 
-    uint8_t GetCompressionLevel() const
-    {
-      return compressionLevel_;
-    }
+    uint8_t GetCompressionLevel() const;
   };
 }
--- a/OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp	Tue Nov 03 20:05:55 2020 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp	Tue Nov 03 20:48:01 2020 +0100
@@ -210,6 +210,66 @@
     return target.release();
   }
 
+  unsigned int Orthanc::DicomImageInformation::GetWidth() const
+  {
+    return width_;
+  }
+
+  unsigned int Orthanc::DicomImageInformation::GetHeight() const
+  {
+    return height_;
+  }
+
+  unsigned int DicomImageInformation::GetNumberOfFrames() const
+  {
+    return numberOfFrames_;
+  }
+
+  unsigned int DicomImageInformation::GetChannelCount() const
+  {
+    return samplesPerPixel_;
+  }
+
+  unsigned int DicomImageInformation::GetBitsStored() const
+  {
+    return bitsStored_;
+  }
+
+  size_t DicomImageInformation::GetBytesPerValue() const
+  {
+    return bytesPerValue_;
+  }
+
+  bool DicomImageInformation::IsSigned() const
+  {
+    return isSigned_;
+  }
+
+  unsigned int DicomImageInformation::GetBitsAllocated() const
+  {
+    return bitsAllocated_;
+  }
+
+  unsigned int DicomImageInformation::GetHighBit() const
+  {
+    return highBit_;
+  }
+
+  bool DicomImageInformation::IsPlanar() const
+  {
+    return isPlanar_;
+  }
+
+  unsigned int DicomImageInformation::GetShift() const
+  {
+    return highBit_ + 1 - bitsStored_;
+  }
+
+  PhotometricInterpretation DicomImageInformation::GetPhotometricInterpretation() const
+  {
+    return photometric_;
+  }
+
   bool DicomImageInformation::ExtractPixelFormat(PixelFormat& format,
                                                  bool ignorePhotometricInterpretation) const
   {
--- a/OrthancFramework/Sources/DicomFormat/DicomImageInformation.h	Tue Nov 03 20:05:55 2020 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomImageInformation.h	Tue Nov 03 20:48:01 2020 +0100
@@ -67,65 +67,29 @@
 
     DicomImageInformation* Clone() const;
 
-    unsigned int GetWidth() const
-    {
-      return width_;
-    }
+    unsigned int GetWidth() const;
 
-    unsigned int GetHeight() const
-    {
-      return height_;
-    }
+    unsigned int GetHeight() const;
 
-    unsigned int GetNumberOfFrames() const
-    {
-      return numberOfFrames_;
-    }
+    unsigned int GetNumberOfFrames() const;
 
-    unsigned int GetChannelCount() const
-    {
-      return samplesPerPixel_;
-    }
+    unsigned int GetChannelCount() const;
 
-    unsigned int GetBitsStored() const
-    {
-      return bitsStored_;
-    }
+    unsigned int GetBitsStored() const;
 
-    size_t GetBytesPerValue() const
-    {
-      return bytesPerValue_;
-    }
+    size_t GetBytesPerValue() const;
 
-    bool IsSigned() const
-    {
-      return isSigned_;
-    }
+    bool IsSigned() const;
 
-    unsigned int GetBitsAllocated() const
-    {
-      return bitsAllocated_;
-    }
+    unsigned int GetBitsAllocated() const;
 
-    unsigned int GetHighBit() const
-    {
-      return highBit_;
-    }
+    unsigned int GetHighBit() const;
 
-    bool IsPlanar() const
-    {
-      return isPlanar_;
-    }
+    bool IsPlanar() const;
 
-    unsigned int GetShift() const
-    {
-      return highBit_ + 1 - bitsStored_;
-    }
+    unsigned int GetShift() const;
 
-    PhotometricInterpretation GetPhotometricInterpretation() const
-    {
-      return photometric_;
-    }
+    PhotometricInterpretation GetPhotometricInterpretation() const;
 
     bool ExtractPixelFormat(PixelFormat& format,
                             bool ignorePhotometricInterpretation) const;
--- a/OrthancFramework/Sources/SystemToolbox.cpp	Tue Nov 03 20:05:55 2020 +0100
+++ b/OrthancFramework/Sources/SystemToolbox.cpp	Tue Nov 03 20:48:01 2020 +0100
@@ -233,6 +233,12 @@
   }
 
 
+  void Orthanc::SystemToolbox::ReadFile(std::string &content, const std::string &path)
+  {
+    ReadFile(content, path, true /* log */);
+  }
+
+
   bool SystemToolbox::ReadHeader(std::string& header,
                                  const std::string& path,
                                  size_t headerSize)
@@ -336,6 +342,12 @@
   }
 
 
+  void SystemToolbox::WriteFile(const void *content, size_t size, const std::string &path)
+  {
+    WriteFile(content, size, path, false /* don't automatically call fsync */);
+  }
+
+
   void SystemToolbox::WriteFile(const std::string& content,
                                 const std::string& path,
                                 bool callFsync)
@@ -345,6 +357,12 @@
   }
 
 
+  void SystemToolbox::WriteFile(const std::string &content, const std::string &path)
+  {
+    WriteFile(content, path, false /* don't automatically call fsync */);
+  }
+
+
   void SystemToolbox::RemoveFile(const std::string& path)
   {
     if (boost::filesystem::exists(path))
--- a/OrthancFramework/Sources/SystemToolbox.h	Tue Nov 03 20:05:55 2020 +0100
+++ b/OrthancFramework/Sources/SystemToolbox.h	Tue Nov 03 20:48:01 2020 +0100
@@ -55,10 +55,7 @@
                          bool log);
 
     static void ReadFile(std::string& content,
-                         const std::string& path)
-    {
-      ReadFile(content, path, true /* log */);
-    }
+                         const std::string& path);
 
     static bool ReadHeader(std::string& header,
                            const std::string& path,
@@ -71,20 +68,14 @@
 
     static void WriteFile(const void* content,
                           size_t size,
-                          const std::string& path)
-    {
-      WriteFile(content, size, path, false /* don't automatically call fsync */);
-    }
+                          const std::string& path);
 
     static void WriteFile(const std::string& content,
                           const std::string& path,
                           bool callFsync);
 
     static void WriteFile(const std::string& content,
-                          const std::string& path)
-    {
-      WriteFile(content, path, false /* don't automatically call fsync */);
-    }
+                          const std::string& path);
 
     static void RemoveFile(const std::string& path);