ARC SDK
DataDelivery.h
1 #ifndef DATA_DELIVERY_H_
2 #define DATA_DELIVERY_H_
3 
4 #include <list>
5 
6 #include <arc/Logger.h>
7 #include <arc/Thread.h>
8 #include "DTR.h"
9 #include "DTRList.h"
10 #include "DTRStatus.h"
11 
12 namespace DataStaging {
13 
15 
26  class DataDelivery: public DTRCallback {
27 
28  private:
29 
31  Arc::SimpleCondition dtr_list_lock;
32 
34  class delivery_pair_t;
36  std::list<delivery_pair_t*> dtr_list;
37 
39  TransferParameters transfer_params;
40 
42  static Arc::Logger logger;
43 
45  ProcessState delivery_state;
46 
48  Arc::SimpleCondition run_signal;
49 
53 
55  static void start_delivery(void* arg);
56 
58  static void stop_delivery(void* arg);
59 
61  bool delete_delivery_pair(delivery_pair_t* dp);
62 
64  static void main_thread(void* arg);
66  void main_thread(void);
67 
69  DataDelivery(const DataDelivery&);
71  DataDelivery& operator=(const DataDelivery&);
72 
73  public:
74 
76  DataDelivery();
78  ~DataDelivery() { stop(); };
79 
81 
87  virtual void receiveDTR(DTR_ptr request);
88 
90  bool cancelDTR(DTR_ptr request);
91 
93  bool start();
94 
96  bool stop();
97 
99  void SetTransferParameters(const TransferParameters& params);
100 
101  };
102 
103 } // namespace DataStaging
104 #endif /*DATA_DELIVERY_H_*/
DataDelivery transfers data between specified physical locations.
Definition: DataDelivery.h:26
Simple triggered condition.
Definition: Thread.h:150
The base class from which all callback-enabled classes should be derived.
Definition: DTR.h:193
virtual void receiveDTR(DTR_ptr request)
Pass a DTR to Delivery.
A logger class.
Definition: Logger.h:493
Represents limits and properties of a DTR transfer. These generally apply to all DTRs.
Definition: DTR.h:91
~DataDelivery()
Destructor calls stop() and waits for cancelled processes to exit.
Definition: DataDelivery.h:78
DataStaging contains all components for data transfer scheduling and execution.
Definition: DataDelivery.h:12
void SetTransferParameters(const TransferParameters &params)
Set transfer limits.
bool stop()
Tell the delivery to stop all transfers and threads and exit.
DataDelivery()
Constructor.
bool start()
Start the Delivery thread, which runs until stop() is called.
bool cancelDTR(DTR_ptr request)
Stop the transfer corresponding to the given DTR.
ProcessState
Internal state of StagingProcesses.
Definition: DTR.h:79