server.h 685 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <command/command.h>
  3. #include <rpcdb.h>
  4. #include <string>
  5. #include <unordered_map>
  6. #include <vector>
  7. using std::string;
  8. using std::unordered_map;
  9. using std::vector;
  10. class server_ {
  11. private:
  12. static unordered_map<string, unsigned long>* active_users;
  13. static unordered_map<unsigned long, vector<sensor_data>*>* db;
  14. static unordered_map<command_type, command*>* commands;
  15. private:
  16. server_();
  17. private:
  18. static void init_resources();
  19. static void init_commands();
  20. public:
  21. static void init();
  22. static response execute(request* req);
  23. friend class command;
  24. friend class interpret_request;
  25. friend class create_response;
  26. };