The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
IInterface.h File Reference
#include <Gaudi/Concepts.h>
#include <GaudiKernel/Kernel.h>
#include <GaudiKernel/StatusCode.h>
#include <GaudiKernel/System.h>
#include <ostream>
#include <type_traits>
#include <typeinfo>
#include <GaudiKernel/extend_interfaces.h>
#include <GaudiKernel/extends.h>
#include <GaudiKernel/implements.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< 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< interface_list< Is... >, I >
 
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

namespace  Gaudi
 This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from python with a format liks : ( nbins, min, max, title ) where title can be ommited.
 
namespace  Gaudi::meta
 
namespace  Gaudi::meta::detail
 

Macros

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

Typedefs

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

Functions

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)
 
template<typename TARGET>
const TARGET * Gaudi::Cast (const IInterface *i)
 
template<class IFace>
bool isValidInterface (IFace *i)
 Templated function that throws an exception if the version if the interface implemented by the object behind the interface is incompatible.
 
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.
 

Macro Definition Documentation

◆ DeclareInterfaceID

#define DeclareInterfaceID ( iface,
major,
minor )
Value:
static const InterfaceID& interfaceID() { return iid::interfaceID(); } \
using ext_iids = typename iid::iids
Interface ID class.
Definition IInterface.h:38
Class to handle automatically the versioning of the interfaces when they are inheriting from other in...
Definition IInterface.h:175

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

Definition at line 22 of file IInterface.h.

22#define DeclareInterfaceID( iface, major, minor ) \
23 static const InterfaceID& interfaceID() { return iid::interfaceID(); } \
24 using iid = Gaudi::InterfaceId<iface, major, minor>; \
25 using ext_iids = typename iid::iids

Function Documentation

◆ isValidInterface()

template<class IFace>
bool isValidInterface ( IFace * 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 354 of file IInterface.h.

354 {
355 void* ii = nullptr;
356 return i->queryInterface( IFace::interfaceID(), &ii ).isSuccess();
357}

◆ pp_cast()

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**)&pointerpp_cast<void>(&pointer)
(IInterface *&)m_mySvc*pp_cast<IInterface>(&m_mySvc)

Definition at line 370 of file IInterface.h.

370 {
371 return reinterpret_cast<DEST**>( ptr );
372}