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 300 of file IInterface.h.
306 NO_INTERFACE,
308 VERSMISMATCH,
310 LAST_ERROR
311 };
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;
242 if ( tgt ) {
243
244 auto* target = reinterpret_cast<TARGET*>( tgt );
245
246
247 static_cast<const IInterface*
>( target )->
decRef();
248 return target;
249 }
250 }
251 return nullptr;
252 }
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 274 of file IInterface.h.
274 {
275 return dynamic_cast<TARGET*>( this );
276 }
◆ cast() [3/4]
TARGET const * IInterface::cast |
( |
| ) |
const |
|
inline |
Definition at line 255 of file IInterface.h.
255 {
256 if (
auto output =
i_cast( TARGET::interfaceID() ) ) {
return reinterpret_cast<TARGET const*
>(
output ); }
257 if constexpr ( Gaudi::IsInterface<TARGET> ) {
258 void* tgt = nullptr;
260 if ( tgt ) {
261
262 auto* target = reinterpret_cast<const TARGET*>( tgt );
263
264
265 static_cast<const IInterface*
>( target )->
decRef();
266 return target;
267 }
268 }
269 return nullptr;
270 }
◆ cast() [4/4]
TARGET const * IInterface::cast |
( |
| ) |
const |
|
inline |
Definition at line 280 of file IInterface.h.
280 {
281 return dynamic_cast<TARGET const*>( this );
282 }
◆ 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 320 of file IInterface.h.
320 {
321 return const_cast<void*
>(
const_cast<const IInterface*
>( this )->i_cast(
iid ) );
322 }
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: