1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef RYAI_DEBUG_HISTORY_H
21 #define RYAI_DEBUG_HISTORY_H
26 typedef std::deque
<std::string
> THistoryContainer
;
28 explicit CDebugHistory()
32 virtual ~CDebugHistory() { }
33 void addHistory(std::string
const& txt
)
36 m_History
.push_back(txt
);
38 void addHistory(char const* txt
)
41 addHistory(NLMISC::toString(txt
));
45 void addHistory(char const* txt
, A a
) { if (m_Recording
) addHistory(NLMISC::toString(txt
, a
)); }
46 template <class A
, class B
>
47 void addHistory(char const* txt
, A a
, B b
) { if (m_Recording
) addHistory(NLMISC::toString(txt
, a
, b
)); }
48 template <class A
, class B
, class C
>
49 void addHistory(char const* txt
, A a
, B b
, C c
) { if (m_Recording
) addHistory(NLMISC::toString(txt
, a
, b
, c
)); }
50 template <class A
, class B
, class C
, class D
>
51 void addHistory(char const* txt
, A a
, B b
, C c
, D d
) { if (m_Recording
) addHistory(NLMISC::toString(txt
, a
, b
, c
, d
)); }
53 void setRecording(bool val
) { m_Recording
= val
; }
54 inline bool isRecording() { return m_Recording
; }
59 FOREACH(itHistory
, THistoryContainer
, m_History
)
61 nlinfo("HIST %3i: %s", j
, itHistory
->c_str());
68 THistoryContainer m_History
;