]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTMessage.h
correct compilation warnings
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTMessage.h
index 43e6d51726f2e03303d9b79bab2f771e0f8e9282..cee6bcc278a16da284e8798caa1a6fc476b60310 100644 (file)
@@ -61,8 +61,7 @@
  *
  * A simple test macro for a file can look like
  * <pre>
- *  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);
  *
  * @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.
+ * <pre>
+ *    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
+ *    }
+ * </pre>
  */
 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