//
// This class is a wrapper of AliDCSMessage.
// These are the messages which form AliDCSProtocol.
+// Used by AliDCSClient to communicate with the DCS Amanda server
//
-
-#include "AliDCSValue.h"
-
#include <TString.h>
-#include <TList.h>
+#include <TObjArray.h>
+#include "AliDCSValue.h"
#define HEADER_SIZE 8
#define ID_OFFSET 0
#define ERROR_CODE_OFFSET HEADER_SIZE
#define ERROR_STRING_OFFSET (HEADER_SIZE + 1)
-
-
class AliDCSMessage: public TObject {
public:
enum Type {
AliDCSMessage(const char* buffer, UInt_t size);
- ~AliDCSMessage();
+ virtual ~AliDCSMessage();
void CreateRequestMessage(RequestType type,
void CreateCountMessage(UInt_t count);
- void CreateResultSetMessage(AliSimpleValue::Type type);
+ void CreateResultSetMessage(AliDCSValue::Type type);
void CreateErrorMessage(ErrorCode code, const char* errorString);
TString GetRequestString() const;
// MultiRequestType Message getters and setters
- void GetRequestStrings(TList& result) const;
+ void GetRequestStrings(TObjArray& result) const;
Bool_t AddRequestString(const char* request);
UInt_t GetCount() const;
// ResultSetType Message getters ans setters
- AliSimpleValue::Type GetSimpleValueType() const;
+ AliDCSValue::Type GetValueType() const;
UInt_t GetValueCount() const;
- UInt_t GetValues(TList& result) const;
+ UInt_t GetValues(TObjArray& result) const;
Bool_t AddValue(const AliDCSValue& value);
private:
- char* fMessage;
+ AliDCSMessage(const AliDCSMessage& other);
+ AliDCSMessage& operator= (const AliDCSMessage& other);
+
+
+ char* fMessage; // Array of bytes building the message
- UInt_t fMessageSize;
+ UInt_t fMessageSize; // Size of the message array
- Type fType;
+ Type fType; // Message type (request, count...)
//Request message fields
- RequestType fRequestType;
+ RequestType fRequestType; // Type of request message
- UInt_t fStartTime;
+ UInt_t fStartTime; // Start time of query
- UInt_t fEndTime;
+ UInt_t fEndTime; // End time of query
- TString fRequestString;
+ TString fRequestString; // Request string
//Count message fields
- UInt_t fCount;
+ UInt_t fCount; // count counter
//ResultSet message fields
- AliSimpleValue::Type fSimpleValueType;
+ AliDCSValue::Type fValueType; // Simple value type
- TList fValues;
+ // TODO this has to be a pointer
+ TObjArray fValues; // array of received values
//Error message fields
- ErrorCode fErrorCode;
+ ErrorCode fErrorCode; // error code
- TString fErrorString;
+ TString fErrorString; // error string
//MultiRequest message fields
- TList fRequestStrings;
+ TObjArray fRequestStrings; // multi request string array
// Message setter helpers