Added loggers to most classes

This commit is contained in:
Olivier Teulière 2012-02-18 22:26:52 +01:00
parent 684880acbe
commit bf42c49850
93 changed files with 272 additions and 9 deletions

View file

@ -39,6 +39,10 @@
using namespace std;
INIT_LOGGER(dic, Automaton);
#ifdef DEBUG_AUTOMATON
# define DMSG(a) (a)
#else

View file

@ -21,11 +21,14 @@
#ifndef DIC_AUTOMATON_H_
#define DIC_AUTOMATON_H_
#include "logging.h"
class AutomatonHelper;
struct searchRegExpLists;
class Automaton
{
DEFINE_LOGGER();
public:
/// Constructor
/**

View file

@ -66,6 +66,7 @@
INIT_LOGGER(dic, CompDic);
CompDic::CompDic()
: m_currentRec(0), m_maxRec(0), m_loadTime(0), m_buildTime(0)
{

View file

@ -26,9 +26,9 @@
#include <iosfwd>
#include <boost/unordered_map.hpp>
#include "logging.h"
#include "header.h"
#include "dic_internals.h"
#include "logging.h"
class DicEdge;
class DictHeaderInfo;

View file

@ -48,6 +48,9 @@
#include "tile.h"
INIT_LOGGER(dic, Dictionary);
const Dictionary *Dictionary::m_dic = NULL;

View file

@ -28,6 +28,7 @@
#include <map>
#include "tile.h"
#include "logging.h"
using namespace std;
@ -59,6 +60,7 @@ typedef wstring wistring;
class Dictionary
{
DEFINE_LOGGER();
public:
/**
* Dictionary creation and loading from a file

View file

@ -56,6 +56,9 @@ using boost::format;
using boost::wformat;
INIT_LOGGER(dic, Header);
#if defined(WORDS_BIGENDIAN)
// Nothing to do on big-endian machines
# define ntohll(x) (x)

View file

@ -27,6 +27,8 @@
#include <time.h>
#include <stdint.h>
#include "logging.h"
using namespace std;
// XXX: duplicated typedef (also present in dic.h)
@ -76,6 +78,7 @@ struct DictHeaderInfo
*/
class Header
{
DEFINE_LOGGER();
public:
/// Dictionary type

View file

@ -35,6 +35,10 @@
using namespace std;
INIT_LOGGER(dic, ListDic);
static void printDicRec(ostream &out, const Dictionary &iDic, const wchar_t * const buf, wchar_t *s, DicEdge edge)
{
if (edge.term) /* edge points at a complete word */

View file

@ -23,6 +23,8 @@
#include <iosfwd>
#include "logging.h"
class Dictionary;
@ -31,7 +33,7 @@ using namespace std;
class ListDic
{
DEFINE_LOGGER();
public:
ListDic();

View file

@ -36,6 +36,9 @@
using namespace std;
INIT_LOGGER(dic, StackTrace);
string StackTrace::GetStack()
{
#if defined HAVE_EXECINFO_H && defined(DEBUG)

View file

@ -23,11 +23,14 @@
#include <string>
#include "logging.h"
using std::string;
class StackTrace
{
DEFINE_LOGGER();
public:
static string GetStack();

View file

@ -29,6 +29,9 @@
#include "dic_exception.h"
INIT_LOGGER(dic, Tile);
const Header * Tile::m_header = NULL;
Tile Tile::m_TheJoker;

View file

@ -26,6 +26,8 @@
#include <vector>
#include <string>
#include "logging.h"
using namespace std;
class Header;
@ -37,6 +39,7 @@ class Header;
*/
class Tile
{
DEFINE_LOGGER();
friend class Dictionary;
public:

View file

@ -28,6 +28,9 @@
#include "ai_percent.h"
INIT_LOGGER(game, AIPercent);
AIPercent::AIPercent(float iPercent)
{
if (iPercent < 0)

View file

@ -23,6 +23,7 @@
#include "ai_player.h"
#include "results.h"
#include "logging.h"
/**
* This kind of AI is parameterized by a percentage p.
@ -37,6 +38,7 @@
*/
class AIPercent: public AIPlayer
{
DEFINE_LOGGER();
public:
/// Constructor, taking the percentage (0.0 <= iPercent <= 1.0)
AIPercent(float iPercent);

View file

@ -31,6 +31,9 @@
#include "encoding.h"
INIT_LOGGER(game, Bag);
Bag::Bag(const Dictionary &iDic)
: m_dic(iDic), m_ntiles(0)
{

View file

@ -24,6 +24,7 @@
#include <map>
#include "tile.h"
#include "logging.h"
using std::map;
@ -35,6 +36,7 @@ class Dictionary;
*/
class Bag
{
DEFINE_LOGGER();
public:
explicit Bag(const Dictionary &iDic);

View file

@ -42,6 +42,9 @@
#define W3 3
INIT_LOGGER(game, Board);
const int Board::m_tileMultipliers[BOARD_REALDIM][BOARD_REALDIM] =
{
{ oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo },

View file

@ -27,6 +27,7 @@
#include "matrix.h"
#include "tile.h"
#include "cross.h"
#include "logging.h"
class GameParams;
class Dictionary;
@ -50,6 +51,7 @@ using namespace std;
*/
class Board
{
DEFINE_LOGGER();
public:
Board(const GameParams &iParams);

View file

@ -22,6 +22,9 @@
#include "debug.h"
INIT_LOGGER(game, Command);
Command::Command()
: m_executed(false), m_autoExecution(true)
{

View file

@ -23,6 +23,8 @@
#include <string>
#include "logging.h"
using std::wstring;
@ -32,6 +34,8 @@ using std::wstring;
*/
class Command
{
DEFINE_LOGGER();
public:
Command();
virtual ~Command() {}

View file

@ -28,6 +28,9 @@
#include "encoding.h"
INIT_LOGGER(game, Coord);
Coord::Coord(int iRow, int iCol, Direction iDir)
{
m_row = iRow;

View file

@ -24,6 +24,8 @@
#include <string>
#include "logging.h"
using std::wstring;
@ -33,6 +35,7 @@ using std::wstring;
*/
class Coord
{
DEFINE_LOGGER();
public:
enum Direction {VERTICAL, HORIZONTAL};

View file

@ -26,6 +26,9 @@
#define CROSS_MASK 0xFFFFFFFF
INIT_LOGGER(game, Cross);
Cross::Cross()
{
// The default behaviour is to match everything

View file

@ -24,6 +24,7 @@
#include <set>
#include "tile.h"
#include "logging.h"
using namespace std;
@ -35,6 +36,7 @@ using namespace std;
// TODO: implement using the bitset class
class Cross
{
DEFINE_LOGGER();
public:
Cross();

View file

@ -28,6 +28,9 @@
#include "turn.h"
INIT_LOGGER(game, GameMoveCmd);
GameMoveCmd::GameMoveCmd(Game &ioGame, const Move &iMove,
unsigned int iPlayerId)
: m_game(ioGame), m_move(iMove),

View file

@ -25,6 +25,7 @@
#include "move.h"
#include "pldrack.h"
#include "round.h"
#include "logging.h"
class Game;
@ -42,6 +43,8 @@ class Game;
*/
class GameMoveCmd: public Command
{
DEFINE_LOGGER();
public:
GameMoveCmd(Game &ioGame, const Move &iMove,
unsigned int iPlayerId);

View file

@ -31,6 +31,9 @@
#include "debug.h"
INIT_LOGGER(game, History);
History::History()
{
Turn* t = new Turn();

View file

@ -25,6 +25,8 @@
#include <string>
#include <vector>
#include "logging.h"
using std::wstring;
using std::vector;
@ -52,7 +54,8 @@ class PlayedRack;
*/
class History
{
public:
DEFINE_LOGGER();
public:
History();
~History();

View file

@ -25,6 +25,9 @@
using namespace std;
INIT_LOGGER(game, MarkPlayedCmd);
MarkPlayedCmd::MarkPlayedCmd(Duplicate &ioDuplicate,
unsigned int iPlayerId,
bool iPlayedFlag)

View file

@ -22,6 +22,7 @@
#define MARK_PLAYED_CMD_H_
#include "command.h"
#include "logging.h"
class Duplicate;
@ -32,6 +33,8 @@ class Duplicate;
*/
class MarkPlayedCmd: public Command
{
DEFINE_LOGGER();
public:
MarkPlayedCmd(Duplicate &ioDuplicate,
unsigned int iPlayerId,

View file

@ -25,6 +25,9 @@
using namespace std;
INIT_LOGGER(game, MasterMoveCmd);
MasterMoveCmd::MasterMoveCmd(Duplicate &ioDuplicate,
const Move &iMove)
: m_duplicateGame(ioDuplicate), m_newMove(iMove)

View file

@ -23,6 +23,7 @@
#include "command.h"
#include "move.h"
#include "logging.h"
class Duplicate;
@ -32,6 +33,8 @@ class Duplicate;
*/
class MasterMoveCmd: public Command
{
DEFINE_LOGGER();
public:
MasterMoveCmd(Duplicate &ioDuplicate,
const Move &iMove);

View file

@ -30,6 +30,9 @@
#include "debug.h"
INIT_LOGGER(game, Move);
Move::Move()
:m_score(0)
{

View file

@ -24,6 +24,7 @@
#include <string>
#include "round.h"
#include "logging.h"
class Rack;
class PlayedRack;
@ -44,6 +45,8 @@ using std::wstring;
*/
class Move
{
DEFINE_LOGGER();
public:
/**
* Default constructor, corresponding to no move

View file

@ -33,6 +33,9 @@
#include "debug.h"
INIT_LOGGER(game, Player);
Player::Player()
: m_id(0), m_score(0)
{

View file

@ -26,6 +26,7 @@
#include <string>
#include "pldrack.h"
#include "history.h"
#include "logging.h"
using std::wstring;
@ -39,6 +40,7 @@ class Rack;
*/
class Player
{
DEFINE_LOGGER();
public:
explicit Player();
virtual ~Player() {}

View file

@ -24,6 +24,9 @@
#include <sstream>
INIT_LOGGER(game, PlayerMoveCmd);
PlayerMoveCmd::PlayerMoveCmd(Player &ioPlayer, const Move &iMove)
: m_player(ioPlayer), m_move(iMove)
{

View file

@ -24,6 +24,7 @@
#include "command.h"
#include "move.h"
#include "pldrack.h"
#include "logging.h"
class Player;
class Rack;
@ -41,6 +42,8 @@ class Rack;
*/
class PlayerMoveCmd: public Command
{
DEFINE_LOGGER();
public:
PlayerMoveCmd(Player &ioPlayer, const Move &iMove);

View file

@ -24,6 +24,9 @@
#include "player.h"
INIT_LOGGER(game, PlayerPointsCmd);
PlayerPointsCmd::PlayerPointsCmd(Player &ioPlayer, int iPoints)
: m_player(ioPlayer), m_points(iPoints)
{

View file

@ -22,6 +22,7 @@
#define PLAYER_POINTS_CMD_H_
#include "command.h"
#include "logging.h"
class Player;
@ -32,6 +33,8 @@ class Player;
*/
class PlayerPointsCmd: public Command
{
DEFINE_LOGGER();
public:
PlayerPointsCmd(Player &ioPlayer, int iPoints);

View file

@ -24,6 +24,9 @@
#include "player.h"
INIT_LOGGER(game, PlayerRackCmd);
PlayerRackCmd::PlayerRackCmd(Player &ioPlayer, const PlayedRack &iNewRack)
: m_player(ioPlayer), m_newRack(iNewRack)
{

View file

@ -23,6 +23,7 @@
#include "command.h"
#include "pldrack.h"
#include "logging.h"
class Player;
@ -33,6 +34,8 @@ class Player;
*/
class PlayerRackCmd: public Command
{
DEFINE_LOGGER();
public:
PlayerRackCmd(Player &ioPlayer, const PlayedRack &iNewRack);

View file

@ -26,6 +26,9 @@
#include "rack.h"
INIT_LOGGER(game, PlayedRack);
PlayedRack::PlayedRack()
: m_reject(false)
{

View file

@ -25,6 +25,7 @@
#include <vector>
#include <string>
#include "tile.h"
#include "logging.h"
class Rack;
@ -39,6 +40,7 @@ using namespace std;
*/
class PlayedRack
{
DEFINE_LOGGER();
public:
PlayedRack();

View file

@ -25,6 +25,9 @@
#include "debug.h"
INIT_LOGGER(game, Rack);
Rack::Rack()
: m_tiles(Dictionary::GetDic().getTileNumber() + 1, 0), m_ntiles(0)
{

View file

@ -26,6 +26,7 @@
#include <string>
#include "tile.h"
#include "logging.h"
using namespace std;
@ -36,6 +37,7 @@ using namespace std;
*/
class Rack
{
DEFINE_LOGGER();
public:
Rack();

View file

@ -32,6 +32,9 @@
#include "debug.h"
INIT_LOGGER(game, Results);
bool tileCompare(const Tile &t1, const Tile &t2)
{
return t1.toCode() < t2.toCode();

View file

@ -25,6 +25,7 @@
#include <vector>
#include <map>
#include "round.h"
#include "logging.h"
using namespace std;
@ -46,6 +47,7 @@ class Rack;
*/
class Results
{
DEFINE_LOGGER();
public:
virtual ~Results() {}
unsigned int size() const { return m_rounds.size(); }

View file

@ -28,6 +28,9 @@
#include "encoding.h"
INIT_LOGGER(game, Round);
#define FROMBOARD 0x1
#define FROMRACK 0x2
#define JOKER 0x4

View file

@ -25,6 +25,7 @@
#include <vector>
#include "tile.h"
#include "coord.h"
#include "logging.h"
using namespace std;
@ -37,6 +38,7 @@ using namespace std;
*/
class Round
{
DEFINE_LOGGER();
public:
/*************************

View file

@ -41,6 +41,9 @@
using namespace libconfig;
INIT_LOGGER(game, Settings);
Settings *Settings::m_instance = NULL;

View file

@ -24,6 +24,8 @@
#include <string>
#include <map>
#include "logging.h"
using std::string;
using std::map;
@ -44,6 +46,7 @@ namespace libconfig
*/
class Settings
{
DEFINE_LOGGER();
public:
/// Access to the singleton
static Settings& Instance();

View file

@ -22,6 +22,9 @@
#include "turn.h"
INIT_LOGGER(game, Turn);
// FIXME: move set to an arbitrary one (no move). It would be better to get rid of this
// constructor completely
Turn::Turn()

View file

@ -25,6 +25,7 @@
#include <string>
#include "pldrack.h"
#include "move.h"
#include "logging.h"
using std::wstring;
@ -38,6 +39,7 @@ using std::wstring;
*/
class Turn
{
DEFINE_LOGGER();
public:
Turn();
Turn(unsigned int iPlayerId,

View file

@ -25,6 +25,9 @@
#include "player.h"
INIT_LOGGER(game, TurnCmd);
TurnCmd::TurnCmd()
{
// Fake execution

View file

@ -24,6 +24,7 @@
#include <vector>
#include "command.h"
#include "logging.h"
using namespace std;
@ -34,6 +35,8 @@ using namespace std;
*/
class TurnCmd: public Command
{
DEFINE_LOGGER();
public:
TurnCmd();
virtual ~TurnCmd();

View file

@ -31,6 +31,9 @@
#include "qtcommon.h"
INIT_LOGGER(qt, AuxWindow);
AuxWindow::AuxWindow(QWidget &iWidget, QString iWindowTitle,
QString iWindowName, QAction *iAction)
: m_widget(iWidget), m_windowName(iWindowName), m_action(iAction)

View file

@ -23,6 +23,8 @@
#include <QtGui/QWidget>
#include "logging.h"
class QAction;
@ -34,6 +36,7 @@ class QAction;
class AuxWindow: public QWidget
{
Q_OBJECT;
DEFINE_LOGGER();
public:
/**

View file

@ -34,6 +34,9 @@
using namespace std;
INIT_LOGGER(qt, BagWidget);
BagWidget::BagWidget(QWidget *parent)
: QWidget(parent), m_game(NULL)
{

View file

@ -24,6 +24,7 @@
#include <QtGui/QWidget>
#include <ui/bag_widget.ui.h>
#include "logging.h"
class PublicGame;
//class QTreeView;
@ -32,6 +33,7 @@ class QStandardItemModel;
class BagWidget: public QWidget, private Ui::BagWidget
{
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit BagWidget(QWidget *parent = 0);

View file

@ -38,6 +38,9 @@
using namespace std;
INIT_LOGGER(qt, BagWidget2);
BagWidget2::BagWidget2(QWidget *parent)
: QWidget(parent), m_game(NULL), m_totalNbTiles(0),
m_showPlayedTiles(true), m_showTilesInRack(true)

View file

@ -24,6 +24,8 @@
#include <vector>
#include <QtGui/QWidget>
#include "logging.h"
using std::vector;
class PublicGame;
@ -33,6 +35,7 @@ class TileWidget;
class BagWidget2: public QWidget
{
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit BagWidget2(QWidget *parent = 0);

View file

@ -34,6 +34,9 @@
using namespace std;
INIT_LOGGER(qt, BoardWidget);
BoardWidget::BoardWidget(CoordModel &iCoordModel, QWidget *parent)
: QFrame(parent), m_game(NULL),
m_coordModel(iCoordModel), m_showTemporarySigns(true),

View file

@ -22,7 +22,9 @@
#define BOARD_WIDGET_H_
#include <QtGui/QFrame>
#include "matrix.h"
#include "logging.h"
class PublicGame;
@ -33,6 +35,7 @@ class Coord;
class BoardWidget: public QFrame
{
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit BoardWidget(CoordModel &iCoordModel, QWidget *parent = 0);

View file

@ -21,6 +21,9 @@
#include "coord_model.h"
INIT_LOGGER(qt, CoordModel);
void CoordModel::setCoord(const Coord &iCoord)
{
m_prevCoord = m_currCoord;

View file

@ -22,12 +22,15 @@
#define COORD_MODEL_H_
#include <QObject>
#include "coord.h"
#include "logging.h"
class CoordModel: public QObject
{
Q_OBJECT;
DEFINE_LOGGER();
public:
void setCoord(const Coord &iCoord);

View file

@ -24,6 +24,9 @@
#include "qtcommon.h"
INIT_LOGGER(qt, CustomPopup);
CustomPopup::CustomPopup(QWidget *iWidget)
: QObject(iWidget), m_widget(iWidget)
{

View file

@ -24,6 +24,8 @@
#include <QtCore/QObject>
#include <QtCore/QString>
#include "logging.h"
class QWidget;
class QPoint;
class QMenu;
@ -32,6 +34,7 @@ class QMenu;
class CustomPopup: public QObject
{
Q_OBJECT;
DEFINE_LOGGER();
public:
CustomPopup(QWidget *iWidget);

View file

@ -43,6 +43,9 @@
using namespace std;
INIT_LOGGER(qt, DicToolsWidget);
DicToolsWidget::DicToolsWidget(QWidget *parent)
: QWidget(parent), m_dic(NULL)
{

View file

@ -24,7 +24,9 @@
#include <string>
#include <QtGui/QWidget>
#include <QtGui/QPalette>
#include "ui/dic_tools_widget.ui.h"
#include "logging.h"
class QStandardItemModel;
class QString;
@ -34,6 +36,7 @@ class CustomPopup;
class DicToolsWidget: public QWidget, private Ui::DicToolsWidget
{
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit DicToolsWidget(QWidget *parent = 0);

View file

@ -39,6 +39,12 @@
using namespace std;
INIT_LOGGER(qt, DicWizard);
INIT_LOGGER(qt, WizardInfoPage);
INIT_LOGGER(qt, WizardLettersDefPage);
INIT_LOGGER(qt, WizardConclusionPage);
// ---------- WizardInfoPage ----------
WizardInfoPage::WizardInfoPage(QWidget *parent) : QWizardPage(parent)

View file

@ -28,6 +28,7 @@
#include "ui/dic_wizard_info_page.ui.h"
#include "ui/dic_wizard_letters_def_page.ui.h"
#include "ui/dic_wizard_conclusion_page.ui.h"
#include "logging.h"
class QStandardItemModel;
class QItemSelection;
@ -37,6 +38,7 @@ class QModelIndex;
class DicWizard: public QWizard
{
Q_OBJECT;
DEFINE_LOGGER();
public:
DicWizard(QWidget *parent);
@ -53,7 +55,8 @@ signals:
class WizardInfoPage: public QWizardPage, private Ui::WizardInfoPage
{
Q_OBJECT
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit WizardInfoPage(QWidget *parent = 0);
virtual bool isComplete() const;
@ -67,7 +70,8 @@ private slots:
class WizardLettersDefPage: public QWizardPage, private Ui::WizardLettersDefPage
{
Q_OBJECT
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit WizardLettersDefPage(QWidget *parent = 0);
const QStandardItemModel * getModel() const { return m_model; }
@ -82,7 +86,8 @@ private slots:
class WizardConclusionPage: public QWizardPage, private Ui::WizardConclusionPage
{
Q_OBJECT
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit WizardConclusionPage(QWidget *parent = 0);
virtual void initializePage();

View file

@ -40,6 +40,9 @@
using namespace std;
INIT_LOGGER(qt, HistoryWidget);
HistoryWidget::HistoryWidget(QWidget *parent)
: QTreeView(parent), m_history(NULL), m_forPlayer(false), m_isFreeGame(false)
{

View file

@ -24,6 +24,8 @@
#include <QtGui/QTreeView>
#include <QtGui/QTabWidget>
#include "logging.h"
class History;
class PublicGame;
@ -34,6 +36,7 @@ class CustomPopup;
class HistoryWidget: public QTreeView
{
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit HistoryWidget(QWidget *parent = 0);

View file

@ -23,8 +23,7 @@
#include <QDialog>
#include <ui/new_game.ui.h>
#include "ui/new_game.ui.h"
#include "logging.h"

View file

@ -32,6 +32,9 @@
#include "debug.h"
INIT_LOGGER(qt, PlayWordMediator);
PlayWordMediator::PlayWordMediator(QObject *parent, QLineEdit &iEditPlay,
QLineEdit &iEditCoord, QLineEdit &iEditPoints,
QPushButton &iButtonPlay,

View file

@ -24,6 +24,8 @@
#include <string>
#include <QtGui/QValidator>
#include "logging.h"
using std::wstring;
@ -50,6 +52,7 @@ class Dictionary;
class PlayWordMediator: public QObject
{
Q_OBJECT;
DEFINE_LOGGER();
public:
PlayWordMediator(QObject *parent, QLineEdit &iEditWord,

View file

@ -36,6 +36,9 @@
#include "encoding.h"
INIT_LOGGER(qt, PlayerWidget);
PlayerWidget::PlayerWidget(QWidget *parent, CoordModel &iCoordModel,
unsigned int iPlayerNb, PublicGame *iGame)
: QWidget(parent), m_game(iGame), m_player(iPlayerNb)

View file

@ -23,7 +23,9 @@
#include <QtGui/QWidget>
#include <QtGui/QTabWidget>
#include "ui/player_widget.ui.h"
#include "logging.h"
class QLineEdit;
@ -35,6 +37,7 @@ class Coord;
class PlayerWidget: public QWidget, private Ui::PlayerWidget
{
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit PlayerWidget(QWidget *parent,

View file

@ -32,6 +32,9 @@
#include "settings.h"
INIT_LOGGER(qt, PrefsDialog);
const QString PrefsDialog::kINTF_ALIGN_HISTORY = "Interface/AlignHistory";
const QString PrefsDialog::kINTF_DIC_PATH = "Interface/DicPath";
const QString PrefsDialog::kINTF_DEFINITIONS_SITE_URL = "Interface/DefinitionsSiteUrl";

View file

@ -24,7 +24,8 @@
#include <QtGui/QDialog>
#include <QtCore/QString>
#include <ui/prefs_dialog.ui.h>
#include "ui/prefs_dialog.ui.h"
#include "logging.h"
class QStringList;
@ -32,6 +33,7 @@ class QStringList;
class PrefsDialog: public QDialog, private Ui::PrefsDialog
{
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit PrefsDialog(QWidget *iParent = 0);

View file

@ -29,6 +29,9 @@
using namespace std;
INIT_LOGGER(qt, ScoreWidget);
ScoreWidget::ScoreWidget(QWidget *parent, const PublicGame *iGame)
: QTreeView(parent), m_game(iGame)
{

View file

@ -23,6 +23,8 @@
#include <QtGui/QTreeView>
#include "logging.h"
class PublicGame;
class QStandardItemModel;
@ -30,6 +32,7 @@ class QStandardItemModel;
class ScoreWidget: public QTreeView
{
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit ScoreWidget(QWidget *parent = 0, const PublicGame *iGame = NULL);

View file

@ -23,6 +23,8 @@
#include "timer_widget.h"
INIT_LOGGER(qt, TimerModel);
INIT_LOGGER(qt, TimerWidget);

View file

@ -33,6 +33,7 @@ class QTimer;
class TimerModel : public QObject
{
Q_OBJECT;
DEFINE_LOGGER();
public:
TimerModel(int iTotalDuration, int iAlertDuration);

View file

@ -37,6 +37,9 @@
using namespace std;
INIT_LOGGER(qt, TrainingWidget);
static const int HIDDEN_COLUMN = 6;

View file

@ -23,6 +23,7 @@
#include <QtGui/QWidget>
#include "ui/training_widget.ui.h"
#include "logging.h"
class QStandardItemModel;
@ -36,6 +37,7 @@ class PublicGame;
class TrainingWidget: public QWidget, private Ui::TrainingWidget
{
Q_OBJECT;
DEFINE_LOGGER();
public:
explicit TrainingWidget(QWidget *parent, CoordModel &iCoordModel, PublicGame *iGame);

View file

@ -45,6 +45,9 @@ using boost::format;
using boost::wformat;
INIT_LOGGER(utils, GameIO);
#define __UNUSED__ __attribute__((unused))
void GameIO::printBoard(ostream &out, const PublicGame &iGame)

View file

@ -23,6 +23,8 @@
#include <iostream>
#include "logging.h"
class PublicGame;
class Results;
@ -39,6 +41,7 @@ using std::ostream;
*/
class GameIO
{
DEFINE_LOGGER();
public:
static void printBoard(ostream &out, const PublicGame &iGame);
static void printBoardDebug(ostream &out, const PublicGame &iGame);

View file

@ -53,6 +53,10 @@
using namespace std;
INIT_LOGGER(utils, Box);
INIT_LOGGER(utils, CursesIntf);
Box::Box(WINDOW *win, int y, int x, int h, int w,
unsigned int iHeadingLines)
: m_win(win), m_x(x), m_y(y), m_w(w), m_h(h),

View file

@ -23,6 +23,8 @@
#include <ncursesw/curses.h>
#include <string>
#include "logging.h"
class PublicGame;
using std::string;
@ -31,6 +33,8 @@ using std::wstring;
class Box
{
DEFINE_LOGGER();
public:
// Create a titled box with the specified position and size,
// containing iHeadingLines non-scrolling lines.
@ -97,6 +101,7 @@ class Box
*/
class CursesIntf
{
DEFINE_LOGGER();
public:
// Pre-requisite: the given Game object MUST have been allocated with new
// (in particular: not on the stack)