Leviathan  0.8.0.0
Leviathan game engine
Visitor.h
Go to the documentation of this file.
1 #pragma once
2 // ------------------------------------ //
3 #include "Include.h"
4 
5 namespace Leviathan{
6 
7  class Visitor;
8 
10  class Visitable{
11  public:
12 
13  DLLEXPORT virtual void Accept(Visitor &visitor) = 0;
14  };
15 
17  class Visitor{
18  public:
20 
22  DLLEXPORT virtual ~Visitor();
23 
24  DLLEXPORT virtual void Visit(Visitable* object);
25 
26 
27  };
28 
30  class EmptyVisitor : public Visitor{
31  public:
32 
33 
34  DLLEXPORT void Visit(Visitable* object) override;
35  };
36 }
virtual DLLEXPORT void Accept(Visitor &visitor)=0
DLLEXPORT Visitor()
Definition: Visitor.cpp:8
virtual DLLEXPORT ~Visitor()
Default virtual destructor.
Definition: Visitor.cpp:12
Base class for all classes that accept visitors.
Definition: Visitor.h:10
Base for all different visitors.
Definition: Visitor.h:17
virtual DLLEXPORT void Visit(Visitable *object)
Definition: Visitor.cpp:16
DLLEXPORT void Visit(Visitable *object) override
Definition: Visitor.cpp:21
Example visitor that does nothing, but doesn't crash either.
Definition: Visitor.h:30
#define DLLEXPORT
Definition: Include.h:84
The access mask controls which registered functions and classes a script sees.
Definition: GameModule.h:12