You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

protocol.h 567 B

8 years ago
123456789101112131415161718192021222324252627
  1. #ifndef PROTOCOL_H
  2. #define PROTOCOL_H
  3. #include <ostream>
  4. using namespace std;
  5. class Post;
  6. class SendProtocol
  7. {
  8. public:
  9. virtual int cmdId() = 0;
  10. virtual void write(ostream& os) = 0;
  11. };
  12. class RecvProtocol
  13. {
  14. public:
  15. /**
  16. * @brief read 解析收到的数据
  17. * @param post 当前好友请求,整个解析链中被不断读写完善,在解析链最后得到一个完整的Post
  18. * @return true 已完成解析,无需后续的解析链,false 继续解析
  19. */
  20. virtual bool read(shared_ptr<Post> post) = 0;
  21. };
  22. #endif // PROTOCOL_H

mac下的“飞秋”大多数只是飞鸽传书协议,而且未发现令人满意的开源项目,所以基于c++与qt实现了基础的飞秋协议。

Contributors (1)