Grail (C++)  1.1.1
A multi-platform, modular, universal engine for embedding advanced AI in games.
Sink.hh
1 #ifndef GRAIL_SINK_H
2 #define GRAIL_SINK_H
3 
4 #include <memory>
5 #include <mutex>
6 
7 namespace grail
8 {
12  class Sink
13  {
14  public:
15  Sink(bool isSynchronized = false);
16 
17  Sink(const Sink& other) = delete;
18  Sink(Sink&& other) = delete;
19 
20  virtual ~Sink() = default;
21 
22  Sink& operator =(const Sink& other) = delete;
23  Sink& operator =(Sink&& other) = delete;
24 
25  void Sync(const std::string& message);
26 
27  protected:
32  virtual void Log(const std::string& message) = 0;
33 
34  private:
35  const bool isSynchronized{false};
36  std::mutex mutex{};
37  };
38 }
39 #endif // GRAIL_SINK_H
grail::Sink::Log
virtual void Log(const std::string &message)=0
Log - override this method to define how the messege should be logged.
grail::Sink
The Sink class - destination of logger messages.
Definition: Sink.hh:12