My favorites | Sign in
Project Home Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/********************************************\
*
* Sire - Molecular Simulation Framework
*
* Copyright (C) 2009 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 2 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 developer's mailing list
* at http://siremol.org
*
\*********************************************/

#ifndef SIREN_LOGGER_H
#define SIREN_LOGGER_H

#include <QTextStream>

#include "handle.h"

SIREN_BEGIN_HEADER

namespace Siren
{

class Logger;

/** This is the base class of all of the Loggers. These are
simple classes that provide a means of recording output
during a function call (e.g. by either printing directly
to the screen or by sending the output to a file or other sink)

@author Christopher Woods
*/
class SIREN_EXPORT Logger : public ImplementsHandle<Logger, Handles<QTextStream> >
{
public:
Logger();
Logger(QTextStream *stream);

Logger(const Logger &other);

virtual ~Logger();

Logger& operator=(const Logger &other);

bool operator==(const Logger &other) const;
bool operator!=(const Logger &other) const;

///////////////////////
// Implements Handle //
///////////////////////

QString toString() const;
uint hashCode() const;

///////////////////////
// Logger //
///////////////////////

void write(const QString &text);
void writeHeader(const QString &text, int level);
};

}

Q_DECLARE_METATYPE( Siren::Logger )

SIREN_EXPOSE_CLASS( Siren::Logger )

SIREN_END_HEADER

#endif

Change log

r1108 by chryswoods on Nov 25, 2009   Diff
I've updated the metatype system so that
it works fully for Primitive and Handle
types.
Now Number and String work (and
.getClass() works for them too!)

The only test failures from sirentest are
Logger, DataStream and XMLStream, who all
complain that I haven't yet written unit
tests for them!

Go to: 
Sign in to write a code review

Older revisions

r1102 by chryswoods on Nov 20, 2009   Diff
I've got Siren compiled and linked,
and have got (most) of the python
wrappers working.
The code works, to an extent, but
there are quite a few problems and
...
r1101 by chryswoods on Nov 20, 2009   Diff
I've filled in most of the missing
functions in Siren - I just need to
finish off DataStream and Tester.
Once they are complete, I should be
able to link and then test Siren
...
r1093 by chryswoods on Nov 15, 2009   Diff
I've created the Handle hierarchy of
classes which are used to provide the
equivalent
of Object for shared data types.
Handle provides handles with which to
...
All revisions of this file

File info

Size: 2368 bytes, 88 lines
Powered by Google Project Hosting