test_db.h 822 B

123456789101112131415161718192021222324252627282930
  1. #ifndef TEST02_DB_H
  2. #define TEST02_DB_H
  3. #include "test_db_base.h"
  4. class world_object;
  5. class test_db : public test_db_base {
  6. const int MAX_WORLD_ID = 10000;
  7. const int MAX_RANDOM_VALUE = 10000;
  8. const int MAX_QUERY_COUNT = 500;
  9. public:
  10. test_db(cppcms::service &s);
  11. void servre_db();
  12. void servre_queries(const std::string a);
  13. void servre_updates(const std::string a);
  14. void servre_cached_worlds(const std::string a);
  15. private:
  16. bool update_world_object_db(const world_object &c);
  17. bool get_world_object_db(world_object &c, int id);
  18. bool get_world_object_db_ch(world_object &c, int id);
  19. int cinvert_constraint_count(const std::string & val);
  20. int get_random_id();
  21. int get_random_value();
  22. void send_json(const cppcms::json::value & json);
  23. };
  24. #endif /* TEST02_DB_H */