various fixes in the HLTOUT treatment
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTHOMERLibManager.h
CommitLineData
6580df1c 1//-*- Mode: C++ -*-
2// @(#) $Id$
3
4#ifndef ALIHLTHOMERLIBMANAGER_H
5#define ALIHLTHOMERLIBMANAGER_H
6/* This file is property of and copyright by the ALICE HLT Project *
7 * ALICE Experiment at CERN, All rights reserved. *
8 * See cxx source for full Copyright notice */
9
10/** @file AliHLTHOMERLibManager.h
11 @author Matthias Richter
12 @date
13 @brief dynamic HLT HOMER reader/writer generation and destruction
14
15// see below for class documentation
16// or
17// refer to README to build package
18// or
19// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
20 */
cef34fbe 21#include "AliHLTDataTypes.h"
22#include "TObject.h" // for ClassDef/Imp
6580df1c 23
24class AliHLTHOMERReader;
25class AliHLTHOMERWriter;
26
27/**
28 * @class AliHLTHOMERLibManager
a183f221 29 * Dynamic manager of HOMER library.
30 * The class allows to generate objects of HOMER readers and writers
31 * dynamically and loads also the HOMER lib. In order to write HOMER library
32 * independent code it is important to use the AliHLTMonitoringWriter/
33 * AliHLTMonitoringReader classes when ever class methods are used. Those
34 * classes just define a virtual interface. <br>
35 *
36 * Instead of creating a reader or writer by \em new and deleting it with
37 * \em delete, one has to use the Open and Delete methods of this class.
38 *
39 * <pre>
40 * AliHLTHOMERLibManager manager;
41 *
42 * // open a HOMER reader listening at port 23000 of the localhost
43 * AliHLTMonitoringReader* pReader=manager.OpenReader(localhost, 23000);
44 *
45 * // read next event, timeout 5s
80442f92 46 * while (pReader && pReader->ReadNextEvent(5000000)==0) {
a183f221 47 * unsigned long count=pReader->GetBlockCnt();
80442f92 48 * gSystem->Sleep(5);
a183f221 49 * ...
50 * }
51 *
52 * // delete reader
53 * manager.DeleteReader(pReader);
54 * </pre>
55 *
56 * The manager does not not provide methods to create a HOMER reader on
57 * basis of shared memory. This is most likely a depricated functionality,
58 * although kept for the sake of completeness.
6580df1c 59 */
cef34fbe 60class AliHLTHOMERLibManager {
6580df1c 61 public:
62 /** standard constructor */
63 AliHLTHOMERLibManager();
64 /** destructor */
65 virtual ~AliHLTHOMERLibManager();
66
67 /**
a183f221 68 * Open a homer reader working on a TCP port.
69 */
70 AliHLTHOMERReader* OpenReader(const char* hostname, unsigned short port );
71
72 /**
73 * Open a homer reader working on multiple TCP ports.
74 */
75 AliHLTHOMERReader* OpenReader(unsigned int tcpCnt, const char** hostnames, unsigned short* ports);
76
77 /**
78 * Open a HOMER reader for reading from a System V shared memory segment.
79 AliHLTHOMERReader* OpenReader(key_t shmKey, int shmSize );
80 */
81
82 /**
83 * Open a HOMER reader for reading from multiple System V shared memory segments
84 AliHLTHOMERReader* OpenReader(unsigned int shmCnt, key_t* shmKey, int* shmSize );
85 */
86
87 /**
88 * Open a HOMER reader for reading from multiple TCP ports and multiple System V shared memory segments
89 AliHLTHOMERReader* OpenReader(unsigned int tcpCnt, const char** hostnames, unsigned short* ports,
90 unsigned int shmCnt, key_t* shmKey, int* shmSize );
91 */
92
93 /**
6580df1c 94 * Open a HOMER reader.
95 * Load HOMER library dynamically and create object working on the provided
96 * buffer.
97 */
18b56222 98 AliHLTHOMERReader* OpenReaderBuffer(const AliHLTUInt8_t* pBuffer, int size);
6580df1c 99
100 /**
101 * Delete a HOMER reader.
102 * Clean-up of the object is done inside the HOMER library.
103 */
104 int DeleteReader(AliHLTHOMERReader* pReader);
105
106 /**
107 * Open a HOMER writer.
108 * Load HOMER library dynamically and create object working on the provided
109 * buffer.
110 */
111 AliHLTHOMERWriter* OpenWriter();
112
113 /**
114 * Delete a HOMER writer.
115 * Clean-up of the object is done inside the HOMER library.
116 */
117 int DeleteWriter(AliHLTHOMERWriter* pWriter);
118
119 protected:
120
121 private:
122 /** copy constructor prohibited */
123 AliHLTHOMERLibManager(const AliHLTHOMERLibManager&);
124 /** assignment operator prohibited */
125 AliHLTHOMERLibManager& operator=(const AliHLTHOMERLibManager&);
126
127 /**
128 * Load the HOMER library.
129 */
130 int LoadHOMERLibrary();
131
132 /** status of the loading of the HOMER library */
133 int fLibraryStatus; //!transient
134
135 /** entry in the HOMER library */
a183f221 136 void* fFctCreateReaderFromTCPPort; //!transient
137
138 /** entry in the HOMER library */
139 void* fFctCreateReaderFromTCPPorts; //!transient
140
141 /** entry in the HOMER library */
6580df1c 142 void* fFctCreateReaderFromBuffer; //!transient
143
144 /** entry in the HOMER library */
145 void* fFctDeleteReader; //!transient
146
147 /** entry in the HOMER library */
148 void* fFctCreateWriter; //!transient
149
150 /** entry in the HOMER library */
151 void* fFctDeleteWriter; //!transient
152
153 ClassDef(AliHLTHOMERLibManager, 0)
154};
155#endif