* provided "as is" without express or implied warranty. *
**************************************************************************/
-/** @file AliHLTHOMERLibManager.cxx
- @author Matthias Richter
- @date
- @brief dynamic HLT HOMER reader/writer generation and destruction. */
-
-// see header file for class documentation
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+/// @file AliHLTHOMERLibManager.cxx
+/// @author Matthias Richter
+/// @date
+/// @brief dynamic HLT HOMER reader/writer generation and destruction.
#include <cerrno>
#include <cassert>
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTHOMERLibManager)
+// global flag of the library status
+int AliHLTHOMERLibManager::fgLibraryStatus=0;
// This list must be NULL terminated, since we use it as a marker to identify
// the end of the list.
const char* AliHLTHOMERLibManager::fgkLibraries[] = {"libAliHLTHOMER.so", "libHOMER.so", NULL};
AliHLTHOMERLibManager::AliHLTHOMERLibManager()
:
- fLibraryStatus(0),
fFctCreateReaderFromTCPPort(NULL),
fFctCreateReaderFromTCPPorts(NULL),
fFctCreateReaderFromBuffer(NULL),
fFctDeleteWriter(NULL),
fLoadedLib(NULL)
{
- // see header file for class documentation
- // or
- // refer to README to build package
- // or
- // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+ // constructor
+ //
+ // Interface to the HLT Online Monitoring Including Root (HOMER) library.
+ // It allows to decouple the HLT base library from this additional library
+ // while providing the basic functionality to the component libraries
}
AliHLTHOMERLibManager::~AliHLTHOMERLibManager()
{
- // see header file for class documentation
- UnloadHOMERLibrary();
+ // destructor
+ //
+ // the library load strategy has been changed in March 2013 in order to
+ // stabilize the runtime memory layout of AliRoot in an attemp to get control
+ // over memory corruptions
+ // UnloadHOMERLibrary();
}
AliHLTHOMERReader* AliHLTHOMERLibManager::OpenReader(const char* hostname, unsigned short port )
{
- // see header file for class documentation
- if (fLibraryStatus<0) return NULL;
+ // Open Reader instance for host
+ if (fgLibraryStatus<0) return NULL;
- if (fLibraryStatus==0) {
- fLibraryStatus=LoadHOMERLibrary();
+ if (fgLibraryStatus==0) {
+ fgLibraryStatus=LoadHOMERLibrary();
}
AliHLTHOMERReader* pReader=NULL;
AliHLTHOMERReader* AliHLTHOMERLibManager::OpenReader(unsigned int tcpCnt, const char** hostnames, unsigned short* ports)
{
- // see header file for class documentation
- if (fLibraryStatus<0) return NULL;
+ // Open Reader instance for a list of hosts
+ if (fgLibraryStatus<0) return NULL;
- if (fLibraryStatus==0) {
- fLibraryStatus=LoadHOMERLibrary();
+ if (fgLibraryStatus==0) {
+ fgLibraryStatus=LoadHOMERLibrary();
}
AliHLTHOMERReader* pReader=NULL;
AliHLTHOMERReader* AliHLTHOMERLibManager::OpenReaderBuffer(const AliHLTUInt8_t* pBuffer, int size)
{
- // see header file for class documentation
- if (fLibraryStatus<0) return NULL;
+ // Open Reader instance for a data buffer
+ if (fgLibraryStatus<0) return NULL;
- if (fLibraryStatus==0) {
- fLibraryStatus=LoadHOMERLibrary();
+ if (fgLibraryStatus==0) {
+ fgLibraryStatus=LoadHOMERLibrary();
}
AliHLTHOMERReader* pReader=NULL;
int AliHLTHOMERLibManager::DeleteReader(AliHLTHOMERReader* pReader)
{
- // see header file for class documentation
- if (fLibraryStatus<0) return fLibraryStatus;
+ // delete a reader
+
+ // the actual deletion function is inside the HOMER library
+ if (fgLibraryStatus<0) return fgLibraryStatus;
- if (fLibraryStatus==0) {
- fLibraryStatus=LoadHOMERLibrary();
+ if (fgLibraryStatus==0) {
+ fgLibraryStatus=LoadHOMERLibrary();
}
if (fFctDeleteReader!=NULL) {
AliHLTHOMERWriter* AliHLTHOMERLibManager::OpenWriter()
{
- // see header file for class documentation
- if (fLibraryStatus<0) return NULL;
+ // open a Writer instance
+ if (fgLibraryStatus<0) return NULL;
- if (fLibraryStatus==0) {
- fLibraryStatus=LoadHOMERLibrary();
+ if (fgLibraryStatus==0) {
+ fgLibraryStatus=LoadHOMERLibrary();
}
AliHLTHOMERWriter* pWriter=NULL;
int AliHLTHOMERLibManager::DeleteWriter(AliHLTHOMERWriter* pWriter)
{
// see header file for class documentation
- if (fLibraryStatus<0) return fLibraryStatus;
+ if (fgLibraryStatus<0) return fgLibraryStatus;
- if (fLibraryStatus==0) {
- fLibraryStatus=LoadHOMERLibrary();
+ if (fgLibraryStatus==0) {
+ fgLibraryStatus=LoadHOMERLibrary();
}
if (fFctDeleteWriter!=NULL) {
int AliHLTHOMERLibManager::LoadHOMERLibrary()
{
- // see header file for class documentation
+ // delete a writer
+
+ // the actual deletion function is inside the HOMER library
int iResult=-EBADF;
const char** library=&fgkLibraries[0];
int* refcount = &fgkLibRefCount[0];
int AliHLTHOMERLibManager::UnloadHOMERLibrary()
{
- // see header file for class documentation
+ // unload HOMER library
int iResult=0;
if (fLoadedLib != NULL)
//-*- Mode: C++ -*-
-// @(#) $Id$
+// $Id$
#ifndef ALIHLTHOMERLIBMANAGER_H
#define ALIHLTHOMERLIBMANAGER_H
* ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-/** @file AliHLTHOMERLibManager.h
- @author Matthias Richter
- @date
- @brief dynamic HLT HOMER reader/writer generation and destruction
-
-// see below for class documentation
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
- */
+/// @file AliHLTHOMERLibManager.h
+/// @author Matthias Richter
+/// @date
+/// @brief dynamic HLT HOMER reader/writer generation and destruction
+
#include "AliHLTDataTypes.h"
#include "TObject.h" // for ClassDef/Imp
int UnloadHOMERLibrary();
/** status of the loading of the HOMER library */
- int fLibraryStatus; //!transient
+static int fgLibraryStatus; //!transient
/** entry in the HOMER library */
void (*fFctCreateReaderFromTCPPort)(); //!transient