| 1 | #ifndef ALITRIGCONNECTOR_H |
| 2 | #define ALITRIGCONNECTOR_H |
| 3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
| 4 | * See cxx source for full Copyright notice */ |
| 5 | |
| 6 | /* $Id$ */ |
| 7 | // Author: Andrei Gheata, 28/07/2009 |
| 8 | |
| 9 | //============================================================================== |
| 10 | // AliTrigConnector - Class representing a connector between an output of a |
| 11 | // device (feeder) and an arbitrary number of inputs of other devices. |
| 12 | //============================================================================== |
| 13 | |
| 14 | #ifndef ROOT_TNamed |
| 15 | #include "TNamed.h" |
| 16 | #endif |
| 17 | |
| 18 | class TObjArray; |
| 19 | class AliTrigDevice; |
| 20 | class AliTrigEvent; |
| 21 | |
| 22 | class AliTrigConnector : public TNamed { |
| 23 | |
| 24 | public: |
| 25 | AliTrigConnector() : TNamed(), fFeeder(0), fOutput(0), fNclients(0), fArraySize(0), fInputs(0), fDevices(0) {} |
| 26 | AliTrigConnector(const char *name, AliTrigDevice *feeder, Int_t output) : TNamed(name, ""), fFeeder(feeder), fOutput(output), fNclients(0), fArraySize(0), fInputs(0), fDevices(0) {} |
| 27 | AliTrigConnector(const AliTrigConnector &other); |
| 28 | virtual ~AliTrigConnector(); |
| 29 | |
| 30 | AliTrigConnector &operator=(const AliTrigConnector &other); |
| 31 | |
| 32 | // Connect a client input. |
| 33 | void Connect(AliTrigDevice *client, Int_t input); |
| 34 | |
| 35 | virtual void Print(Option_t *option="") const; |
| 36 | |
| 37 | // Transmit the feeder signal to all connected inputs. Different device types |
| 38 | // call different Transmit() methods. |
| 39 | Bool_t Transmit(Bool_t value); |
| 40 | Bool_t Transmit(AliTrigEvent *event); |
| 41 | |
| 42 | private: |
| 43 | AliTrigDevice *fFeeder; // Feeder device |
| 44 | Int_t fOutput; // Output slot index for the feeder |
| 45 | Int_t fNclients; // Number of clients |
| 46 | Int_t fArraySize; // Size of the clients array |
| 47 | Int_t *fInputs; //[fArraySize] Array of input slot indices |
| 48 | TObjArray *fDevices; // Array of client devices |
| 49 | |
| 50 | ClassDef(AliTrigConnector,1) // Class representing a connector between devices. |
| 51 | }; |
| 52 | #endif |