CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Object.hpp
Go to the documentation of this file.
1 #pragma once
3 namespace CYB {
4  namespace API {
5  namespace Interop {
10  template <class AInterface> class Object {
11  private:
12  AInterface* FPointer;
13  public:
20  Object(AInterface* const APointer) noexcept;
21  Object(const Object<AInterface>& ACopy);
22  Object(Object&& AMove) noexcept;
23  Object& operator=(Object&& AMove) noexcept;
24  ~Object();
25 
32  AInterface& operator()(void) noexcept;
39  const AInterface& operator()(void) const noexcept;
40 
47  bool Valid(void) const noexcept;
48 
57  template <class ANewInterface> static Object<ANewInterface> Upcast(Object&& AUpcastable) noexcept;
58  };
59  };
60  };
61 };
Template type for wrapping pointers and treating them as objects. Only works with CyberEngine interfa...
Definition: Object.hpp:10
bool Valid(void) const noexcept
Checks that the pointer isn't null. Will never be the case unless function says otherwise.
Object(AInterface *const APointer) noexcept
Construct an object.
static Object< ANewInterface > Upcast(Object &&AUpcastable) noexcept
Cast an Object to one of it's base classes.
AInterface * FPointer
The pointer to the managed object.
Definition: Object.hpp:12