removing obsolete classes and macros
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 31 Jul 2008 09:14:28 +0000 (09:14 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 31 Jul 2008 09:14:28 +0000 (09:14 +0000)
SHUTTLE/DCSClient/macros/LinkDef.h [deleted file]
SHUTTLE/DCSClient/macros/Makefile [deleted file]
SHUTTLE/DCSClient/macros/TestAliSimpleValue.C [deleted file]
SHUTTLE/DCSClient/macros/TestServer.C [deleted file]
SHUTTLE/DCSClient/macros/TestServer.cxx [deleted file]
SHUTTLE/DCSClient/macros/TestServer.h [deleted file]

diff --git a/SHUTTLE/DCSClient/macros/LinkDef.h b/SHUTTLE/DCSClient/macros/LinkDef.h
deleted file mode 100644 (file)
index 17995ae..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifdef __CINT__
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-#pragma link off all globals;
-#pragma link off all classes;
-#pragma link off all functions;
-#pragma link C++ class TestServer;
-
-#endif
diff --git a/SHUTTLE/DCSClient/macros/Makefile b/SHUTTLE/DCSClient/macros/Makefile
deleted file mode 100644 (file)
index c3e4c51..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-
-include ../../../build/Makefile.$(ALICE_TARGET)
-
-
-CLASSES = TestServer.cxx 
-DICT = DictTest.cxx
-
-HEADERS := $(patsubst %.cxx,%.h,$(CLASSES))
-
-SRCS = $(CLASSES) $(DICT)
-
-OBJS := $(patsubst %.cxx,.obj/%.o,$(SRCS))
-DEPS := $(patsubst .obj/%.o,.dep/%.d,$(OBJS))
-
-INCDIR = -I$(shell root-config --incdir) -I../ -I../../../include 
-CXXFLAGS += $(INCDIR)
-LIBDIR = $(shell root-config --libdir)
-
-
-SHARED = -shared
-
-.PHONY: all clean distclean dep
-
-all: $(DEP) libTest.so
-
-$(DICT): $(HEADERS) LinkDef.h
-       rootcint -f $@ -c $(INCDIR) $(HEADERS) LinkDef.h 
-
-
-libTest.so: $(OBJS)
-       $(LD) $(SHARED) $(LDFLAGS) $^ -L$(LIBDIR) $(LIBS) -o $@
-
-
-dep: $(DICT) $(DEPS)
-
-clean:
-       rm -rf DictTest.h
-       rm -rf DictTest.cxx
-       rm -rf .dep
-       rm -rf .obj
-       rm -rf libTest.so
-
-distclean: clean 
-
-ifeq ($(filter %clean,$(MAKECMDGOALS)),)
-DEPS_MAGIC := $(shell mkdir .dep > /dev/null 2>&1 || :)
-endif
-ifeq ($(strip $(filter %clean,$(MAKECMDGOALS)) $(filter dep,$(MAKECMDGOALS))),)
-OBJS_MAGIC := $(shell mkdir .obj > /dev/null 2>&1 || :)
--include $(DEPS)
-endif
-
-.dep/%.d: %.cxx
-       set -e; $(CXX) -MM $(CXXFLAGS) $< | \
-       awk '/\.o/ {print ".dep/$(*F).d .obj/"$$0} ! /\.o/ {print $$0}' > .dep/$(*F).d
-
-.obj/%.o: %.cxx
-       $(CXX) $(CXXFLAGS) -c $< -o .obj/$(*F).o 
-
diff --git a/SHUTTLE/DCSClient/macros/TestAliSimpleValue.C b/SHUTTLE/DCSClient/macros/TestAliSimpleValue.C
deleted file mode 100644 (file)
index efe2dc8..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-void TestAliSimpleValue() {
-
-       gSystem->Load("libSHUTTLE");
-
-       // Bool
-       AliSimpleValue a(AliSimpleValue::kBool);
-       Assert(a.GetType() == AliSimpleValue::kBool);
-       a.SetBool(kTRUE);
-       Assert(a.GetBool() == kTRUE);   
-
-       // equal
-       AliSimpleValue b(kTRUE);
-       Assert(a == b);
-
-       // copy constructor
-       AliSimpleValue c(a);
-       Assert(b == c);
-
-       // set
-       a = AliSimpleValue(kFALSE);
-       Assert(a.GetBool() == kFALSE);
-
-       
-       // Byte
-        AliSimpleValue a(AliSimpleValue::kByte);
-        Assert(a.GetType() == AliSimpleValue::kByte);
-        a.SetByte(30);
-        Assert(a.GetByte() == 30);
-
-       // equal
-        AliSimpleValue b((Char_t) 30);
-       Assert(b.GetType() == AliSimpleValue::kByte);
-        Assert(a == b);
-
-        // copy constructor
-        AliSimpleValue c(a);
-        Assert(b == c);
-
-        // set
-        a = AliSimpleValue((Char_t) 60);
-        Assert(a.GetByte() == 60);
-
-       
-       // Int
-        AliSimpleValue a(AliSimpleValue::kInt);
-        Assert(a.GetType() == AliSimpleValue::kInt);
-        a.SetInt(30);
-        Assert(a.GetInt() == 30);
-
-        // equal
-        AliSimpleValue b(30);
-        Assert(b.GetType() == AliSimpleValue::kInt);
-        Assert(a == b);
-
-        // copy constructor
-        AliSimpleValue c(a);
-        Assert(b == c);
-
-        // set
-        a = AliSimpleValue(60);
-        Assert(a.GetInt() == 60);
-
-
-       // UInt
-        AliSimpleValue a(AliSimpleValue::kUInt);
-        Assert(a.GetType() == AliSimpleValue::kUInt);
-        a.SetUInt(30000);
-        Assert(a.GetUInt() == 30000);
-
-        // equal
-        AliSimpleValue b((UInt_t) 30000);
-        Assert(b.GetType() == AliSimpleValue::kUInt);
-        Assert(a == b);
-
-        // copy constructor
-        AliSimpleValue c(a);
-        Assert(b == c);
-
-        // set
-        a = AliSimpleValue((UInt_t) 60);
-        Assert(a.GetUInt() == 60);
-       
-
-       // Float
-        AliSimpleValue a(AliSimpleValue::kFloat);
-        Assert(a.GetType() == AliSimpleValue::kFloat);
-        a.SetFloat(100.53);
-       Float_t delta = 1e-38;
-       Assert((a.GetFloat() <= 100.53 + delta) || (a.GetFloat() >= 100.53 - delta));
-
-        // equal
-        AliSimpleValue b((Float_t) 100.53);
-       Assert(b.GetType() == AliSimpleValue::kFloat);
-        Assert(a == b);
-
-        // copy constructor
-        AliSimpleValue c(a);
-        Assert(b == c);
-
-        // set
-        a = AliSimpleValue((Float_t) 666.666);
-        Assert(a.GetFloat() <= 666.666 + delta || a.GetFloat() >= 666.666 - delta);
-
-
-       // DynBool
-       Bool_t buf[] = {kTRUE, kFALSE, kTRUE};  
-       AliSimpleValue a(3, buf);
-       Assert(a.GetType() == AliSimpleValue::kDynBool);
-       Assert(a.GetDynamicSize() == 3);
-       Assert(a.GetDynBool(0) == kTRUE);       
-       Assert(a.GetDynBool(1) == kFALSE);      
-       Assert(a.GetDynBool(2) == kTRUE);       
-
-       a.SetDynBool(1, kTRUE);
-       Assert(a.GetDynBool(1) == kTRUE);       
-       a.SetDynBool(1, kFALSE);
-
-       // equal
-       AliSimpleValue b(3, buf);
-       Assert(a == b);
-       
-       // copy constructor
-       AliSimpleValue c(b);
-       Assert(c == b);
-
-       // set
-       a.SetDynBool(1, kTRUE);
-       a = c;
-       Assert(a == b);
-
-
-       // DynByte
-        Char_t cbuf[] = {10, 50, 60};
-        AliSimpleValue a(3, cbuf);
-        Assert(a.GetType() == AliSimpleValue::kDynByte);
-        Assert(a.GetDynamicSize() == 3);
-        Assert(a.GetDynByte(0) == 10);
-        Assert(a.GetDynByte(1) == 50);
-        Assert(a.GetDynByte(2) == 60);
-
-        a.SetDynByte(1, 100);
-        Assert(a.GetDynByte(1) == 100);
-        a.SetDynByte(1, 50);
-
-        // equal
-        AliSimpleValue b(3, cbuf);
-        Assert(a == b);
-
-        // copy constructor
-        AliSimpleValue c(b);
-        Assert(c == b);
-
-        // set
-        a.SetDynByte(1, 200);
-        a = c;
-        Assert(a == b);
-
-
-       // DynInt
-        Int_t ibuf[] = {100, 500, -60};
-        AliSimpleValue a(3, ibuf);
-        Assert(a.GetType() == AliSimpleValue::kDynInt);
-        Assert(a.GetDynamicSize() == 3);
-        Assert(a.GetDynInt(0) == 100);
-        Assert(a.GetDynInt(1) == 500);
-        Assert(a.GetDynInt(2) == -60);
-
-        a.SetDynInt(1, 100);
-        Assert(a.GetDynInt(1) == 100);
-        a.SetDynInt(1, 500);
-
-        // equal
-        AliSimpleValue b(3, ibuf);
-        Assert(a == b);
-
-        // copy constructor
-        AliSimpleValue c(b);
-        Assert(c == b);
-
-        // set
-        a.SetDynInt(1, 200);
-        a = c;
-        Assert(a == b);
-
-        // DynUInt
-        UInt_t ubuf[] = {100, 504, 7060};
-        AliSimpleValue a(3, ubuf);
-        Assert(a.GetType() == AliSimpleValue::kDynUInt);
-        Assert(a.GetDynamicSize() == 3);
-        Assert(a.GetDynUInt(0) == 100);
-        Assert(a.GetDynUInt(1) == 504);
-        Assert(a.GetDynUInt(2) == 7060);
-
-        a.SetDynUInt(1, 100);
-        Assert(a.GetDynUInt(1) == 100);
-        a.SetDynUInt(1, 504);
-
-        // equal
-        AliSimpleValue b(3, ubuf);
-        Assert(a == b);
-
-        // copy constructor
-        AliSimpleValue c(b);
-        Assert(c == b);
-
-        // set
-        a.SetDynUInt(1, 200);
-        a = c;
-        Assert(a == b);
-
-
-       // DynFloat
-        Float_t fbuf[] = {100.1, 504.5, 7060};
-        AliSimpleValue a(3, fbuf);
-        Assert(a.GetType() == AliSimpleValue::kDynFloat);
-        Assert(a.GetDynamicSize() == 3);
-        Assert(a.GetDynFloat(0) <= 100.1 + delta || aGetDynFloat(0) >= 100.1 - delta);
-        Assert(a.GetDynFloat(1) <= 504.5 + delta || aGetDynFloat(1) >= 504.5 - delta);
-        Assert(a.GetDynFloat(2) <= 7060 + delta || aGetDynFloat(2) >= 7060 - delta);
-
-        a.SetDynFloat(1, -200.3);
-        Assert(a.GetDynFloat(1) <= -200.3 + delta || aGetDynFloat(1) >= -200.3 - delta);
-        a.SetDynFloat(1, 504.5);
-
-
-        // equal
-        AliSimpleValue b(3, fbuf);
-        Assert(a == b);
-
-        // copy constructor
-        AliSimpleValue c(b);
-        Assert(c == b);
-
-        // set
-        a.SetDynFloat(1, 200);
-        a = c;
-        Assert(a == b);
-
-       
-}
diff --git a/SHUTTLE/DCSClient/macros/TestServer.C b/SHUTTLE/DCSClient/macros/TestServer.C
deleted file mode 100644 (file)
index 907adaa..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-void TestServer(Int_t port) {
-
-       gSystem->Load("libSHUTTLE");
-       
-       gSystem->Load("libTest");
-
-       AliLog::EnableDebug(kTRUE);
-       AliLog::SetGlobalDebugLevel(1);
-
-       TestServer server(port);
-
-       server.Run(1000, 200);  
-}
diff --git a/SHUTTLE/DCSClient/macros/TestServer.cxx b/SHUTTLE/DCSClient/macros/TestServer.cxx
deleted file mode 100644 (file)
index ba2702d..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-#include "TestServer.h"
-
-#include "AliDCSMessage.h"
-#include "AliLog.h"
-
-#include <TTimeStamp.h>
-
-ClassImp(TestServer)
-
-const Int_t TestServer::kBadState;
-
-const Int_t TestServer::kTimeout;
-
-const Int_t TestServer::kBadMessage;
-
-const Int_t TestServer::kCommError;
-
-const Int_t TestServer::kServerError;
-
-TestServer::TestServer(Int_t port, Long_t timeout, Int_t retries):
-       fServerSocket(port), fTimeout(timeout), fRetries(retries)
-{
-
-}
-
-Int_t TestServer::SendBuffer(TSocket* socket, const char* buffer, Int_t size) {
-
-        Int_t sentSize = 0;
-        Int_t tries = 0;
-
-        while (sentSize < size && tries < fRetries) {
-
-                Int_t sResult = socket->Select(TSocket::kWrite, fTimeout);
-
-                if (sResult == 0) {
-                        AliDebug(1, Form("Timeout! tries <%d> ...", tries));
-                        tries ++;
-                        continue;
-
-                } else if (sResult < 0) {
-                        AliDebug(1, Form("Communication error <%d>!",
-                                        socket->GetErrorCode()));
-                        return TestServer::kCommError;
-                }
-
-                sResult = socket->SendRaw(buffer + sentSize, size - sentSize,
-                                        kDontBlock);
-
-                if (sResult > 0) {
-                        sentSize += sResult;
-                } else {
-                        AliDebug(1, Form("Communication error <%d>!",
-                                        socket->GetErrorCode()));
-                        return TestServer::kCommError;
-                } 
-        }
-
-        if (tries == fRetries) {
-                return TestServer::kTimeout;
-        }
-
-        return sentSize;
-}
-
-Int_t TestServer::ReceiveBuffer(TSocket* socket, char* buffer, Int_t size) {
-
-        Int_t readSize = 0;
-        Int_t tries = 0;
-
-        while (readSize < size && tries < fRetries) {
-
-                Int_t sResult = socket->Select(TSocket::kRead, fTimeout);
-
-                if (sResult == 0) {
-                        AliDebug(1, Form("Timeout! tries <%d> ...", tries));
-                        tries ++;
-                        continue;
-
-                } else if (sResult < 0) {
-                        AliDebug(1, Form("Communication error <%d>!",
-                                        socket->GetErrorCode()));
-                        return TestServer::kCommError;
-                }
-
-                sResult = socket->RecvRaw(buffer + readSize, size - readSize,
-                                         kDontBlock);
-
-                if (sResult > 0) {
-                        readSize += sResult;
-                } else {
-                        AliDebug(1, Form("Communication error <%d>!",
-                                        socket->GetErrorCode()));
-                        return TestServer::kCommError;
-                }
-        }
-
-        if (tries == fRetries) {
-                return TestServer::kTimeout;
-        }
-
-        return readSize;
-}
-
-Int_t TestServer::SendMessage(TSocket* socket, AliDCSMessage& message) {
-       
-       message.StoreToBuffer();
-       
-        return SendBuffer(socket, message.GetMessage(), 
-                               message.GetMessageSize());
-}
-
-Int_t TestServer::ReceiveMessage(TSocket* socket, AliDCSMessage& message) {
-
-       char header[HEADER_SIZE];
-
-        Int_t sResult;
-
-        if ((sResult = ReceiveBuffer(socket, header, HEADER_SIZE)) < 0) {
-                return sResult;
-        }
-
-        if (!message.SetRawHeader(header)) {
-                return TestServer::kBadMessage;
-        }
-
-        if ((sResult = ReceiveBuffer(socket, message.GetBody(),
-                        message.GetBodySize())) < 0) {
-
-                return sResult;
-        }
-
-       message.LoadFromBuffer();       
-
-        return HEADER_SIZE + sResult;
-}
-
-
-void TestServer::Run(Int_t count, Int_t rsSize) {
-
-        if (!fServerSocket.IsValid()) {
-                AliError("Invalid server socket!");
-                return;
-        }
-
-
-        TSocket* connSocket;
-       while (1) {
-               
-               AliInfo("Waiting for connection");
-
-               connSocket = fServerSocket.Accept();
-
-               AliInfo("Client accepted");
-
-               if (!connSocket) {
-                       AliError("Can't accept connection!");
-                       continue;
-               }
-
-               connSocket->SetOption(kNoBlock, 1);
-
-               if (!connSocket->IsValid()) {
-                       AliError("Invalid connection socket!");
-                       delete connSocket;
-                       continue;
-               }
-
-               Int_t result;
-
-               AliDCSMessage message;
-               if ((result = ReceiveMessage(connSocket, message)) < 0) {
-                       AliError(Form("Communication failure: ", result));
-                       delete connSocket;
-                       continue;
-               }
-               
-               //message.Print();
-
-               if (message.GetType() != AliDCSMessage::kRequest) {
-                       AliError("Bad message type!");
-                       delete connSocket;
-                       continue;
-               }
-
-               AliDCSMessage countMessage;
-               countMessage.CreateCountMessage(count);
-               if ((result = SendMessage(connSocket, countMessage)) < 0) {
-                       AliError(Form("Communication failure: %d", result));
-                       continue;
-               }
-
-                       
-               Int_t sentValues = 0;
-               
-               AliInfo(Form("Count: %d", count));
-
-               while (sentValues < count) {
-                       
-                       Int_t pSize = rsSize < count - sentValues ? 
-                                       rsSize : count - sentValues;
-
-
-                       TTimeStamp currentTime;
-                       AliDCSMessage rsMessage;
-                       rsMessage.CreateResultSetMessage(AliDCSValue::kInt);
-                               
-                       for (Int_t k = 0; k < pSize; k ++) {
-                               AliDCSValue aValue(k, currentTime.GetSec() + k);
-                               rsMessage.AddValue(aValue);
-                       }
-
-                       if ((result = SendMessage(connSocket, rsMessage)) < 0) {
-                               AliError(Form("Communication failure: %d", 
-                                               result));
-                               break;
-                       }
-
-                       sentValues += pSize;
-               }
-               
-               AliInfo(Form("Sent values: %d", sentValues));           
-               delete connSocket; 
-
-               //break;
-       }
-}
diff --git a/SHUTTLE/DCSClient/macros/TestServer.h b/SHUTTLE/DCSClient/macros/TestServer.h
deleted file mode 100644 (file)
index 4444fc8..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef TEST_SERVER_H
-#define TEST_SERVER_H
-
-#include <TServerSocket.h>
-
-class AliDCSMessage;
-
-class TestServer: public TObject {
-public:
-
-        static const Int_t kBadState = -1;
-
-        static const Int_t kTimeout = -2;
-
-        static const Int_t kBadMessage = -3;
-
-        static const Int_t kCommError = -4;
-
-        static const Int_t kServerError = -5;
-
-private:
-
-        TServerSocket fServerSocket;
-
-        Long_t fTimeout;
-
-        Int_t fRetries;
-
-
-        Int_t SendBuffer(TSocket* socket, const char* buffer, Int_t size);
-
-        Int_t ReceiveBuffer(TSocket* socket, char* buffer, Int_t size);
-
-        Int_t SendMessage(TSocket* socket, AliDCSMessage& message);
-
-        Int_t ReceiveMessage(TSocket* socket, AliDCSMessage& message);
-
-public:
-
-       TestServer(Int_t port, Long_t timeout = 5000, Int_t retries = 5);
-
-       void Run(Int_t count, Int_t rsSize);
-
-       ClassDef(TestServer, 0);
-};
-
-#endif