SeaBreeze
Transfer.h
Go to the documentation of this file.
1 /***************************************************/
50 #ifndef SEABREEZE_TRANSFER_H
51 #define SEABREEZE_TRANSFER_H
52 
53 #include <vector>
56 #include "common/Data.h"
57 
58 typedef unsigned int direction_t;
59 
60 namespace seabreeze {
61 
62  class Transfer : public Exchange {
63  public:
64 
65  /* Note that the size of the provided buffer and the specified length
66  * of the transfer itself do not need to agree. If the transfer requires
67  * more space than the buffer provides, the buffer will be resized.
68  * If the buffer is created larger than is needed, only the given length
69  * will be sent or received. This allows for some freedom in buffer
70  * management.
71  */
72  Transfer(std::vector<ProtocolHint *> *hints, std::vector<byte> *buffer,
73  direction_t direction, unsigned int length);
74 
75  virtual ~Transfer();
76  virtual Data *transfer(TransferHelper *helper) throw (ProtocolException);
77 
78  static const direction_t TO_DEVICE;
79  static const direction_t FROM_DEVICE;
80 
81  protected:
82  Transfer();
83  void checkBufferSize();
84 
85  unsigned int length;
86  std::vector<byte> *buffer;
87  direction_t direction;
88  };
89 
90 }
91 
92 #endif /* SEABREEZE_TRANSFER_H */
93 
Definition: Transfer.h:62
Definition: Data.h:46
Definition: TransferHelper.h:46
Definition: ProtocolException.h:44
Encapsulates all SeaBreeze classes.
Definition: DeviceFactory.h:42
Definition: Exchange.h:44