23.05.2014 Views

Athena Developer Guide

Athena Developer Guide

Athena Developer Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Athena</strong><br />

Chapter 18 Framework packages, interfaces and libraries Version/Issue: 2.0.0<br />

18.4.1.3 Loading Components<br />

Components within the component library are loaded in a file MyComponents_load.cpp. By<br />

convention, the name of this file is the package name concatenated with _load. The contents of this<br />

file are shown below:<br />

Listing 18.5 The MyComponents_load.cpp file<br />

#include "GaudiKernel/LoadFactoryEntries.h"<br />

LOAD_FACTORY_ENTRIES( MyComponents ) [1]<br />

Notes:<br />

1. The argument of LOAD_FACTORY_ENTRIES is the name of the component library.<br />

18.4.1.4 Specifying component libraries at run-time<br />

The fragment of the job options file that specifies the component library at run-time is shown below.<br />

Listing 18.6 Selecting and running the desired tutorial example<br />

ApplicationMgr.DLLs += { "MyComponents" }; [1]<br />

Notes:<br />

1. This is a list property, allowing multiple such libraries to be specified in a single line.<br />

2. It is important to use the “+=” syntax to append the new component library or libraries to any<br />

that might already have been configured.<br />

The convention in Gaudi is that component libraries have the same name as the package they belong to<br />

(prefixed by "lib" on Linux). When trying to load a component library, the framework will look for it<br />

in various places following this sequence:<br />

— Look for an environment variable with the name of the package, suffixed by "Shr" (e.g.<br />

${MyComponentsShr}). If it exists, it should translate to the full name of the library,<br />

without the file type suffix (e.g. ${MyComponentsShr}<br />

="$MYSOFT/MyComponents/v1/i386_linux22/libMyComponents" ).<br />

— Try to locate the file libMyComponents.so using the LD_LIBRARY_PATH (on Linux),<br />

or MyComponents.dll using the PATH (on Windows).<br />

18.4.2 Linker libraries<br />

These are libraries containing implementation classes. For example, libraries containing code of a<br />

number of base classes or specific classes without abstract interfaces, etc. These libraries, contrary to<br />

page 165

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!