-// $Id:$
+// $Id$
/**************************************************************************
* This file is property of and copyright by the ALICE HLT Project *
* ALICE Experiment at CERN, All rights reserved. *
#include "Riostream.h"
#include "TString.h"
#include <cstring>
+#include <cerrno>
ClassImp(AliHLTDomainEntry)
fExclude(kFALSE),
fUseSpec(kFALSE),
fType(kAliHLTVoidDataType),
- fSpecification(0x0)
+ fSpecification(kAliHLTVoidDataSpec)
{
// Default constructor.
}
fExclude(kFALSE),
fUseSpec(kFALSE),
fType(type),
- fSpecification(0x0)
+ fSpecification(kAliHLTVoidDataSpec)
{
// Constructs a domain entry with a particular data type and any specification.
// See header file for more information.
fExclude(kFALSE),
fUseSpec(kFALSE),
fType(),
- fSpecification(0x0)
+ fSpecification(kAliHLTVoidDataSpec)
{
// Constructs a domain entry with a particular data type and any specification.
// See header file for more information.
fExclude(exclude),
fUseSpec(kFALSE),
fType(type),
- fSpecification(0x0)
+ fSpecification(kAliHLTVoidDataSpec)
{
// Constructs a domain entry with the given data type, any specification
// and the exclude flag set.
fExclude(exclude),
fUseSpec(kFALSE),
fType(),
- fSpecification(0x0)
+ fSpecification(kAliHLTVoidDataSpec)
{
// Constructs a domain entry with a particular data type, any specification
// and the exclude flag set.
if (*this != rhs) return false;
bool thisTypeIsAny = strncmp(&fType.fID[0], kAliHLTAnyDataTypeID, kAliHLTComponentDataTypefIDsize) == 0;
- bool thisOriginIsAny = strncmp(&fType.fOrigin[0], kAliHLTDataOriginAny, kAliHLTComponentDataTypefOriginSize) == 0;
- bool thisSpecIsAny = not fUseSpec;
bool rhsTypeIsAny = strncmp(&rhs.fType.fID[0], kAliHLTAnyDataTypeID, kAliHLTComponentDataTypefIDsize) == 0;
- bool rhsOriginIsAny = strncmp(&rhs.fType.fOrigin[0], kAliHLTDataOriginAny, kAliHLTComponentDataTypefOriginSize) == 0;
- bool rhsSpecIsAny = not rhs.fUseSpec;
if (thisTypeIsAny and not rhsTypeIsAny) return false;
+ bool thisOriginIsAny = strncmp(&fType.fOrigin[0], kAliHLTDataOriginAny, kAliHLTComponentDataTypefOriginSize) == 0;
+ bool rhsOriginIsAny = strncmp(&rhs.fType.fOrigin[0], kAliHLTDataOriginAny, kAliHLTComponentDataTypefOriginSize) == 0;
if (thisOriginIsAny and not rhsOriginIsAny) return false;
+ bool thisSpecIsAny = not fUseSpec;
+ bool rhsSpecIsAny = not rhs.fUseSpec;
if (thisSpecIsAny and not rhsSpecIsAny) return false;
return true;
}
return str;
}
+int AliHLTDomainEntry::AsBinary(AliHLTUInt32_t buffer[4]) const
+{
+ // convert the data type and specification to a 32 byte buffer
+ if (!buffer) return -EINVAL;
+
+ AliHLTUInt32_t* tgt=buffer;
+ unsigned ii=0;
+
+ // lower part of the data type id
+ *tgt=0;
+ for ( ii=0; ii<4; ii++ ) {
+ *tgt |= ((AliHLTUInt32_t)(fType.fID[8-1-ii])) << (ii*8);
+ }
+ tgt++;
+
+ // upper part of the data type id
+ *tgt=0;
+ for ( ii=0; ii<4; ii++ ) {
+ *tgt |= ((AliHLTUInt32_t)(fType.fID[8-5-ii])) << (ii*8);
+ }
+ tgt++;
+
+ // data type origin
+ *tgt=0;
+ for ( ii=0; ii<4; ii++ ) {
+ *tgt |= ((AliHLTUInt32_t)(fType.fOrigin[4-1-ii])) << (ii*8);
+ }
+ tgt++;
+
+ // specification
+ if (fUseSpec)
+ *tgt = fSpecification;
+ else
+ *tgt = kAliHLTVoidDataSpec;
+
+ return 0;
+}