SmartEngine  1.6.0
Object.h
1 // Copyright (C) Entropy Software LLC - All Rights Reserved
2 
3 #pragma once
4 
5 #include "Defines.h"
6 #include "Utilities.h"
7 #include <typeindex>
8 
9 namespace SmartEngine
10 {
11 
12 typedef int64 ObjectId;
13 typedef unsigned int ObjectClassId;
14 
18 class SMARTENGINE_EXPORT IObject
19 {
20 public:
21  SMARTENGINE_DECLARE_CLASS(IObject)
22 
23 
24  virtual ObjectId GetId() const = 0;
27 
31  virtual void AddRef() const = 0;
32 
40  virtual void Release() const = 0;
41 
45  virtual int GetRefCount() const = 0;
46 
51  virtual void* QueryInterface(ObjectClassId id) = 0;
52 
53 protected:
54  IObject() {}
55 
56  IObject(IObject const&) = delete;
57  void operator=(IObject const& x) = delete;
58 };
59 
61 typedef IObject* ObjPtr;
62 
63 extern "C"
64 {
65  SMARTENGINE_EXPORT void Object_AddRef(ObjPtr object);
66  SMARTENGINE_EXPORT void Object_Release(ObjPtr object);
67 }
69 
70 } // namespace SmartEngine
71 
72 #include "ObjectPtr.h"
SmartEngine::IObject::operator=
void operator=(IObject const &x)=delete
SmartEngine::IObject::Release
virtual void Release() const =0
Decrements the internal reference count on this object. It is not common to use this method directly.
SmartEngine
Definition: A2CTrainer.h:10
SmartEngine::IObject
Base class for SmartEngine AI objects. It is not common to deal with this class directly.
Definition: Object.h:19
SmartEngine::ObjectClassId
unsigned int ObjectClassId
Definition: Object.h:13
SmartEngine::IObject::QueryInterface
virtual void * QueryInterface(ObjectClassId id)=0
Queries the object for an interface and returns a pointer to that interface if found.
SmartEngine::IObject::AddRef
virtual void AddRef() const =0
Increments the internal reference count on this object. It is not common to use this method directly.
SmartEngine::ObjectId
int64 ObjectId
Definition: Object.h:12
SmartEngine::IObject::GetRefCount
virtual int GetRefCount() const =0
Returns the number of references to this object.