From be5d48d2eaed3af76f03297e376f7a67e8a8238f Mon Sep 17 00:00:00 2001 From: TravisBot <> Date: Wed, 20 Dec 2017 18:02:11 +0000 Subject: Rebuilding documentation --- logsink_8h_source.html | 188 ++++++++++++++++++++++++------------------------- 1 file changed, 91 insertions(+), 97 deletions(-) (limited to 'logsink_8h_source.html') diff --git a/logsink_8h_source.html b/logsink_8h_source.html index 2999d89e..f258446b 100644 --- a/logsink_8h_source.html +++ b/logsink_8h_source.html @@ -30,7 +30,7 @@
YAGE -  v0.3.1 +  v0.1.3
Yet Another Game Engine
@@ -108,124 +108,118 @@ $(document).ready(function(){initNavTree('logsink_8h_source.html','');});
logsink.h
-Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
-
2  * logsink.h
-
3  *
-
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
-
5  * MIT License, see LICENSE file for more details.
-
6  * ----------------------------------------------------------------------------
-
7  */
-
8 
-
9 #ifndef YAGE_CORE_LOGSINK_H
-
10 #define YAGE_CORE_LOGSINK_H
-
11 
-
12 #include "logmessage.h"
-
13 
-
14 #include <memory>
-
15 #include <string>
+Go to the documentation of this file.
1 
+
9 
+
11 #ifndef YAGE_CORE_LOGSINK_H
+
12 #define YAGE_CORE_LOGSINK_H
+
13 
+
15 #include "logmessage.h"
16 
-
17 namespace yage
-
18 {
+
17 #include <memory>
+
18 #include <string>
19 
-
20 class LogSink
+
20 namespace yage
21 {
-
22 public:
-
23  template <typename T>
-
24  LogSink(T impl);
-
25 
-
26  LogSink(const LogSink &sink);
-
27  LogSink(LogSink &&sink);
+
22 
+
23 class LogSink
+
24 {
+
25 public:
+
26  template <typename T>
+
27  LogSink(T impl);
28 
-
29  LogSink &operator=(const LogSink &sink);
-
30  LogSink &operator=(LogSink &&sink);
-
31  bool operator==(const LogSink &sink);
-
32 
-
33  void write(const LogMessage::Meta &meta, const std::string &msg) const;
-
34 
-
35 private:
-
36  struct Concept {
-
37  virtual ~Concept() = default;
-
38 
-
39  virtual Concept *clone() const = 0;
-
40  virtual void write(const LogMessage::Meta &meta,
-
41  const std::string &msg) const = 0;
-
42  };
-
43 
-
44  template <typename T>
-
45  struct Model : Concept {
-
46  Model(T impl_i);
-
47  virtual Concept *clone() const override;
-
48  virtual void write(const LogMessage::Meta &meta,
-
49  const std::string &msg) const override;
-
50 
-
51  T impl;
-
52  };
+
29  LogSink(const LogSink &sink);
+
30  LogSink(LogSink &&sink);
+
31 
+
32  LogSink &operator=(const LogSink &sink);
+
33  LogSink &operator=(LogSink &&sink);
+
34  bool operator==(const LogSink &sink);
+
35 
+
36  void write(const LogMessage::Meta &meta, const std::string &msg) const;
+
37 
+
38 private:
+
39  struct Concept {
+
40  virtual ~Concept() = default;
+
41 
+
42  virtual Concept *clone() const = 0;
+
43  virtual void write(const LogMessage::Meta &meta,
+
44  const std::string &msg) const = 0;
+
45  };
+
46 
+
47  template <typename T>
+
48  struct Model : Concept {
+
49  Model(T impl_i);
+
50  virtual Concept *clone() const override;
+
51  virtual void write(const LogMessage::Meta &meta,
+
52  const std::string &msg) const override;
53 
-
54  std::unique_ptr<Concept> wrapper_;
-
55 };
+
54  T impl;
+
55  };
56 
- -
58 
-
59 LogSink makeFileSink(const std::string &filename);
-
60 LogSink makeFileSink(std::string &&filename);
+
57  std::unique_ptr<Concept> wrapper_;
+
58 };
+
59 
+
61 
-
62 /* -----------------------------------------------------------------------------
-
63  * Template Implementation
-
64  * -----------------------------------------------------------------------------
-
65  */
-
66 
-
67 template <typename T>
-
68 LogSink::LogSink(T impl) : wrapper_(new Model<T>(std::move(impl)))
-
69 {
-
70 }
-
71 
-
72 template <typename T>
-
73 LogSink::Model<T>::Model(T impl_i) : impl(impl_i)
-
74 {
-
75 }
-
76 
-
77 template <typename T>
- -
79 {
-
80  return new Model<T>(impl);
-
81 }
-
82 
-
83 template <typename T>
- -
85  const std::string &msg) const
-
86 {
-
87  impl(meta, msg);
-
88 }
-
89 
-
90 } // namespace yage
-
91 
-
92 #endif
-
std::unique_ptr< Concept > wrapper_
Definition: logsink.h:54
-
virtual Concept * clone() const override
Definition: logsink.h:78
-
T impl
Definition: logsink.h:51
-
virtual void write(const LogMessage::Meta &meta, const std::string &msg) const override
Definition: logsink.h:84
+
62 LogSink makeFileSink(const std::string &filename);
+
63 LogSink makeFileSink(std::string &&filename);
+
64 
+
65 /* -----------------------------------------------------------------------------
+
66  * Template Implementation
+
67  * -----------------------------------------------------------------------------
+
68  */
+
69 
+
70 template <typename T>
+
71 LogSink::LogSink(T impl) : wrapper_(new Model<T>(std::move(impl)))
+
72 {
+
73 }
+
74 
+
75 template <typename T>
+
76 LogSink::Model<T>::Model(T impl_i) : impl(impl_i)
+
77 {
+
78 }
+
79 
+
80 template <typename T>
+ +
82 {
+
83  return new Model<T>(impl);
+
84 }
+
85 
+
86 template <typename T>
+ +
88  const std::string &msg) const
+
89 {
+
90  impl(meta, msg);
+
91 }
+
92 
+
93 } // namespace yage
+
94 
+
95 #endif
+
std::unique_ptr< Concept > wrapper_
Definition: logsink.h:57
+
virtual Concept * clone() const override
Definition: logsink.h:81
+
T impl
Definition: logsink.h:54
+
virtual void write(const LogMessage::Meta &meta, const std::string &msg) const override
Definition: logsink.h:87
LogSink makeConsoleSink()
Definition: logsink.cpp:46
-
LogSink(T impl)
Definition: logsink.h:68
+
LogSink(T impl)
Definition: logsink.h:71
LogSink makeFileSink(const std::string &filename)
Definition: logsink.cpp:95
-
Model(T impl_i)
Definition: logsink.h:73
+
Model(T impl_i)
Definition: logsink.h:76
void write(const LogMessage::Meta &meta, const std::string &msg) const
Definition: logsink.cpp:41
virtual Concept * clone() const =0
-
Definition: logsink.h:36
+
Definition: logsink.h:39
virtual ~Concept()=default
LogSink & operator=(const LogSink &sink)
Definition: logsink.cpp:24
- +
virtual void write(const LogMessage::Meta &meta, const std::string &msg) const =0
Definition: logmessage.h:36
bool operator==(const LogSink &sink)
Definition: logsink.cpp:36
-
Definition: logsink.h:45
-
Definition: logsink.h:20
+
Definition: logsink.h:48
+
Definition: logsink.h:23