Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include<string>
  2.  
  3. using namespace std;
  4.  
  5. class Inner {
  6. };
  7.  
  8. Inner in(string name){
  9. return Inner();
  10. }
  11.  
  12. Inner has(string key, string value){
  13. return Inner();
  14. }
  15.  
  16. class Vertex;
  17.  
  18. class Repeat {
  19. private:
  20. Vertex* vertex;
  21.  
  22. public:
  23. Repeat(Vertex* vertex) : vertex(vertex) {}
  24.  
  25. Vertex& until(Inner what){
  26. return * this->vertex;
  27. }
  28. };
  29.  
  30. class Vertex {
  31. public:
  32. Vertex& has(string key, string value){
  33. return *this;
  34. }
  35.  
  36. Repeat repeat(Inner what){
  37. return Repeat(this);
  38. }
  39.  
  40. Vertex& path(){
  41. return *this;
  42. }
  43.  
  44. Vertex& by(string name){
  45. return *this;
  46. }
  47. };
  48.  
  49. class Gremlin {
  50. public:
  51. Vertex V(){
  52. return Vertex();
  53. }
  54. };
  55.  
  56. void gremlin(Gremlin g){
  57. g.V().has("name","gremlin").
  58. repeat(in("manages")).
  59. until(has("title","ceo")).
  60. path().by("name");
  61. }
  62.  
  63.  
  64. int main(){
  65. Gremlin g = Gremlin();
  66. gremlin(g);
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement