| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Attributes | List of all members
implements< Interfaces > Struct Template Reference

Base class used to implement the interfaces. More...

`#include <GaudiKernel/implements.h>`

Inheritance diagram for implements< Interfaces >:
[legend]
Collaboration diagram for implements< Interfaces >:
[legend]

## Public Types
using | base_class = implements< Interfaces...>
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces...>
| Typedef to the base of this class. More...
using | iids = typename extend_interfaces_base::ext_iids
Public Types inherited from extend_interfaces< Interfaces...>
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
| take union of the ext_iids of all Interfaces... More...

## Public Member Functions
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| implements ()=default
| Default constructor. More...
| implements (const implements &)
| Copy constructor (zero the reference count) More...
implements & | operator= (const implements &)
| Assignment operator (do not touch the reference count). More...
| ~implements () override=default
| Virtual destructor. More...
unsigned long | addRef () override
| Reference Interface instance. More...
unsigned long | release () override
| Release Interface instance. More...
unsigned long | refCount () const override
| Current reference count. More...
Public Member Functions inherited from extend_interfaces< Interfaces...>
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected Attributes
std::atomic_ulong | m_refCount = {0}
| Reference counter. More...

## Detailed Description

### template<typename... Interfaces>
struct implements< Interfaces >

Base class used to implement the interfaces.

Definition at line 9 of file implements.h.

## Member Typedef Documentation

template<typename... Interfaces>

using implements< Interfaces >::base_class = implements<Interfaces...>

Typedef to this class.

Definition at line 11 of file implements.h.

template<typename... Interfaces>

using implements< Interfaces >::extend_interfaces_base = extend_interfaces<Interfaces...>

Typedef to the base of this class.

Definition at line 13 of file implements.h.

template<typename... Interfaces>

using implements< Interfaces >::iids = typename extend_interfaces_base::ext_iids

Definition at line 14 of file implements.h.

## Constructor & Destructor Documentation

template<typename... Interfaces>

implements< Interfaces >::implements | ( |  | ) |
| default

Default constructor.

template<typename... Interfaces>

implements< Interfaces >::implements | ( | const implements< Interfaces > & |  | ) |
| inline

Copy constructor (zero the reference count)

Definition at line 36 of file implements.h.

36 : m_refCount{0} {}
implements::m_refCount
std::atomic_ulong m_refCount
Reference counter.
Definition: implements.h:57
template<typename... Interfaces>

implements< Interfaces >::~implements | ( |  | ) |
| override default

Virtual destructor.

## Member Function Documentation

template<typename... Interfaces>

unsigned long implements< Interfaces >::addRef | ( |  | ) |
| inline override

Reference Interface instance.

Definition at line 44 of file implements.h.

44 { return ++m_refCount; }
implements::m_refCount
std::atomic_ulong m_refCount
Reference counter.
Definition: implements.h:57
template<typename... Interfaces>

std::vector<std::string> implements< Interfaces >::getInterfaceNames | ( |  | ) | const
| inline override

Implementation of IInterface::getInterfaceNames.

Definition at line 30 of file implements.h.

30 {
31 return Gaudi::getInterfaceNames( iids{} );
32 }
Gaudi::getInterfaceNames
std::vector< std::string > getInterfaceNames(Gaudi::interface_list< Is...>)
Definition: IInterface.h:177
implements::iids
typename extend_interfaces_base::ext_iids iids
Definition: implements.h:14
template<typename... Interfaces>

void* implements< Interfaces >::i_cast | ( | const InterfaceID & | tid | ) | const
| inline override

Implementation of IInterface::i_cast.

Definition at line 18 of file implements.h.

18 {
19 return Gaudi::iid_cast(tid,iids{},this);
20 }
implements::iids
typename extend_interfaces_base::ext_iids iids
Definition: implements.h:14
Gaudi::iid_cast
void * iid_cast(const InterfaceID &tid, Gaudi::interface_list< Is...>, P *ptr)
Definition: IInterface.h:182
template<typename... Interfaces>

implements& implements< Interfaces >::operator= | ( | const implements< Interfaces > & |  | ) |
| inline

Assignment operator (do not touch the reference count).

Definition at line 38 of file implements.h.

38 { return *this; }
template<typename... Interfaces>

StatusCode implements< Interfaces >::queryInterface | ( | const InterfaceID & | ti,
|  | void ** | pp
| ) |  |
| inline override

Implementation of IInterface::queryInterface.

Definition at line 22 of file implements.h.

22 {
23 if (!pp) return StatusCode::FAILURE;
24 *pp = Gaudi::iid_cast(ti,iids{},this);
25 if (!*pp) return StatusCode::FAILURE; /* cast failed */
26 this->addRef();
27 return StatusCode::SUCCESS;
28 }
implements::iids
typename extend_interfaces_base::ext_iids iids
Definition: implements.h:14
StatusCode::FAILURE
Definition: StatusCode.h:29
implements::addRef
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:44
StatusCode::SUCCESS
Definition: StatusCode.h:30
compareOutputFiles.pp
tuple pp
Definition: compareOutputFiles.py:417
Gaudi::iid_cast
void * iid_cast(const InterfaceID &tid, Gaudi::interface_list< Is...>, P *ptr)
Definition: IInterface.h:182
template<typename... Interfaces>

unsigned long implements< Interfaces >::refCount | ( |  | ) | const
| inline override

Current reference count.

Definition at line 53 of file implements.h.

53 { return m_refCount.load(); }
implements::m_refCount
std::atomic_ulong m_refCount
Reference counter.
Definition: implements.h:57
template<typename... Interfaces>

unsigned long implements< Interfaces >::release | ( |  | ) |
| inline override

Release Interface instance.

Definition at line 46 of file implements.h.

46 {
47 /* Avoid to decrement 0 */
48 auto count = ( m_refCount ? --m_refCount : m_refCount.load() );
49 if (count == 0) delete this;
50 return count;
51 }
implements::m_refCount
std::atomic_ulong m_refCount
Reference counter.
Definition: implements.h:57
std::count
T count(T...args)

## Member Data Documentation

template<typename... Interfaces>

std::atomic_ulong implements< Interfaces >::m_refCount = {0}
| protected

Reference counter.

Definition at line 57 of file implements.h.

The documentation for this struct was generated from the following file:

- GaudiKernel/GaudiKernel/implements.h