Flex  0.17.9
server_app.h
Go to the documentation of this file.
1 
16 #ifndef GRAPHSCOPE_SERVER_APP_H_
17 #define GRAPHSCOPE_SERVER_APP_H_
18 
22 
23 namespace gs {
24 
25 class ServerApp : public WriteAppBase {
26  public:
27  ServerApp() {}
28  AppBase::AppType type() const override;
29  bool Query(GraphDBSession& graph, Decoder& input, Encoder& output) override;
30 
31  private:
32  struct vertex_range {
33  vertex_range(uint32_t f, uint32_t t) : from(f), to(t) {}
34 
35  bool contains(uint32_t v) const { return v >= from && v < to; }
36 
37  bool empty() const { return (from >= to); }
38 
39  uint32_t from;
40  uint32_t to;
41  };
42 };
43 
45  public:
48 
49  AppWrapper CreateApp(const GraphDB& graph) override;
50 };
51 
52 } // namespace gs
53 
54 #endif // GRAPHSCOPE_SERVER_APP_H_
AppType
Definition: app_base.h:37
Definition: app_base.h:115
Definition: app_base.h:78
Definition: app_utils.h:69
Definition: app_utils.h:25
Definition: graph_db_session.h:36
Definition: graph_db.h:77
Definition: server_app.h:44
~ServerAppFactory()
Definition: server_app.h:47
AppWrapper CreateApp(const GraphDB &graph) override
Definition: server_app.cc:310
ServerAppFactory()
Definition: server_app.h:46
Definition: server_app.h:25
bool Query(GraphDBSession &graph, Decoder &input, Encoder &output) override
Definition: server_app.cc:87
AppBase::AppType type() const override
Definition: server_app.cc:85
ServerApp()
Definition: server_app.h:27
Definition: app_base.h:67
Definition: adj_list.h:23
Definition: server_app.h:32
uint32_t from
Definition: server_app.h:39
uint32_t to
Definition: server_app.h:40
bool empty() const
Definition: server_app.h:37
vertex_range(uint32_t f, uint32_t t)
Definition: server_app.h:33
bool contains(uint32_t v) const
Definition: server_app.h:35