# HG changeset patch # User Sebastien Jodogne # Date 1604929251 -3600 # Node ID 2ae9050702215f36612db014bfd9c569d3fc4726 # Parent 73de065622ece462b01531b1ad7529bd69afd2c1 renaming pure interface JobOperationValue as IJobOperationValue diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py --- a/OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py Mon Nov 09 14:40:51 2020 +0100 @@ -146,11 +146,14 @@ ## Ignore pure abstract interfaces, by checking the following ## criteria: ## - It must be a C++ class (not a struct) + ## - It must start with "I" ## - All its methods must be pure virtual (abstract) and public ## - Its destructor must be public, virtual, and must do nothing ## - if child.kind == clang.cindex.CursorKind.CLASS_DECL: + if (child.kind == clang.cindex.CursorKind.CLASS_DECL and + child.spelling[0] == 'I' and + child.spelling[1].isupper()): abstract = True isPublic = False @@ -181,8 +184,7 @@ c[0].kind != clang.cindex.CursorKind.COMPOUND_STMT or len(list(c[0].get_children())) != 0): abstract = False - elif (i.kind == clang.cindex.CursorKind.CLASS_DECL or - i.kind == clang.cindex.CursorKind.STRUCT_DECL): + elif i.kind == clang.cindex.CursorKind.CLASS_DECL: ExploreClass(i, fqn + [ i.spelling ]) elif (i.kind == clang.cindex.CursorKind.TYPEDEF_DECL or # Allow "typedef" i.kind == clang.cindex.CursorKind.ENUM_DECL): # Allow enums @@ -192,8 +194,11 @@ if abstract: print('Detected a pure interface (this is fine): %s' % ('::'.join(fqn))) - return + else: + ReportProblem('Not a pure interface', fqn, child) + return + ## ## We are facing a standard C++ class or struct @@ -209,8 +214,7 @@ elif i.kind == clang.cindex.CursorKind.CXX_ACCESS_SPEC_DECL: isPublic = (i.access_specifier == clang.cindex.AccessSpecifier.PUBLIC) - elif (i.kind == clang.cindex.CursorKind.CLASS_DECL or - i.kind == clang.cindex.CursorKind.STRUCT_DECL): + elif i.kind == clang.cindex.CursorKind.CLASS_DECL: # This is a subclass if isPublic: ExploreClass(i, fqn + [ i.spelling ]) diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/Images/IImageWriter.cpp --- a/OrthancFramework/Sources/Images/IImageWriter.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/Images/IImageWriter.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -42,10 +42,6 @@ } #endif - IImageWriter::~IImageWriter() - { - } - void IImageWriter::WriteToMemory(std::string &compressed, const ImageAccessor &accessor) { diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/Images/IImageWriter.h --- a/OrthancFramework/Sources/Images/IImageWriter.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/Images/IImageWriter.h Mon Nov 09 14:40:51 2020 +0100 @@ -52,7 +52,9 @@ #endif public: - virtual ~IImageWriter(); + virtual ~IImageWriter() + { + } virtual void WriteToMemory(std::string& compressed, const ImageAccessor& accessor); diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/GenericJobUnserializer.cpp --- a/OrthancFramework/Sources/JobsEngine/GenericJobUnserializer.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/GenericJobUnserializer.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -66,7 +66,7 @@ } - JobOperationValue* GenericJobUnserializer::UnserializeValue(const Json::Value& source) + IJobOperationValue* GenericJobUnserializer::UnserializeValue(const Json::Value& source) { const std::string type = SerializationToolbox::ReadString(source, "Type"); diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/GenericJobUnserializer.h --- a/OrthancFramework/Sources/JobsEngine/GenericJobUnserializer.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/GenericJobUnserializer.h Mon Nov 09 14:40:51 2020 +0100 @@ -35,6 +35,6 @@ virtual IJobOperation* UnserializeOperation(const Json::Value& value) ORTHANC_OVERRIDE; - virtual JobOperationValue* UnserializeValue(const Json::Value& value) ORTHANC_OVERRIDE; + virtual IJobOperationValue* UnserializeValue(const Json::Value& value) ORTHANC_OVERRIDE; }; } diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/IJobUnserializer.h --- a/OrthancFramework/Sources/JobsEngine/IJobUnserializer.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/IJobUnserializer.h Mon Nov 09 14:40:51 2020 +0100 @@ -23,7 +23,7 @@ #pragma once #include "IJob.h" -#include "Operations/JobOperationValue.h" +#include "Operations/IJobOperationValue.h" #include "Operations/IJobOperation.h" #include @@ -41,6 +41,6 @@ virtual IJobOperation* UnserializeOperation(const Json::Value& value) = 0; - virtual JobOperationValue* UnserializeValue(const Json::Value& value) = 0; + virtual IJobOperationValue* UnserializeValue(const Json::Value& value) = 0; }; } diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/IJobOperation.h --- a/OrthancFramework/Sources/JobsEngine/Operations/IJobOperation.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/IJobOperation.h Mon Nov 09 14:40:51 2020 +0100 @@ -34,7 +34,7 @@ } virtual void Apply(JobOperationValues& outputs, - const JobOperationValue& input) = 0; + const IJobOperationValue& input) = 0; virtual void Serialize(Json::Value& result) const = 0; }; diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/IJobOperationValue.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OrthancFramework/Sources/JobsEngine/Operations/IJobOperationValue.h Mon Nov 09 14:40:51 2020 +0100 @@ -0,0 +1,52 @@ +/** + * Orthanc - A Lightweight, RESTful DICOM Store + * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium + * Copyright (C) 2017-2020 Osimis S.A., Belgium + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program. If not, see + * . + **/ + + +#pragma once + +#include "../../OrthancFramework.h" + +#include +#include + +namespace Orthanc +{ + class ORTHANC_PUBLIC IJobOperationValue : public boost::noncopyable + { + public: + enum Type + { + Type_DicomInstance, + Type_Null, + Type_String + }; + + virtual ~IJobOperationValue() + { + } + + virtual Type GetType() const = 0; + + virtual IJobOperationValue* Clone() const = 0; + + virtual void Serialize(Json::Value& target) const = 0; + }; +} diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/JobOperationValue.h --- a/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValue.h Sat Nov 07 08:02:36 2020 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/** - * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ - - -#pragma once - -#include "../../OrthancFramework.h" - -#include -#include - -namespace Orthanc -{ - class ORTHANC_PUBLIC JobOperationValue : public boost::noncopyable - { - public: - enum Type - { - Type_DicomInstance, - Type_Null, - Type_String - }; - - virtual ~JobOperationValue() - { - } - - virtual Type GetType() const = 0; - - virtual JobOperationValue* Clone() const = 0; - - virtual void Serialize(Json::Value& target) const = 0; - }; -} diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.cpp --- a/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -90,7 +90,7 @@ } - void JobOperationValues::Append(JobOperationValue* value) // Takes ownership + void JobOperationValues::Append(IJobOperationValue* value) // Takes ownership { if (value == NULL) { @@ -108,7 +108,7 @@ } - JobOperationValue& JobOperationValues::GetValue(size_t index) const + IJobOperationValue& JobOperationValues::GetValue(size_t index) const { if (index >= values_.size()) { diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h --- a/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h Mon Nov 09 14:40:51 2020 +0100 @@ -22,7 +22,7 @@ #pragma once -#include "JobOperationValue.h" +#include "IJobOperationValue.h" #include @@ -33,7 +33,7 @@ class ORTHANC_PUBLIC JobOperationValues : public boost::noncopyable { private: - std::vector values_; + std::vector values_; void Append(JobOperationValues& target, bool clear); @@ -49,11 +49,11 @@ void Reserve(size_t count); - void Append(JobOperationValue* value); // Takes ownership + void Append(IJobOperationValue* value); // Takes ownership size_t GetSize() const; - JobOperationValue& GetValue(size_t index) const; + IJobOperationValue& GetValue(size_t index) const; void Serialize(Json::Value& target) const; diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/LogJobOperation.cpp --- a/OrthancFramework/Sources/JobsEngine/Operations/LogJobOperation.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/LogJobOperation.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -29,16 +29,16 @@ namespace Orthanc { void LogJobOperation::Apply(JobOperationValues& outputs, - const JobOperationValue& input) + const IJobOperationValue& input) { switch (input.GetType()) { - case JobOperationValue::Type_String: + case IJobOperationValue::Type_String: LOG(INFO) << "Job value: " << dynamic_cast(input).GetContent(); break; - case JobOperationValue::Type_Null: + case IJobOperationValue::Type_Null: LOG(INFO) << "Job value: (null)"; break; diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/LogJobOperation.h --- a/OrthancFramework/Sources/JobsEngine/Operations/LogJobOperation.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/LogJobOperation.h Mon Nov 09 14:40:51 2020 +0100 @@ -32,7 +32,7 @@ { public: virtual void Apply(JobOperationValues& outputs, - const JobOperationValue& input) ORTHANC_OVERRIDE; + const IJobOperationValue& input) ORTHANC_OVERRIDE; virtual void Serialize(Json::Value& result) const ORTHANC_OVERRIDE; }; diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/NullOperationValue.cpp --- a/OrthancFramework/Sources/JobsEngine/Operations/NullOperationValue.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/NullOperationValue.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -26,12 +26,12 @@ namespace Orthanc { - JobOperationValue::Type NullOperationValue::GetType() const + IJobOperationValue::Type NullOperationValue::GetType() const { return Type_Null; } - JobOperationValue* NullOperationValue::Clone() const + IJobOperationValue* NullOperationValue::Clone() const { return new NullOperationValue; } diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/NullOperationValue.h --- a/OrthancFramework/Sources/JobsEngine/Operations/NullOperationValue.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/NullOperationValue.h Mon Nov 09 14:40:51 2020 +0100 @@ -22,18 +22,18 @@ #pragma once -#include "JobOperationValue.h" +#include "IJobOperationValue.h" #include "../../Compatibility.h" // For ORTHANC_OVERRIDE namespace Orthanc { - class ORTHANC_PUBLIC NullOperationValue : public JobOperationValue + class ORTHANC_PUBLIC NullOperationValue : public IJobOperationValue { public: virtual Type GetType() const ORTHANC_OVERRIDE; - virtual JobOperationValue* Clone() const ORTHANC_OVERRIDE; + virtual IJobOperationValue* Clone() const ORTHANC_OVERRIDE; virtual void Serialize(Json::Value& target) const ORTHANC_OVERRIDE; }; diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp --- a/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -66,7 +66,7 @@ } } - void AddOriginalInput(const JobOperationValue& value) + void AddOriginalInput(const IJobOperationValue& value) { if (currentInput_ != 0) { @@ -122,7 +122,7 @@ throw OrthancException(ErrorCode_BadSequenceOfCalls); } - const JobOperationValue* input; + const IJobOperationValue* input; if (currentInput_ < originalInputs_->GetSize()) { @@ -275,7 +275,7 @@ void SequenceOfOperationsJob::Lock::AddInput(size_t index, - const JobOperationValue& value) + const IJobOperationValue& value) { if (IsDone()) { diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h --- a/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h Mon Nov 09 14:40:51 2020 +0100 @@ -96,7 +96,7 @@ size_t GetOperationsCount() const; void AddInput(size_t index, - const JobOperationValue& value); + const IJobOperationValue& value); void Connect(size_t input, size_t output); diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/StringOperationValue.cpp --- a/OrthancFramework/Sources/JobsEngine/Operations/StringOperationValue.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/StringOperationValue.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -31,12 +31,12 @@ { } - JobOperationValue::Type StringOperationValue::GetType() const + IJobOperationValue::Type StringOperationValue::GetType() const { return Type_String; } - JobOperationValue* StringOperationValue::Clone() const + IJobOperationValue* StringOperationValue::Clone() const { return new StringOperationValue(content_); } diff -r 73de065622ec -r 2ae905070221 OrthancFramework/Sources/JobsEngine/Operations/StringOperationValue.h --- a/OrthancFramework/Sources/JobsEngine/Operations/StringOperationValue.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/StringOperationValue.h Mon Nov 09 14:40:51 2020 +0100 @@ -22,7 +22,7 @@ #pragma once -#include "JobOperationValue.h" +#include "IJobOperationValue.h" #include "../../Compatibility.h" // For ORTHANC_OVERRIDE @@ -30,7 +30,7 @@ namespace Orthanc { - class ORTHANC_PUBLIC StringOperationValue : public JobOperationValue + class ORTHANC_PUBLIC StringOperationValue : public IJobOperationValue { private: std::string content_; @@ -40,7 +40,7 @@ virtual Type GetType() const ORTHANC_OVERRIDE; - virtual JobOperationValue* Clone() const ORTHANC_OVERRIDE; + virtual IJobOperationValue* Clone() const ORTHANC_OVERRIDE; const std::string& GetContent() const; diff -r 73de065622ec -r 2ae905070221 OrthancFramework/UnitTestsSources/JobsTests.cpp --- a/OrthancFramework/UnitTestsSources/JobsTests.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancFramework/UnitTestsSources/JobsTests.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -831,12 +831,12 @@ static bool CheckIdempotentSerialization(IJobUnserializer& unserializer, - const JobOperationValue& value) + const IJobOperationValue& value) { Json::Value a = 42; value.Serialize(a); - std::unique_ptr unserialized(unserializer.UnserializeValue(a)); + std::unique_ptr unserialized(unserializer.UnserializeValue(a)); Json::Value b = 43; unserialized->Serialize(b); @@ -891,9 +891,9 @@ GenericJobUnserializer unserializer; std::unique_ptr values(JobOperationValues::Unserialize(unserializer, s)); ASSERT_EQ(3u, values->GetSize()); - ASSERT_EQ(JobOperationValue::Type_Null, values->GetValue(0).GetType()); - ASSERT_EQ(JobOperationValue::Type_String, values->GetValue(1).GetType()); - ASSERT_EQ(JobOperationValue::Type_String, values->GetValue(2).GetType()); + ASSERT_EQ(IJobOperationValue::Type_Null, values->GetValue(0).GetType()); + ASSERT_EQ(IJobOperationValue::Type_String, values->GetValue(1).GetType()); + ASSERT_EQ(IJobOperationValue::Type_String, values->GetValue(2).GetType()); ASSERT_EQ("hello", dynamic_cast(values->GetValue(1)).GetContent()); ASSERT_EQ("world", dynamic_cast(values->GetValue(2)).GetContent()); @@ -916,10 +916,10 @@ ASSERT_THROW(unserializer.UnserializeJob(s), OrthancException); ASSERT_THROW(unserializer.UnserializeOperation(s), OrthancException); - std::unique_ptr value; + std::unique_ptr value; value.reset(unserializer.UnserializeValue(s)); - ASSERT_EQ(JobOperationValue::Type_Null, value->GetType()); + ASSERT_EQ(IJobOperationValue::Type_Null, value->GetType()); { StringOperationValue str("Hello"); @@ -932,7 +932,7 @@ ASSERT_THROW(unserializer.UnserializeOperation(s), OrthancException); value.reset(unserializer.UnserializeValue(s)); - ASSERT_EQ(JobOperationValue::Type_String, value->GetType()); + ASSERT_EQ(IJobOperationValue::Type_String, value->GetType()); ASSERT_EQ("Hello", dynamic_cast(*value).GetContent()); } diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/DeleteResourceOperation.cpp --- a/OrthancServer/Sources/ServerJobs/Operations/DeleteResourceOperation.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/DeleteResourceOperation.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -43,11 +43,11 @@ namespace Orthanc { void DeleteResourceOperation::Apply(JobOperationValues& outputs, - const JobOperationValue& input) + const IJobOperationValue& input) { switch (input.GetType()) { - case JobOperationValue::Type_DicomInstance: + case IJobOperationValue::Type_DicomInstance: { const DicomInstanceOperationValue& instance = dynamic_cast(input); LOG(INFO) << "Lua: Deleting instance: " << instance.GetId(); diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/DeleteResourceOperation.h --- a/OrthancServer/Sources/ServerJobs/Operations/DeleteResourceOperation.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/DeleteResourceOperation.h Mon Nov 09 14:40:51 2020 +0100 @@ -52,7 +52,7 @@ } virtual void Apply(JobOperationValues& outputs, - const JobOperationValue& input) ORTHANC_OVERRIDE; + const IJobOperationValue& input) ORTHANC_OVERRIDE; virtual void Serialize(Json::Value& result) const ORTHANC_OVERRIDE { diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/DicomInstanceOperationValue.h --- a/OrthancServer/Sources/ServerJobs/Operations/DicomInstanceOperationValue.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/DicomInstanceOperationValue.h Mon Nov 09 14:40:51 2020 +0100 @@ -34,13 +34,13 @@ #pragma once #include "../../../../OrthancFramework/Sources/Compatibility.h" // For ORTHANC_OVERRIDE -#include "../../../../OrthancFramework/Sources/JobsEngine/Operations/JobOperationValue.h" +#include "../../../../OrthancFramework/Sources/JobsEngine/Operations/IJobOperationValue.h" namespace Orthanc { class ServerContext; - class DicomInstanceOperationValue : public JobOperationValue + class DicomInstanceOperationValue : public IJobOperationValue { private: ServerContext& context_; @@ -71,7 +71,7 @@ void ReadDicom(std::string& dicom) const; - virtual JobOperationValue* Clone() const ORTHANC_OVERRIDE + virtual IJobOperationValue* Clone() const ORTHANC_OVERRIDE { return new DicomInstanceOperationValue(context_, id_); } diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/ModifyInstanceOperation.cpp --- a/OrthancServer/Sources/ServerJobs/Operations/ModifyInstanceOperation.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/ModifyInstanceOperation.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -81,9 +81,9 @@ } void ModifyInstanceOperation::Apply(JobOperationValues& outputs, - const JobOperationValue& input) + const IJobOperationValue& input) { - if (input.GetType() != JobOperationValue::Type_DicomInstance) + if (input.GetType() != IJobOperationValue::Type_DicomInstance) { throw OrthancException(ErrorCode_BadParameterType); } diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/ModifyInstanceOperation.h --- a/OrthancServer/Sources/ServerJobs/Operations/ModifyInstanceOperation.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/ModifyInstanceOperation.h Mon Nov 09 14:40:51 2020 +0100 @@ -67,7 +67,7 @@ } virtual void Apply(JobOperationValues& outputs, - const JobOperationValue& input) ORTHANC_OVERRIDE; + const IJobOperationValue& input) ORTHANC_OVERRIDE; virtual void Serialize(Json::Value& target) const ORTHANC_OVERRIDE; }; diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/StorePeerOperation.cpp --- a/OrthancServer/Sources/ServerJobs/Operations/StorePeerOperation.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/StorePeerOperation.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -44,13 +44,13 @@ namespace Orthanc { void StorePeerOperation::Apply(JobOperationValues& outputs, - const JobOperationValue& input) + const IJobOperationValue& input) { // Configure the HTTP client HttpClient client(peer_, "instances"); client.SetMethod(HttpMethod_Post); - if (input.GetType() != JobOperationValue::Type_DicomInstance) + if (input.GetType() != IJobOperationValue::Type_DicomInstance) { throw OrthancException(ErrorCode_BadParameterType); } diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/StorePeerOperation.h --- a/OrthancServer/Sources/ServerJobs/Operations/StorePeerOperation.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/StorePeerOperation.h Mon Nov 09 14:40:51 2020 +0100 @@ -58,7 +58,7 @@ } virtual void Apply(JobOperationValues& outputs, - const JobOperationValue& input) ORTHANC_OVERRIDE; + const IJobOperationValue& input) ORTHANC_OVERRIDE; virtual void Serialize(Json::Value& result) const ORTHANC_OVERRIDE; }; diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/StoreScuOperation.cpp --- a/OrthancServer/Sources/ServerJobs/Operations/StoreScuOperation.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/StoreScuOperation.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -44,11 +44,11 @@ namespace Orthanc { void StoreScuOperation::Apply(JobOperationValues& outputs, - const JobOperationValue& input) + const IJobOperationValue& input) { TimeoutDicomConnectionManager::Lock lock(connectionManager_, localAet_, modality_); - if (input.GetType() != JobOperationValue::Type_DicomInstance) + if (input.GetType() != IJobOperationValue::Type_DicomInstance) { throw OrthancException(ErrorCode_BadParameterType); } diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/StoreScuOperation.h --- a/OrthancServer/Sources/ServerJobs/Operations/StoreScuOperation.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/StoreScuOperation.h Mon Nov 09 14:40:51 2020 +0100 @@ -76,7 +76,7 @@ } virtual void Apply(JobOperationValues& outputs, - const JobOperationValue& input) ORTHANC_OVERRIDE; + const IJobOperationValue& input) ORTHANC_OVERRIDE; virtual void Serialize(Json::Value& result) const ORTHANC_OVERRIDE; }; diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/SystemCallOperation.cpp --- a/OrthancServer/Sources/ServerJobs/Operations/SystemCallOperation.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/SystemCallOperation.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -74,7 +74,7 @@ void SystemCallOperation::Apply(JobOperationValues& outputs, - const JobOperationValue& input) + const IJobOperationValue& input) { std::vector arguments = preArguments_; @@ -84,7 +84,7 @@ switch (input.GetType()) { - case JobOperationValue::Type_DicomInstance: + case IJobOperationValue::Type_DicomInstance: { const DicomInstanceOperationValue& instance = dynamic_cast(input); @@ -103,7 +103,7 @@ break; } - case JobOperationValue::Type_String: + case IJobOperationValue::Type_String: { const StringOperationValue& value = dynamic_cast(input); @@ -112,7 +112,7 @@ break; } - case JobOperationValue::Type_Null: + case IJobOperationValue::Type_Null: break; default: diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/Operations/SystemCallOperation.h --- a/OrthancServer/Sources/ServerJobs/Operations/SystemCallOperation.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/Operations/SystemCallOperation.h Mon Nov 09 14:40:51 2020 +0100 @@ -94,7 +94,7 @@ const std::string& GetPostArgument(size_t i) const; virtual void Apply(JobOperationValues& outputs, - const JobOperationValue& input) ORTHANC_OVERRIDE; + const IJobOperationValue& input) ORTHANC_OVERRIDE; virtual void Serialize(Json::Value& result) const ORTHANC_OVERRIDE; }; diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/OrthancJobUnserializer.cpp --- a/OrthancServer/Sources/ServerJobs/OrthancJobUnserializer.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/OrthancJobUnserializer.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -140,7 +140,7 @@ } - JobOperationValue* OrthancJobUnserializer::UnserializeValue(const Json::Value& source) + IJobOperationValue* OrthancJobUnserializer::UnserializeValue(const Json::Value& source) { const std::string type = SerializationToolbox::ReadString(source, "Type"); diff -r 73de065622ec -r 2ae905070221 OrthancServer/Sources/ServerJobs/OrthancJobUnserializer.h --- a/OrthancServer/Sources/ServerJobs/OrthancJobUnserializer.h Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/Sources/ServerJobs/OrthancJobUnserializer.h Mon Nov 09 14:40:51 2020 +0100 @@ -54,6 +54,6 @@ virtual IJobOperation* UnserializeOperation(const Json::Value& value) ORTHANC_OVERRIDE; - virtual JobOperationValue* UnserializeValue(const Json::Value& value) ORTHANC_OVERRIDE; + virtual IJobOperationValue* UnserializeValue(const Json::Value& value) ORTHANC_OVERRIDE; }; } diff -r 73de065622ec -r 2ae905070221 OrthancServer/UnitTestsSources/ServerJobsTests.cpp --- a/OrthancServer/UnitTestsSources/ServerJobsTests.cpp Sat Nov 07 08:02:36 2020 +0100 +++ b/OrthancServer/UnitTestsSources/ServerJobsTests.cpp Mon Nov 09 14:40:51 2020 +0100 @@ -351,12 +351,12 @@ static bool CheckIdempotentSerialization(IJobUnserializer& unserializer, - JobOperationValue& value) + IJobOperationValue& value) { Json::Value a = 42; value.Serialize(a); - std::unique_ptr unserialized(unserializer.UnserializeValue(a)); + std::unique_ptr unserialized(unserializer.UnserializeValue(a)); Json::Value b = 43; unserialized->Serialize(b); @@ -559,9 +559,9 @@ instance.Serialize(s); } - std::unique_ptr value; + std::unique_ptr value; value.reset(unserializer.UnserializeValue(s)); - ASSERT_EQ(JobOperationValue::Type_DicomInstance, value->GetType()); + ASSERT_EQ(IJobOperationValue::Type_DicomInstance, value->GetType()); ASSERT_EQ(id, dynamic_cast(*value).GetId()); {