Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<string>
- using namespace std;
- class Inner {
- };
- Inner in(string name){
- return Inner();
- }
- Inner has(string key, string value){
- return Inner();
- }
- class Vertex;
- class Repeat {
- private:
- Vertex* vertex;
- public:
- Repeat(Vertex* vertex) : vertex(vertex) {}
- Vertex& until(Inner what){
- return * this->vertex;
- }
- };
- class Vertex {
- public:
- Vertex& has(string key, string value){
- return *this;
- }
- Repeat repeat(Inner what){
- return Repeat(this);
- }
- Vertex& path(){
- return *this;
- }
- Vertex& by(string name){
- return *this;
- }
- };
- class Gremlin {
- public:
- Vertex V(){
- return Vertex();
- }
- };
- void gremlin(Gremlin g){
- g.V().has("name","gremlin").
- repeat(in("manages")).
- until(has("title","ceo")).
- path().by("name");
- }
- int main(){
- Gremlin g = Gremlin();
- gremlin(g);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement