Hi, I'd like to use the DCMTK DICOM medical imaging library with Swift. This is written in C++, and appears to have complex (to me with little C++ experience) copy semantics for its classes. For example, I would like to create an instance of the DcmFindSCU class to connect to a remote DICOM server, but calling let scu = DcmFindSCU
gives the following:
let findSCU = DcmFindSCU()
^~~~~~~~~~
/usr/include/dcmtk/dcmnet/dfindscu.h:202:27: note: record 'DcmFindSCU' is not automatically available: does not have a copy constructor or destructor; does this type have reference semantics?
class DCMTK_DCMNET_EXPORT DcmFindSCU
^
SWIFT_SHARED_REFERENCE(<#retain#>, <#release#>)
The class definition is as follows:
class DCMTK_DCMNET_EXPORT DcmFindSCU
{
public:
/// constructor, does not execute any network-related code.
DcmFindSCU();
/// destructor. Destroys network structure if not done already.
virtual ~DcmFindSCU();
...
/** Private undefined copy constructor
* @param other documented to avoid doxygen warnings
*/
DcmFindSCU(const DcmFindSCU& other);
/** Private undefined assignment operator
* @param other documented to avoid doxygen warnings
*/
DcmFindSCU& operator=(const DcmFindSCU& other);
private:
...
};
I'm using a recent -main build of swift on Fedora rawhide - Swift version 5.11-dev (LLVM 69fa38fd6c00774, Swift b1f68a047abce10)
Even if I could add the required constructor/destructor to conform to value semantics, I do not think this would be accepted upstream. I'm not a C++ programmer and would appreciate any guidance as to whether and how this may be possible, thanks!