SCENE C++ API  2.0.22
lsinterface.h
1 #pragma once
2 
3 #include <core_api/lsglobaldefinitions.h>
4 
5 namespace SCENE_API {
6 
7 // Forward declarations
8 class LSInterface_Implementation;
9 
14 {
15  LS_UNCOPYABLE(LSInterface)
16 
17 protected:
18  CORE_API_EXPORT explicit LSInterface(LSInterface_Implementation*);
19 public:
20  CORE_API_EXPORT virtual ~LSInterface();
21 
22 private:
23  friend class LSInterface_Implementation;
24  LSInterface_Implementation* m_implementation;
25 };
26 
27 #define LS_INTERFACE(Class, BaseClass) \
28  friend class Class##_Implementation; \
29  inline Class(Class##_Implementation* implementation) : BaseClass((BaseClass##_Implementation*)implementation) {}
30 
31 #define LS_INTERFACE_TEMPLATE(Class, TemplateType, BaseClass) \
32  template <class T> friend class Class##_Implementation; \
33  inline Class(Class##_Implementation<TemplateType>* implementation) : BaseClass((BaseClass##_Implementation*)implementation) {}
34 
35 #define LS_INTERFACE_TEMPLATE2(Class, TemplateType, BaseClass) \
36  template <class T> friend class Class##_Implementation; \
37  inline Class(Class##_Implementation<TemplateType>* implementation) : BaseClass<TemplateType>((BaseClass##_Implementation<TemplateType>*)implementation) {}
38 }