Zivid C++ API  2.4.2+1a2e8cfb-1
Defining the Future of 3D Machine Vision
Macros
Pimpl.h File Reference
#include <memory>

Go to the source code of this file.

Macros

#define ZIVID_PIMPL_VALUE_SEMANTICS(ClassName, Attributes)
 
#define ZIVID_PIMPL_VALUE_SEMANTICS_CPP(ClassName)
 
#define ZIVID_PIMPL_MOVE_ONLY(ClassName, Attributes)
 
#define ZIVID_PIMPL_MOVE_ONLY_CPP(ClassName)
 
#define ZIVID_PIMPL_REFERENCE_SEMANTICS(ClassName, Attributes)
 

Macro Definition Documentation

◆ ZIVID_PIMPL_MOVE_ONLY

#define ZIVID_PIMPL_MOVE_ONLY (   ClassName,
  Attributes 
)
Value:
public: \
Attributes ~ClassName(); \
Attributes ClassName(const ClassName &other) = delete; \
Attributes ClassName &operator=(const ClassName &other) = delete; \
Attributes ClassName(ClassName &&other) noexcept; \
Attributes ClassName &operator=(ClassName &&other) noexcept; \
\
Attributes explicit ClassName(std::unique_ptr<class ClassName##Impl> &&impl); \
Attributes class ClassName##Impl &getImpl(); \
Attributes const class ClassName##Impl &getImpl() const; \
\
private: \
std::unique_ptr<class ClassName##Impl> m_impl

◆ ZIVID_PIMPL_MOVE_ONLY_CPP

#define ZIVID_PIMPL_MOVE_ONLY_CPP (   ClassName)
Value:
ClassName::ClassName(std::unique_ptr<ClassName##Impl> &&impl) \
: m_impl{ std::move(impl) } \
{} \
\
ClassName##Impl &ClassName::getImpl() \
{ \
return *m_impl; \
} \
\
const ClassName##Impl &ClassName::getImpl() const \
{ \
return *m_impl; \
} \
\
ClassName::~ClassName() = default; \
ClassName::ClassName(ClassName &&other) noexcept = default; \
ClassName &ClassName::operator=(ClassName &&other) noexcept = default

◆ ZIVID_PIMPL_REFERENCE_SEMANTICS

#define ZIVID_PIMPL_REFERENCE_SEMANTICS (   ClassName,
  Attributes 
)
Value:
public: \ \
Attributes ClassName clone() const; \
\
Attributes ~ClassName(); \
Attributes ClassName(const ClassName &other); \
Attributes ClassName &operator=(const ClassName &other); \
Attributes ClassName(ClassName &&other) noexcept; \
Attributes ClassName &operator=(ClassName &&other) noexcept; \
\
Attributes explicit ClassName(class ClassName##Impl &&impl); \
Attributes class ClassName##Impl &getImpl(); \
Attributes const class ClassName##Impl &getImpl() const; \
\
private: \
std::shared_ptr<class ClassName##Impl> m_impl

◆ ZIVID_PIMPL_VALUE_SEMANTICS

#define ZIVID_PIMPL_VALUE_SEMANTICS (   ClassName,
  Attributes 
)
Value:
public: \
Attributes ~ClassName(); \
Attributes ClassName(const ClassName &other); \
Attributes ClassName &operator=(const ClassName &other); \
Attributes ClassName(ClassName &&other) noexcept; \
Attributes ClassName &operator=(ClassName &&other) noexcept; \
\
Attributes explicit ClassName(std::unique_ptr<class ClassName##Impl> &&impl); \
Attributes explicit ClassName(class ClassName##Impl &&impl); \
Attributes class ClassName##Impl &getImpl(); \
Attributes const class ClassName##Impl &getImpl() const; \
\
private: \
std::unique_ptr<class ClassName##Impl> m_impl

◆ ZIVID_PIMPL_VALUE_SEMANTICS_CPP

#define ZIVID_PIMPL_VALUE_SEMANTICS_CPP (   ClassName)