diff OrthancServer/Sources/Database/ResourcesContent.h @ 5215:8b6da4fdf9fe db-protobuf

cleaning ResourcesContent::TagValue and ResourcesContent::Metadata
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Apr 2023 14:17:39 +0200
parents 0ea402b4d901
children 48b8dae6dc77
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/ResourcesContent.h	Mon Apr 03 13:30:06 2023 +0200
+++ b/OrthancServer/Sources/Database/ResourcesContent.h	Mon Apr 03 14:17:39 2023 +0200
@@ -39,13 +39,15 @@
   class ResourcesContent : public boost::noncopyable
   {
   public:
-    struct TagValue
+    class TagValue
     {
+    private:
       int64_t      resourceId_;
       bool         isIdentifier_;
       DicomTag     tag_;
       std::string  value_;
 
+    public:
       TagValue(int64_t resourceId,
                bool isIdentifier,
                const DicomTag& tag,
@@ -56,22 +58,59 @@
         value_(value)
       {
       }
+
+      int64_t GetResourceId() const
+      {
+        return resourceId_;
+      }
+
+      bool IsIdentifier() const
+      {
+        return isIdentifier_;
+      }
+
+      const DicomTag& GetTag() const
+      {
+        return tag_;
+      }
+
+      const std::string& GetValue() const
+      {
+        return value_;
+      }
     };
 
-    struct Metadata
+    class Metadata
     {
+    private:
       int64_t       resourceId_;
-      MetadataType  metadata_;
+      MetadataType  type_;
       std::string   value_;
 
+    public:
       Metadata(int64_t  resourceId,
-               MetadataType metadata,
+               MetadataType type,
                const std::string& value) :
         resourceId_(resourceId),
-        metadata_(metadata),
+        type_(type),
         value_(value)
       {
       }
+
+      int64_t GetResourceId() const
+      {
+        return resourceId_;
+      }
+
+      MetadataType GetType() const
+      {
+        return type_;
+      }
+
+      const std::string& GetValue() const
+      {
+        return value_;
+      }
     };
 
     typedef std::list<TagValue>  ListTags;