SeaBreeze
TCPIPv4SocketBus.h
Go to the documentation of this file.
1 /***************************************************/
30 #ifndef SEABREEZE_TCPIPV4SOCKETBUS_H
31 #define SEABREEZE_TCPIPV4SOCKETBUS_H
32 
33 #include "common/buses/Bus.h"
35 #include "native/network/Socket.h"
36 #include <vector>
37 
38 namespace seabreeze {
39  class TCPIPv4SocketBus : public Bus {
40  public:
42  virtual ~TCPIPv4SocketBus();
43 
44  virtual Socket *getSocketDescriptor();
45 
46  virtual BusFamily getBusFamily() const;
47 
48  virtual void setLocation(const DeviceLocatorInterface &location)
50  virtual DeviceLocatorInterface *getLocation();
51  virtual TransferHelper *getHelper(
52  const std::vector<ProtocolHint *> &hints) const;
53 
54  /* Pure virtual methods */
55  virtual bool open() = 0;
56  virtual void close() = 0;
57 
58 
59  protected:
60  void addHelper(ProtocolHint *hint, TransferHelper *helper);
61  void clearHelpers();
62 
63  Socket *socket;
64  DeviceLocatorInterface *deviceLocator;
65 
66  /* These vectors should really be in a map, but that didn't want to
67  * work easily. Since there will likely be about 2 entries in here,
68  * storing in a pair of vectors for now won't hurt anything.
69  */
70  std::vector<ProtocolHint *> helperKeys;
71  std::vector<TransferHelper *> helperValues;
72  };
73 }
74 
75 #endif /* SEABREEZE_TCPIPV4SOCKETBUS_H */
Definition: DeviceLocatorInterface.h:47
Definition: TCPIPv4SocketBus.h:39
Definition: Socket.h:44
Definition: BusFamily.h:38
Definition: TransferHelper.h:46
Definition: ProtocolHint.h:44
Definition: Bus.h:48
Encapsulates all SeaBreeze classes.
Definition: DeviceFactory.h:42
Definition: IllegalArgumentException.h:43