X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2FBASE%2FAliHLTMessage.h;h=cee6bcc278a16da284e8798caa1a6fc476b60310;hb=af69d36739a958c7895eae67f975561412be705f;hp=43e6d51726f2e03303d9b79bab2f771e0f8e9282;hpb=ba4b0dd7bbfd2e0e973e13eb8b9e251254d5284a;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/BASE/AliHLTMessage.h b/HLT/BASE/AliHLTMessage.h index 43e6d51726f..cee6bcc278a 100644 --- a/HLT/BASE/AliHLTMessage.h +++ b/HLT/BASE/AliHLTMessage.h @@ -61,8 +61,7 @@ * * A simple test macro for a file can look like *
- *  const char* filename="TPC_804.ddl";
- *  //const char* filename="TPC_768.ddl";
+ *  const char* filename="myobject.dat";
  *  TString param=filename;
  *  param+="?filetype=raw";
  *  TFile file(param);
@@ -84,6 +83,19 @@
  *
  * @see AliHLTRootFileWriterComponent for an easy way to save objects
  * exported via AliHLTMessage in a ROOT file.
+ *
+ * To serialize an object into a buffer, the normal ROOT TMessage mechanism
+ * can be used.
+ * 
+ *    AliHLTMessage msg(kMESS_OBJECT);
+ *    msg.WriteObject(pObject);
+ *    Int_t iMsgLength=msg.Length();
+ *    if (iMsgLength>0) {
+ *      msg.SetLength(); // sets the length to the first (reserved) word
+ *      char* pMsgBuffer msg.Buffer();
+ *      // do something with pMsgBuffer and iMsgLenghth
+ *    }
+ * 
*/ class AliHLTMessage : @@ -116,18 +128,25 @@ public: Int_t CompLength() const { return (Int_t)(fBufCompCur - fBufComp); } private: - UInt_t fWhat; //Message type - TClass *fClass; //If message is kMESS_OBJECT pointer to object's class - Int_t fCompress; //Compression level from 0 (not compressed) to 9 (max compression) - char *fBufComp; //Compressed buffer - char *fBufCompCur; //Current position in compressed buffer - char *fCompPos; //Position of fBufCur when message was compressed + UInt_t fWhat; //!Message type + TClass *fClass; //!If message is kMESS_OBJECT pointer to object's class + Int_t fCompress; //!Compression level from 0 (not compressed) to 9 (max compression) + char *fBufComp; //!Compressed buffer + char *fBufCompCur; //!Current position in compressed buffer + char *fCompPos; //!Position of fBufCur when message was compressed + char *fBufUncompressed; //!Uncompressed buffer // AliHLTMessage objects cannot be copied or assigned AliHLTMessage(const AliHLTMessage &); // not implemented void operator=(const AliHLTMessage &); // not implemented - ClassDef(AliHLTMessage,0) // Message buffer class + /** the minimum size of a serialized TObject */ + static const Int_t fgkMinimumSize; //!transient + + /** a default buffer describing an empty message */ + static UInt_t fgkDefaultBuffer[2]; //!transient + + ClassDef(AliHLTMessage,1) // Message buffer class }; #endif // ALIHLTMESSAGE_H