]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTHOMERLibManager.h
introducing function IsSelected which allows child classes to selectively publish...
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTHOMERLibManager.h
index e26c98120435a1d02ab8771a783f67619c410746..96e940d4d0fc03516a2a56e73cb0d3494060e45a 100644 (file)
@@ -1,3 +1,4 @@
+
 //-*- Mode: C++ -*-
 // @(#) $Id$
 
@@ -18,8 +19,8 @@
 // or
 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
                                                                           */
-
-#include "AliHLTLogging.h"
+#include "AliHLTDataTypes.h"
+#include "TObject.h" // for ClassDef/Imp
 
 class AliHLTHOMERReader;
 class AliHLTHOMERWriter;
@@ -43,8 +44,9 @@ class AliHLTHOMERWriter;
  * AliHLTMonitoringReader* pReader=manager.OpenReader(localhost, 23000);
  *
  * // read next event, timeout 5s
- * while (pReader && pReader->ReadNextEvent(5000000)) {
+ * while (pReader && pReader->ReadNextEvent(5000000)==0) {
  *   unsigned long count=pReader->GetBlockCnt();
+ *   gSystem->Sleep(5);
  *   ...
  * }
  *
@@ -52,11 +54,15 @@ class AliHLTHOMERWriter;
  * manager.DeleteReader(pReader);
  * </pre>
  *
- * The manager does not not provide methods to create a HOMER reader on
+ * The manager does not provide methods to create a HOMER reader on
  * basis of shared memory. This is most likely a depricated functionality,
- * although kept for the sake of completeness.
+ * although kept for the sake of completeness. However, at some point it
+ * might become useful. Please notify the developers if you need that
+ * functionality.
+ *
+ * @ingroup alihlt_homer
  */
-class AliHLTHOMERLibManager : public AliHLTLogging {
+class AliHLTHOMERLibManager {
  public:
   /** standard constructor */
   AliHLTHOMERLibManager();
@@ -94,7 +100,7 @@ class AliHLTHOMERLibManager : public AliHLTLogging {
    * Load HOMER library dynamically and create object working on the provided
    * buffer.
    */
-  AliHLTHOMERReader* OpenReader(const AliHLTUInt8_t* pBuffer, int size);
+  AliHLTHOMERReader* OpenReaderBuffer(const AliHLTUInt8_t* pBuffer, int size);
 
   /**
    * Delete a HOMER reader.
@@ -128,26 +134,37 @@ class AliHLTHOMERLibManager : public AliHLTLogging {
    */
   int LoadHOMERLibrary();
 
+  /**
+   * Unloads the HOMER library.
+   */
+  int UnloadHOMERLibrary();
+
   /** status of the loading of the HOMER library */
   int fLibraryStatus; //!transient
 
   /** entry in the HOMER library */
-  void* fFctCreateReaderFromTCPPort; //!transient
+  void (*fFctCreateReaderFromTCPPort)(); //!transient
 
   /** entry in the HOMER library */
-  void* fFctCreateReaderFromTCPPorts; //!transient
+  void (*fFctCreateReaderFromTCPPorts)(); //!transient
 
   /** entry in the HOMER library */
-  void* fFctCreateReaderFromBuffer; //!transient
+  void (*fFctCreateReaderFromBuffer)(); //!transient
 
   /** entry in the HOMER library */
-  void* fFctDeleteReader; //!transient
+  void (*fFctDeleteReader)(); //!transient
 
   /** entry in the HOMER library */
-  void* fFctCreateWriter; //!transient
+  void (*fFctCreateWriter)(); //!transient
 
   /** entry in the HOMER library */
-  void* fFctDeleteWriter; //!transient
+  void (*fFctDeleteWriter)(); //!transient
+
+  /** Indicates the library that was actually (and if) loaded in LoadHOMERLibrary(). */
+  const char* fLoadedLib;  //!transient
+
+  static const char* fgkLibraries[]; /// List of libraries to try and load.
+  static int fgkLibRefCount[]; /// The library reference count to control when to unload the library.
 
   ClassDef(AliHLTHOMERLibManager, 0)
 };