Definition of the basic interface.
More...
#include <GaudiKernel/IInterface.h>
|
| virtual unsigned long | decRef () const =0 |
| | Decrement reference count and return the new reference count.
|
| |
Definition of the basic interface.
- Author
- Pere Mato
-
Markus Frank
-
Marco Clemencic
Definition at line 225 of file IInterface.h.
◆ ext_iids
◆ iid
◆ Status
Return status.
| Enumerator |
|---|
| FAILURE | Failure.
|
| SUCCESS | Normal successful completion.
|
| NO_INTERFACE | Requested interface is not available.
|
| VERSMISMATCH | Requested interface version is incompatible.
|
| LAST_ERROR | Last error.
|
Definition at line 307 of file IInterface.h.
313 NO_INTERFACE,
315 VERSMISMATCH,
317 LAST_ERROR
318 };
unsigned long code_t
type of StatusCode value
◆ ~IInterface()
| virtual IInterface::~IInterface |
( |
| ) |
|
|
virtualdefault |
◆ addRef()
| virtual unsigned long IInterface::addRef |
( |
| ) |
const |
|
pure virtual |
Increment the reference count of Interface instance.
◆ cast() [1/4]
| TARGET * IInterface::cast |
( |
| ) |
|
|
inline |
Definition at line 237 of file IInterface.h.
237 {
238 if (
auto output =
i_cast( TARGET::interfaceID() ) ) {
return reinterpret_cast<TARGET*
>(
output ); }
239 if constexpr ( Gaudi::IsInterface<TARGET> ) {
240 void* tgt = nullptr;
241#pragma GCC diagnostic push
242#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
244#pragma GCC diagnostic pop
245 if ( tgt ) {
246
247 auto* target = reinterpret_cast<TARGET*>( tgt );
248
249
250 static_cast<const IInterface*
>( target )->
decRef();
251 return target;
252 }
253 }
254 return nullptr;
255 }
virtual StatusCode queryInterface(const InterfaceID &ti, void **pp)=0
Set the void** to the pointer to the requested interface of the instance.
virtual void const * i_cast(const InterfaceID &) const =0
virtual unsigned long decRef() const =0
Decrement reference count and return the new reference count.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
◆ cast() [2/4]
| TARGET * IInterface::cast |
( |
| ) |
|
|
inline |
Definition at line 280 of file IInterface.h.
280 {
281 return dynamic_cast<TARGET*>( this );
282 }
◆ cast() [3/4]
| TARGET const * IInterface::cast |
( |
| ) |
const |
|
inline |
Definition at line 258 of file IInterface.h.
258 {
259 if (
auto output =
i_cast( TARGET::interfaceID() ) ) {
return reinterpret_cast<TARGET const*
>(
output ); }
260 if constexpr ( Gaudi::IsInterface<TARGET> ) {
261 void* tgt = nullptr;
262#pragma GCC diagnostic push
263#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
265#pragma GCC diagnostic pop
266 if ( tgt ) {
267
268 auto* target = reinterpret_cast<const TARGET*>( tgt );
269
270
271 static_cast<const IInterface*
>( target )->
decRef();
272 return target;
273 }
274 }
275 return nullptr;
276 }
◆ cast() [4/4]
| TARGET const * IInterface::cast |
( |
| ) |
const |
|
inline |
Definition at line 286 of file IInterface.h.
286 {
287 return dynamic_cast<TARGET const*>( this );
288 }
◆ decRef()
| virtual unsigned long IInterface::decRef |
( |
| ) |
const |
|
protectedpure virtual |
Decrement reference count and return the new reference count.
◆ getInterfaceNames()
| virtual std::vector< std::string > IInterface::getInterfaceNames |
( |
| ) |
const |
|
pure virtual |
Returns a vector of strings containing the names of all the implemented interfaces.
◆ i_cast() [1/2]
| virtual void const * IInterface::i_cast |
( |
const InterfaceID & | | ) |
const |
|
pure virtual |
◆ i_cast() [2/2]
Definition at line 327 of file IInterface.h.
327 {
328 return const_cast<void*
>(
const_cast<const IInterface*
>( this )->i_cast(
iid ) );
329 }
Gaudi::InterfaceId< IInterface, 0, 0 > iid
Interface ID.
◆ interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition at line 234 of file IInterface.h.
static const InterfaceID & interfaceID()
◆ queryInterface()
Set the void** to the pointer to the requested interface of the instance.
◆ refCount()
| virtual unsigned long IInterface::refCount |
( |
| ) |
const |
|
pure virtual |
◆ release()
| virtual unsigned long IInterface::release |
( |
| ) |
const |
|
pure virtual |
Release Interface instance.
The documentation for this class was generated from the following file: