OpenDaVINCI  4.16.0
discoverer/Client.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_DMCP_DISCOVER_CLIENT_H_
21 #define OPENDAVINCI_DMCP_DISCOVER_CLIENT_H_
22 
23 #include <memory>
24 #include <string>
25 
31 #include "opendavinci/generated/odcore/data/dmcp/ServerInformation.h"
32 #include "opendavinci/generated/odcore/data/Packet.h"
33 
34 namespace odcore {
35  namespace dmcp {
36  namespace discoverer {
37 
38  using namespace std;
39 
41  private:
47  Client(const Client &);
48 
54  Client& operator=(const Client &);
55 
56  public:
57  Client(const std::string& group,
58  const uint32_t &serverPort,
59  const uint32_t &clientPort,
60  const string &name);
61  virtual ~Client();
62 
63  bool existsServer();
64 
65  odcore::data::dmcp::ServerInformation getServerInformation() const;
66 
67  virtual void onResponse();
68 
69  protected:
70  void sendDiscoverMessage();
71  void waitForResponse();
72  virtual void nextPacket(const odcore::data::Packet &p);
73 
74  std::shared_ptr<odcore::io::udp::UDPSender> m_sender;
75  std::shared_ptr<odcore::io::udp::UDPReceiver> m_receiver;
76 
78  bool m_response;
79 
80  odcore::data::dmcp::ServerInformation m_serverInformation;
81  string m_moduleName;
82  };
83  }
84  }
85 }
86 #endif //OPENDAVINCI_DMCP_DISCOVER_CLIENT_H_
Definition: base/Condition.h:64
Definition: discoverer/Client.h:40
std::shared_ptr< odcore::io::udp::UDPSender > m_sender
Definition: discoverer/Client.h:74
Definition: PacketListener.h:33
bool m_response
Definition: discoverer/Client.h:78
string m_moduleName
Definition: discoverer/Client.h:81
#define OPENDAVINCI_API
Definition: opendavinci.h:67
std::shared_ptr< odcore::io::udp::UDPReceiver > m_receiver
Definition: discoverer/Client.h:75
odcore::data::dmcp::ServerInformation m_serverInformation
Definition: discoverer/Client.h:80
odcore::base::Condition m_responseCondition
Definition: discoverer/Client.h:77