All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
IInterface.h File Reference
#include "GaudiKernel/Kernel.h"
#include "GaudiKernel/System.h"
#include "GaudiKernel/StatusCode.h"
#include <ostream>
#include <boost/mpl/set.hpp>
#include <boost/mpl/insert.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/for_each.hpp>
#include <typeinfo>
#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...
 
class  Gaudi::InterfaceId< INTERFACE, majVers, minVers >
 Class to handle automatically the versioning of the interfaces when they are inheriting from other interfaces. More...
 
class  IInterface
 Definition of the basic interface. More...
 

Namespaces

 Gaudi
 Helper functions to set/get the application return code.
 

Macros

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

Functions

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 (   name,
  major,
  minor 
)
Value:
static const InterfaceID &interfaceID(){ return iid::interfaceID(); } \
typedef iid::iids::type ext_iids
Interface ID class.
Definition: IInterface.h:55
string type
Definition: gaudirun.py:126
Class to handle automatically the versioning of the interfaces when they are inheriting from other in...
Definition: IInterface.h:121

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

Definition at line 23 of file IInterface.h.

#define DeclareInterfaceIDMultiBase (   name,
  major,
  minor 
)
Value:
static const InterfaceID &interfaceID(){ return iid::interfaceID(); } \
Interface ID class.
Definition: IInterface.h:55
Class to handle automatically the versioning of the interfaces when they are inheriting from other in...
Definition: IInterface.h:121

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

Definition at line 35 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 257 of file IInterface.h.

257  {
258  void* ii;
259  StatusCode sc = i->queryInterface( I::interfaceID(), &ii);
260  return sc.isSuccess();
261 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
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 265 of file IInterface.h.

265  {
266  s << "IID_" << id.id();
267  return s;
268 }
string s
Definition: gaudirun.py:210
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 282 of file IInterface.h.

282  {
283  return reinterpret_cast<DEST**>(ptr);
284 }