File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2019-2022 Diligent Graphics LLC
2+ * Copyright 2019-2024 Diligent Graphics LLC
33 * Copyright 2015-2019 Egor Yusov
44 *
55 * Licensed under the Apache License, Version 2.0 (the "License");
3333#include " InterfaceID.h"
3434#include " ReferenceCounters.h"
3535
36+ #if DILIGENT_CPP_INTERFACE
37+ # include < type_traits>
38+ #endif
39+
3640DILIGENT_BEGIN_NAMESPACE (Diligent)
3741
3842#if DILIGENT_CPP_INTERFACE
@@ -77,6 +81,12 @@ struct IObject
7781 // / reference counters object. The method does *NOT* increment
7882 // / the number of strong references to the returned object.
7983 virtual IReferenceCounters* DILIGENT_CALL_TYPE GetReferenceCounters () const = 0;
84+
85+ template <typename DerivedType, typename = typename std::enable_if<std::is_base_of<IObject, DerivedType>::value>::type>
86+ void QueryInterface (const INTERFACE_ID& IID, DerivedType** ppInterface)
87+ {
88+ QueryInterface (IID, reinterpret_cast <IObject**>(ppInterface));
89+ }
8090};
8191
8292#else
You can’t perform that action at this time.
0 commit comments