GCC Code Coverage Report


Directory: libimgdoc2/
File: libimgdoc2/inc/IDoc.h
Date: 2025-02-03 12:41:04
Exec Total Coverage
Lines: 2 2 100.0%
Functions: 2 2 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 // SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH
2 //
3 // SPDX-License-Identifier: MIT
4
5 #pragma once
6
7 #include <memory>
8
9 namespace imgdoc2
10 {
11 class IDocWrite2d;
12 class IDocRead2d;
13 class IDocumentMetadataWrite;
14 class IDocumentMetadataRead;
15
16 /// This interface is representing a 'document'. The discovery phase of the document has been completed successfully.
17 /// Depending on the type of the document, objects for interacting with it can be created.
18 class IDoc
19 {
20 public:
21 /// Try to get a "write object" for a 2D-document. This method may return an empty shared_ptr
22 /// if such an object cannot be constructed.
23 /// \returns The writer-object (for 2D-document).
24 virtual std::shared_ptr<imgdoc2::IDocWrite2d> GetWriter2d() = 0;
25
26 /// Try to get a "read object" for a 2D-document. This method may return an empty shared_ptr
27 /// if such an object cannot be constructed.
28 /// \returns The read-object (for 2D-document).
29 virtual std::shared_ptr<imgdoc2::IDocRead2d> GetReader2d() = 0;
30
31 /// Try to get a "write object" for a 3D-document. This method may return an empty shared_ptr
32 /// if such an object cannot be constructed.
33 /// \returns The writer-object (for 3D-document).
34 virtual std::shared_ptr<imgdoc2::IDocWrite3d> GetWriter3d() = 0;
35
36 /// Try to get a "read object" for a 3D-document. This method may return an empty shared_ptr
37 /// if such an object cannot be constructed.
38 /// \returns The read-object (for 3D-document).
39 virtual std::shared_ptr<imgdoc2::IDocRead3d> GetReader3d() = 0;
40
41 virtual std::shared_ptr<imgdoc2::IDocumentMetadataWrite> GetDocumentMetadataWriter() = 0;
42
43 virtual std::shared_ptr<imgdoc2::IDocumentMetadataRead> GetDocumentMetadataReader() = 0;
44
45 504 virtual ~IDoc() = default;
46
47 public:
48 // no copy and no move (-> https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c21-if-you-define-or-delete-any-copy-move-or-destructor-function-define-or-delete-them-all )
49 252 IDoc() = default;
50 IDoc(const IDoc&) = delete; // copy constructor
51 IDoc& operator=(const IDoc&) = delete; // copy assignment
52 IDoc(IDoc&&) = delete; // move constructor
53 IDoc& operator=(IDoc&&) = delete; // move assignment
54 };
55 }
56