| The Gaudi Framework v27r1

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

- File List
- File Members

Classes | Namespaces | Macros | Typedefs | Functions
IInterface.h File Reference
`#include "GaudiKernel/Kernel.h"`
`#include "GaudiKernel/System.h"`
`#include "GaudiKernel/StatusCode.h"`
`#include <type_traits>`
`#include <typeinfo>`
`#include <ostream>`
`#include "GaudiKernel/extend_interfaces.h"`
`#include "GaudiKernel/implements.h"`
`#include "GaudiKernel/extends.h"`
Include dependency graph for IInterface.h:

Go to the source code of this file.

## Classes
class | InterfaceID
| Interface ID class. More...
struct | Gaudi::interface_list< I >
struct | Gaudi::meta::id_< T >
struct | Gaudi::meta::detail::inherit_from< Is >
struct | Gaudi::meta::detail::append1< List, I >
struct | Gaudi::meta::detail::append1< interface_list< Is...>, I >
struct | Gaudi::meta::detail::appendN< typename, typename >
struct | Gaudi::meta::detail::appendN< interface_list<>, State >
struct | Gaudi::meta::detail::appendN< interface_list< I, Is...>, List >
struct | Gaudi::interface_list_cat< I >
struct | Gaudi::interface_list_cat< interface_list< I...> >
struct | Gaudi::interface_list_cat< interface_list< I1...>, interface_list< I2...> >
struct | Gaudi::interface_list_cat< interface_list< I1...>, interface_list< I2...>, Others...>
struct | Gaudi::interface_list_append< I >
struct | Gaudi::interface_list_append< interface_list< Is...>, I >
struct | Gaudi::iid_cast_details::iid_cast_t< Is >
struct | Gaudi::iid_cast_details::iid_cast_t<>
struct | Gaudi::iid_cast_details::iid_cast_t< I, Is...>
struct | Gaudi::InterfaceId< INTERFACE, majVers, minVers >
| Class to handle automatically the versioning of the interfaces when they are inheriting from other interfaces. More...
struct | Gaudi::fullMatch_t
struct | Gaudi::majorMatch_t
class | IInterface
| Definition of the basic interface. More...

## Namespaces
| Gaudi
| Helper functions to set/get the application return code.
| Gaudi::meta
| Gaudi::meta::detail
| Gaudi::iid_cast_details

## Macros
#define | DeclareInterfaceID(iface, major, minor)
| Macro to declare the interface ID when using the new mechanism of extending and implementing interfaces. More...

## Typedefs
template<typename... Is>
using | Gaudi::meta::unique_interface_list = detail::appendN< interface_list< Is...>, interface_list<>>

## Functions
template<typename I >
constexpr void * | Gaudi::iid_cast_details::void_cast (const I *i)
template<typename... Is>
std::vector< std::string > | Gaudi::getInterfaceNames (Gaudi::interface_list< Is...>)
template<typename... Is, typename P >
void * | Gaudi::iid_cast (const InterfaceID &tid, Gaudi::interface_list< Is...>, P *ptr)
template<typename TARGET >
TARGET * | Gaudi::Cast (IInterface *i)
| Cast a IInterface pointer to an IInterface specialization (TARGET). More...
template<typename TARGET >
const TARGET * | Gaudi::Cast (const IInterface *i)
| Cast a IInterface pointer to an IInterface specialization (TARGET). More...
template<class I >
bool | isValidInterface (I *i)
| Templated function that throws an exception if the version if the interface implemented by the object behind the interface is incompatible. More...
std::ostream & | operator<< (std::ostream &s, const InterfaceID &id)
| ostream operator for InterfaceID. Needed by PluginSvc More...
template<class DEST , class SRC >
DEST ** | pp_cast (SRC **ptr)
| Small function to be used instead of the construct (void**)&pointer, which produces, on gcc 4.1 optimized, the warning `warning: dereferencing type-punned pointer will break strict-aliasing rules` The assempler code produced is equivalent to the one with the direct cast. More...

## Macro Definition Documentation

#define DeclareInterfaceID | ( |  | iface,
|  |  | major,
|  |  | minor
| ) |  |

Value:
static const InterfaceID &interfaceID() { return iid::interfaceID(); } \
using iid = Gaudi::InterfaceId< iface , major , minor > ; \
using ext_iids = iid::iids
Gaudi::InterfaceId
Class to handle automatically the versioning of the interfaces when they are inheriting from other in...
Definition: IInterface.h:191
InterfaceID
Interface ID class.
Definition: IInterface.h:30

Macro to declare the interface ID when using the new mechanism of extending and implementing interfaces.

Definition at line 14 of file IInterface.h.

## Function Documentation

template<class I >

bool isValidInterface | ( | I * | i | ) |

Templated function that throws an exception if the version if the interface implemented by the object behind the interface is incompatible.

This is the case if the major version differs or that the minor version of the client is bigger than of the implementer.

Note
  A call to this function implies an increment of the reference count in case of success.

Author
  Pere Mato

Definition at line 323 of file IInterface.h.

323 {
324 void* ii = nullptr;;
325 StatusCode sc = i->queryInterface( I::interfaceID(), &ii );
326 return sc.isSuccess();
327 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ana.i
list i
Definition: ana.py:128

std::ostream& operator<< | ( | std::ostream & | s,
|  | const InterfaceID & | id
| ) |  |
| inline

ostream operator for InterfaceID. Needed by PluginSvc

Definition at line 331 of file IInterface.h.

331 {
332 s << "IID_" << id.id();
333 return s;
334 }
gaudirun.s
string s
Definition: gaudirun.py:245
template<class DEST , class SRC >

DEST** pp_cast | ( | SRC ** | ptr | ) |
| inline

Small function to be used instead of the construct (void**)&pointer, which produces, on gcc 4.1 optimized, the warning `warning: dereferencing type-punned pointer will break strict-aliasing rules` The assempler code produced is equivalent to the one with the direct cast.

The function can be used als to replace the construct (IInterface *&)m_MySvc. Replacement rules:

`(void**)&pointer` | `pp_cast<void>(&pointer)`
`(IInterface *&)m_mySvc` | `*pp_cast<IInterface>(&m_mySvc)`

Definition at line 348 of file IInterface.h.

348 {
349 return reinterpret_cast<DEST**>(ptr);
350 }