-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging devel into main, preparing for the 2024.1.0 release
- Loading branch information
1 parent
394bcc6
commit 8c559ad
Showing
32 changed files
with
5,352 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/********************************************\ | ||
* | ||
* Sire - Molecular Simulation Framework | ||
* | ||
* Copyright (C) 2024 Christopher Woods | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* For full details of the license please see the COPYING file | ||
* that should have come with this distribution. | ||
* | ||
* You can contact the authors via the website | ||
* at https://sire.openbiosim.org | ||
* | ||
\*********************************************/ | ||
|
||
#include "SireBase/console.h" | ||
|
||
using namespace SireBase; | ||
|
||
ConsoleBase::ConsoleBase() | ||
{ | ||
} | ||
|
||
ConsoleBase::~ConsoleBase() | ||
{ | ||
} | ||
|
||
ConsoleBase *Console::c(0); | ||
|
||
Console::Console() | ||
{ | ||
} | ||
|
||
Console::~Console() | ||
{ | ||
} | ||
|
||
/** Write the passed debug message to the console */ | ||
void Console::debug(const QString &message) | ||
{ | ||
if (c) | ||
c->debug(message); | ||
} | ||
|
||
/** Write the passed warning message to the console */ | ||
void Console::warning(const QString &message) | ||
{ | ||
if (c) | ||
c->warning(message); | ||
} | ||
|
||
/** Write the passed error message to the console */ | ||
void Console::error(const QString &message) | ||
{ | ||
if (c) | ||
c->error(message); | ||
} | ||
|
||
/** Write the passed info message to the console */ | ||
void Console::info(const QString &message) | ||
{ | ||
if (c) | ||
c->info(message); | ||
} | ||
|
||
/** Set the driver for the global console - this will delete | ||
* any existing console - and will take ownership of the pointer! | ||
*/ | ||
void Console::setConsole(ConsoleBase *console) | ||
{ | ||
if (c) | ||
delete c; | ||
|
||
c = console; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/********************************************\ | ||
* | ||
* Sire - Molecular Simulation Framework | ||
* | ||
* Copyright (C) 2024 Christopher Woods | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* For full details of the license please see the COPYING file | ||
* that should have come with this distribution. | ||
* | ||
* You can contact the authors via the website | ||
* at https://sire.openbiosim.org | ||
* | ||
\*********************************************/ | ||
|
||
#ifndef SIREBASE_CONSOLE_H | ||
#define SIREBASE_CONSOLE_H | ||
|
||
#include "sireglobal.h" | ||
|
||
SIRE_BEGIN_HEADER | ||
|
||
namespace SireBase | ||
{ | ||
/** Virtual base class of the actual console implementation */ | ||
class SIREBASE_EXPORT ConsoleBase | ||
{ | ||
public: | ||
ConsoleBase(); | ||
virtual ~ConsoleBase(); | ||
|
||
virtual void debug(const QString &message) const = 0; | ||
virtual void warning(const QString &message) const = 0; | ||
virtual void error(const QString &message) const = 0; | ||
virtual void info(const QString &message) const = 0; | ||
}; | ||
|
||
/** This class provides static functions that can be used | ||
* to (sparingly) output messages to the console. This is | ||
* controlled by the tools in sire.utils.console | ||
*/ | ||
class SIREBASE_EXPORT Console | ||
{ | ||
public: | ||
static void debug(const QString &message); | ||
static void warning(const QString &message); | ||
static void error(const QString &message); | ||
static void info(const QString &message); | ||
|
||
static void setConsole(ConsoleBase *console); | ||
|
||
private: | ||
Console(); | ||
~Console(); | ||
|
||
static ConsoleBase *c; | ||
}; | ||
} | ||
|
||
SIRE_END_HEADER | ||
|
||
#endif // SIREBASE_CONSOLE_H |
Oops, something went wrong.