* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id$ */
+// $Id$
/**
* @file AliHLTMUONDataBlockReader.h
* @author Artur Szostak <artursz@iafrica.com>
- * @date
+ * @date 19 May 2007
* @brief Definition of a reader class for internal dimuon HLT raw data blocks.
*/
#include "AliHLTMUONTriggerRecordsBlockStruct.h"
#include "AliHLTMUONTrigRecsDebugBlockStruct.h"
-#include "AliHLTMUONTriggerChannelsBlockStruct.h"
#include "AliHLTMUONRecHitsBlockStruct.h"
#include "AliHLTMUONClustersBlockStruct.h"
#include "AliHLTMUONChannelsBlockStruct.h"
#include "AliHLTMUONMansoTracksBlockStruct.h"
#include "AliHLTMUONMansoCandidatesBlockStruct.h"
+#include "AliHLTMUONTracksBlockStruct.h"
#include "AliHLTMUONSinglesDecisionBlockStruct.h"
#include "AliHLTMUONPairsDecisionBlockStruct.h"
* stored in memory and the size of the data block is given by the variable 'size'.
* The data block is of type 'block_type' and the data block entries are of type
* 'entries_type'. The data block can be accessed in the following way:
- *
+ * \code
* void* buffer = somebuffer;
* AliHLTUInt32_t size = somebuffer_size;
*
* const entries_type& entry = block[i];
* // Do something with the entry...
* }
+ * \endcode
*/
template <class DataBlockType, class DataElementType>
class AliHLTMUONDataBlockReader
{
assert( buffer != NULL );
}
+
+ /**
+ * Copy constructor that performs a shallow copy.
+ * Since this class does not take direct ownership of the buffer, never
+ * allocates or deallocates memory, this can be allowed.
+ */
+ AliHLTMUONDataBlockReader(const AliHLTMUONDataBlockReader& reader)
+ {
+ fSize = reader.fSize;
+ fBlock = reader.fBlock;
+ fData = reader.fData;
+ }
+
+ /**
+ * Assignment operator performs a shallow copy.
+ * This is OK because this class does not take direct ownership of the
+ * output memory buffer.
+ */
+ AliHLTMUONDataBlockReader& operator = (const AliHLTMUONDataBlockReader& reader)
+ {
+ fSize = reader.fSize;
+ fBlock = reader.fBlock;
+ fData = reader.fData;
+ return *this;
+ }
/**
* Checks that the size of the buffer storing the data block is correct.
*/
AliHLTUInt32_t BytesUsed() const
{
- assert( sizeof(DataElementType) == fBlock->fHeader.fRecordWidth);
+ assert( sizeof(DataElementType) == fBlock->fHeader.fRecordWidth);
return sizeof(DataBlockType) + Nentries() * sizeof(DataElementType);
}
- AliHLTUInt32_t BufferSize() { return fSize; }
+ AliHLTUInt32_t BufferSize() const { return fSize; }
private:
AliHLTMUONTrigRecInfoStruct
> AliHLTMUONTrigRecsDebugBlockReader;
-typedef AliHLTMUONDataBlockReader<
- AliHLTMUONTriggerChannelsBlockStruct,
- AliHLTMUONTriggerChannelStruct
- > AliHLTMUONTriggerChannelsBlockReader;
-
typedef AliHLTMUONDataBlockReader<
AliHLTMUONRecHitsBlockStruct,
AliHLTMUONRecHitStruct
AliHLTMUONMansoCandidateStruct
> AliHLTMUONMansoCandidatesBlockReader;
+typedef AliHLTMUONDataBlockReader<
+ AliHLTMUONTracksBlockStruct,
+ AliHLTMUONTrackStruct
+ > AliHLTMUONTracksBlockReader;
+
typedef AliHLTMUONDataBlockReader<
AliHLTMUONSinglesDecisionBlockStruct,
AliHLTMUONTrackDecisionStruct