[cig-commits] r4030 - cs/pythia/trunk/journal/include
leif at geodynamics.org
leif at geodynamics.org
Tue Jul 18 21:15:12 PDT 2006
Author: leif
Date: 2006-07-18 21:15:11 -0700 (Tue, 18 Jul 2006)
New Revision: 4030
Removed:
cs/pythia/trunk/journal/include/Diagnostic.icc
cs/pythia/trunk/journal/include/Index.icc
cs/pythia/trunk/journal/include/NullDiagnostic.icc
cs/pythia/trunk/journal/include/SeverityDebug.icc
cs/pythia/trunk/journal/include/SeverityError.icc
cs/pythia/trunk/journal/include/SeverityFirewall.icc
cs/pythia/trunk/journal/include/SeverityInfo.icc
cs/pythia/trunk/journal/include/SeverityWarning.icc
cs/pythia/trunk/journal/include/manip-explicit.icc
cs/pythia/trunk/journal/include/manip-templated.icc
cs/pythia/trunk/journal/include/manipulators.icc
Modified:
cs/pythia/trunk/journal/include/Diagnostic.h
cs/pythia/trunk/journal/include/Index.h
cs/pythia/trunk/journal/include/NullDiagnostic.h
cs/pythia/trunk/journal/include/SeverityDebug.h
cs/pythia/trunk/journal/include/SeverityError.h
cs/pythia/trunk/journal/include/SeverityFirewall.h
cs/pythia/trunk/journal/include/SeverityInfo.h
cs/pythia/trunk/journal/include/SeverityWarning.h
cs/pythia/trunk/journal/include/manip-explicit.h
cs/pythia/trunk/journal/include/manip-templated.h
cs/pythia/trunk/journal/include/manipulators.h
Log:
Nuked gratuitous '.icc' files.
Modified: cs/pythia/trunk/journal/include/Diagnostic.h
===================================================================
--- cs/pythia/trunk/journal/include/Diagnostic.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/Diagnostic.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -23,11 +23,7 @@
class Diagnostic;
}
-// injection operator
-template <typename item_t>
-inline journal::Diagnostic & operator<< (journal::Diagnostic &, item_t);
-
class journal::Diagnostic {
// types
@@ -43,26 +39,29 @@
public:
void state(bool);
bool state() const;
+
+ void activate() { state(true); }
+ void deactivate() { state(false); }
- inline void activate();
- inline void deactivate();
+ string_t facility() const { return _facility; }
- inline string_t facility() const;
-
// entry manipulation
void record();
void newline();
void attribute(string_t, string_t);
// access to the buffered data
- inline string_t str() const;
+ string_t str() const { return _buffer.str(); }
// access to the journal singleton
static journal_t & journal();
// builtin data type injection
template <typename item_t>
- inline Diagnostic & inject(item_t datum);
+ Diagnostic & inject(item_t datum) {
+ _buffer << item;
+ return *this;
+ }
// meta-methods
public:
@@ -88,11 +87,14 @@
entry_t * _entry;
};
-// get the inline definitions
-#define journal_Diagnostic_icc
-#include "Diagnostic.icc"
-#undef journal_Diagnostic_icc
+// the injection operator
+template <typename item_t>
+journal::Diagnostic & operator<< (journal::Diagnostic & diagnostic, item_t item) {
+ return diagnostic.inject(item);
+}
+
+
#endif
// version
Deleted: cs/pythia/trunk/journal/include/Diagnostic.icc
===================================================================
--- cs/pythia/trunk/journal/include/Diagnostic.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/Diagnostic.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,58 +0,0 @@
-// -*- C++ -*-
-//
-//--------------------------------------------------------------------------------
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// <LicenseText>
-//
-//--------------------------------------------------------------------------------
-//
-
-#if !defined(journal_Diagnostic_icc)
-#error This header file contains implementation details of the class Diagnostic
-#else
-
-// inlines
-// interface
-void journal::Diagnostic::activate() {
- state(true);
- return;
-}
-
-
-void journal::Diagnostic::deactivate() {
- state(false);
- return;
-}
-
-
-journal::Diagnostic::string_t journal::Diagnostic::facility() const {
- return _facility;
-}
-
-
-journal::Diagnostic::string_t journal::Diagnostic::str() const {
- return _buffer.str();
-}
-
-template <typename item_t>
-journal::Diagnostic & journal::Diagnostic::inject(item_t item) {
- _buffer << item;
- return *this;
-}
-
-// the injection operator
-template <typename item_t>
-journal::Diagnostic & operator<< (journal::Diagnostic & diagnostic, item_t item) {
- return diagnostic.inject(item);
-}
-
-#endif
-
-// version
-// $Id: Diagnostic.icc,v 1.1.1.1 2005/03/08 16:13:55 aivazis Exp $
-
-// End of file
Modified: cs/pythia/trunk/journal/include/Index.h
===================================================================
--- cs/pythia/trunk/journal/include/Index.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/Index.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -36,7 +36,7 @@
// meta-methods
public:
virtual ~Index();
- inline Index();
+ Index() {}
// disable these
private:
@@ -44,10 +44,6 @@
const Index & operator=(const Index &);
};
-// get the inline definitions
-#define journal_Index_icc
-#include "Index.icc"
-#undef journal_Index_icc
#endif
// version
Deleted: cs/pythia/trunk/journal/include/Index.icc
===================================================================
--- cs/pythia/trunk/journal/include/Index.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/Index.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,28 +0,0 @@
-// -*- C++ -*-
-//
-//--------------------------------------------------------------------------------
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// <LicenseText>
-//
-//--------------------------------------------------------------------------------
-//
-
-#if !defined(journal_Index_icc)
-#error This header file contains implementation details of the class Index
-#else
-
-// inlines
-
-// meta-methods
-journal::Index::Index() {}
-
-#endif
-
-// version
-// $Id: Index.icc,v 1.1.1.1 2005/03/08 16:13:55 aivazis Exp $
-
-// End of file
Modified: cs/pythia/trunk/journal/include/NullDiagnostic.h
===================================================================
--- cs/pythia/trunk/journal/include/NullDiagnostic.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/NullDiagnostic.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -20,11 +20,7 @@
class NullDiagnostic;
}
-// injection operator
-template <typename item_t>
-inline journal::NullDiagnostic & operator<< (journal::NullDiagnostic &, item_t);
-
class journal::NullDiagnostic {
// types
@@ -33,11 +29,11 @@
// interface
public:
- inline void state(bool) const { return; }
- inline bool state() const { return false; }
+ void state(bool) const { return; }
+ bool state() const { return false; }
- inline void activate() const { return; }
- inline void deactvate() const { return; }
+ void activate() const { return; }
+ void deactvate() const { return; }
// meta-methods
~NullDiagnostic() {}
@@ -51,18 +47,27 @@
// manipulators
namespace journal {
- inline const NullDiagnostic & endl(const NullDiagnostic &);
- inline const NullDiagnostic & newline(const NullDiagnostic &);
+
+ const NullDiagnostic & endl(const NullDiagnostic &) {
+ return diagnostic;
+ }
+
+ const NullDiagnostic & newline(const NullDiagnostic &) {
+ return diagnostic;
+ }
+
}
-// get the inline definitions
-#define journal_NullDiagnostic_icc
-#include "NullDiagnostic.icc"
-#undef journal_NullDiagnostic_icc
+// the injection operator
+template <typename item_t>
+journal::NullDiagnostic & operator<< (journal::NullDiagnostic & diagnostic, item_t) {
+ return diagnostic;
+}
-# endif
+#endif
+
// version
// $Id: NullDiagnostic.h,v 1.1.1.1 2005/03/08 16:13:55 aivazis Exp $
Deleted: cs/pythia/trunk/journal/include/NullDiagnostic.icc
===================================================================
--- cs/pythia/trunk/journal/include/NullDiagnostic.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/NullDiagnostic.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,39 +0,0 @@
-// -*- C++ -*-
-//
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// {LicenseText}
-//
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-
-#if !defined(journal_NullDiagnostic_icc)
-#error This header file contains implementation details of the class NullDiagnostic
-#else
-
-// manipulators
-const journal::NullDiagnostic & journal::endl(const NullDiagnostic & diagnostic) {
- return diagnostic;
-}
-
-const journal::NullDiagnostic & journal::newline(const NullDiagnostic & diagnostic) {
- return diagnostic;
-}
-
-// the injection operator
-template <typename item_t>
-journal::NullDiagnostic & operator<< (journal::NullDiagnostic & diagnostic, item_t) {
- return diagnostic;
-}
-
-
-#endif
-
-// version
-// $Id: NullDiagnostic.icc,v 1.1.1.1 2005/03/08 16:13:56 aivazis Exp $
-
-// End of file
Modified: cs/pythia/trunk/journal/include/SeverityDebug.h
===================================================================
--- cs/pythia/trunk/journal/include/SeverityDebug.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/SeverityDebug.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -31,13 +31,15 @@
// interface
public:
- inline string_t name() const;
+ string_t name() const { return "debug." + facility(); }
static state_t & lookup(string_t);
// meta-methods
public:
virtual ~SeverityDebug();
- inline SeverityDebug(string_t);
+
+ SeverityDebug(string_t name) :
+ Diagnostic(name, "debug", lookup(name)) {}
// disable these
private:
@@ -49,10 +51,6 @@
static index_t * _index;
};
-// get the inline definitions
-#define journal_SeverityDebug_icc
-#include "SeverityDebug.icc"
-#undef journal_SeverityDebug_icc
#endif
// version
Deleted: cs/pythia/trunk/journal/include/SeverityDebug.icc
===================================================================
--- cs/pythia/trunk/journal/include/SeverityDebug.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/SeverityDebug.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,34 +0,0 @@
-// -*- C++ -*-
-//
-//--------------------------------------------------------------------------------
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// <LicenseText>
-//
-//--------------------------------------------------------------------------------
-//
-
-#if !defined(journal_SeverityDebug_icc)
-#error This header file contains implementation details of the class SeverityDebug
-#else
-
-// inlines
-// interface
-journal::SeverityDebug::string_t
-journal::SeverityDebug::name() const {
- return "debug." + facility();
-}
-
-// meta-methods
-journal::SeverityDebug::SeverityDebug(string_t name) :
-journal::Diagnostic(name, "debug", lookup(name)) {}
-
-#endif
-
-// version
-// $Id: SeverityDebug.icc,v 1.1.1.1 2005/03/08 16:13:55 aivazis Exp $
-
-// End of file
Modified: cs/pythia/trunk/journal/include/SeverityError.h
===================================================================
--- cs/pythia/trunk/journal/include/SeverityError.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/SeverityError.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -31,13 +31,15 @@
// interface
public:
- inline string_t name() const;
+ string_t name() const { return "error." + facility(); }
static state_t & lookup(string_t);
// meta-methods
public:
virtual ~SeverityError();
- inline SeverityError(string_t);
+
+ SeverityError(string_t name) :
+ Diagnostic(name, "error", lookup(name)) {}
// disable these
private:
@@ -49,10 +51,6 @@
static index_t * _index;
};
-// get the inline definitions
-#define journal_SeverityError_icc
-#include "SeverityError.icc"
-#undef journal_SeverityError_icc
#endif
// version
Deleted: cs/pythia/trunk/journal/include/SeverityError.icc
===================================================================
--- cs/pythia/trunk/journal/include/SeverityError.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/SeverityError.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,34 +0,0 @@
-// -*- C++ -*-
-//
-//--------------------------------------------------------------------------------
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// <LicenseText>
-//
-//--------------------------------------------------------------------------------
-//
-
-#if !defined(journal_SeverityError_icc)
-#error This header file contains implementation details of the class SeverityError
-#else
-
-// inlines
-// interface
-journal::SeverityError::string_t
-journal::SeverityError::name() const {
- return "error." + facility();
-}
-
-// meta-methods
-journal::SeverityError::SeverityError(string_t name) :
-journal::Diagnostic(name, "error", lookup(name)) {}
-
-#endif
-
-// version
-// $Id: SeverityError.icc,v 1.1.1.1 2005/03/08 16:13:56 aivazis Exp $
-
-// End of file
Modified: cs/pythia/trunk/journal/include/SeverityFirewall.h
===================================================================
--- cs/pythia/trunk/journal/include/SeverityFirewall.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/SeverityFirewall.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -31,13 +31,15 @@
// interface
public:
- inline string_t name() const;
+ string_t name() const { return "firewall." + facility(); }
static state_t & lookup(string_t);
// meta-methods
public:
virtual ~SeverityFirewall();
- inline SeverityFirewall(string_t);
+
+ SeverityFirewall(string_t name) :
+ Diagnostic(name, "firewall", lookup(name)) {}
// disable these
private:
@@ -49,10 +51,6 @@
static index_t * _index;
};
-// get the inline definitions
-#define journal_SeverityFirewall_icc
-#include "SeverityFirewall.icc"
-#undef journal_SeverityFirewall_icc
#endif
// version
Deleted: cs/pythia/trunk/journal/include/SeverityFirewall.icc
===================================================================
--- cs/pythia/trunk/journal/include/SeverityFirewall.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/SeverityFirewall.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,34 +0,0 @@
-// -*- C++ -*-
-//
-//--------------------------------------------------------------------------------
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// <LicenseText>
-//
-//--------------------------------------------------------------------------------
-//
-
-#if !defined(journal_SeverityFirewall_icc)
-#error This header file contains implementation details of the class SeverityFirewall
-#else
-
-// inlines
-// interface
-journal::SeverityFirewall::string_t
-journal::SeverityFirewall::name() const {
- return "firewall." + facility();
-}
-
-// meta-methods
-journal::SeverityFirewall::SeverityFirewall(string_t name) :
-journal::Diagnostic(name, "firewall", lookup(name)) {}
-
-#endif
-
-// version
-// $Id: SeverityFirewall.icc,v 1.1.1.1 2005/03/08 16:13:55 aivazis Exp $
-
-// End of file
Modified: cs/pythia/trunk/journal/include/SeverityInfo.h
===================================================================
--- cs/pythia/trunk/journal/include/SeverityInfo.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/SeverityInfo.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -31,13 +31,15 @@
// interface
public:
- inline string_t name() const;
+ string_t name() const { return "info." + facility(); }
static state_t & lookup(string_t);
// meta-methods
public:
virtual ~SeverityInfo();
- inline SeverityInfo(string_t);
+
+ SeverityInfo(string_t name) :
+ Diagnostic(name, "info", lookup(name)) {}
// disable these
private:
@@ -49,10 +51,6 @@
static index_t * _index;
};
-// get the inline definitions
-#define journal_SeverityInfo_icc
-#include "SeverityInfo.icc"
-#undef journal_SeverityInfo_icc
#endif
// version
Deleted: cs/pythia/trunk/journal/include/SeverityInfo.icc
===================================================================
--- cs/pythia/trunk/journal/include/SeverityInfo.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/SeverityInfo.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,34 +0,0 @@
-// -*- C++ -*-
-//
-//--------------------------------------------------------------------------------
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// <LicenseText>
-//
-//--------------------------------------------------------------------------------
-//
-
-#if !defined(journal_SeverityInfo_icc)
-#error This header file contains implementation details of the class SeverityInfo
-#else
-
-// inlines
-// interface
-journal::SeverityInfo::string_t
-journal::SeverityInfo::name() const {
- return "info." + facility();
-}
-
-// meta-methods
-journal::SeverityInfo::SeverityInfo(string_t name) :
-journal::Diagnostic(name, "info", lookup(name)) {}
-
-#endif
-
-// version
-// $Id: SeverityInfo.icc,v 1.1.1.1 2005/03/08 16:13:56 aivazis Exp $
-
-// End of file
Modified: cs/pythia/trunk/journal/include/SeverityWarning.h
===================================================================
--- cs/pythia/trunk/journal/include/SeverityWarning.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/SeverityWarning.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -31,13 +31,15 @@
// interface
public:
- inline string_t name() const;
+ string_t name() const { return "warning." + facility(); }
static state_t & lookup(string_t);
// meta-methods
public:
virtual ~SeverityWarning();
- inline SeverityWarning(string_t);
+
+ SeverityWarning(string_t name) :
+ Diagnostic(name, "warning", lookup(name)) {}
// disable these
private:
@@ -49,10 +51,6 @@
static index_t * _index;
};
-// get the inline definitions
-#define journal_SeverityWarning_icc
-#include "SeverityWarning.icc"
-#undef journal_SeverityWarning_icc
#endif
// version
Deleted: cs/pythia/trunk/journal/include/SeverityWarning.icc
===================================================================
--- cs/pythia/trunk/journal/include/SeverityWarning.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/SeverityWarning.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,34 +0,0 @@
-// -*- C++ -*-
-//
-//--------------------------------------------------------------------------------
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// <LicenseText>
-//
-//--------------------------------------------------------------------------------
-//
-
-#if !defined(journal_SeverityWarning_icc)
-#error This header file contains implementation details of the class SeverityWarning
-#else
-
-// inlines
-// interface
-journal::SeverityWarning::string_t
-journal::SeverityWarning::name() const {
- return "warning." + facility();
-}
-
-// meta-methods
-journal::SeverityWarning::SeverityWarning(string_t name) :
-journal::Diagnostic(name, "warning", lookup(name)) {}
-
-#endif
-
-// version
-// $Id: SeverityWarning.icc,v 1.1.1.1 2005/03/08 16:13:55 aivazis Exp $
-
-// End of file
Modified: cs/pythia/trunk/journal/include/manip-explicit.h
===================================================================
--- cs/pythia/trunk/journal/include/manip-explicit.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/manip-explicit.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -22,10 +22,6 @@
class loc3_t;
}
-// the injection operators: leave these in the global namespace
-inline journal::Diagnostic & operator << (journal::Diagnostic &, journal::set_t);
-inline journal::Diagnostic & operator << (journal::Diagnostic &, journal::loc2_t);
-inline journal::Diagnostic & operator << (journal::Diagnostic &, journal::loc3_t);
class journal::set_t {
// types
@@ -34,7 +30,8 @@
// meta-methods
public:
- set_t(factory_t, const char *, const char *);
+ set_t(factory_t f, const char * key, const char * value) :
+ _f(f), _key(key), _value(value) {}
// data
public:
@@ -52,7 +49,8 @@
// meta-methods
public:
- loc2_t(factory_t, const char *, long);
+ loc2_t(factory_t f, const char * file, long line) :
+ _f(f), _file(file), _line(line) {}
// data
public:
@@ -69,7 +67,8 @@
// meta-methods
public:
- loc3_t(factory_t, const char *, long, const char *);
+ loc3_t(factory_t f, const char * file, long line, const char * function) :
+ _f(f), _file(file), _line(line), _function(function) {}
// data
public:
@@ -79,11 +78,25 @@
const char * _function;
};
-// get the inline definitions
-#define journal_manip_explicit_icc
-#include "manip-explicit.icc"
-#undef journal_manip_explicit_icc
+// the injection operators: leave these in the global namespace
+
+journal::Diagnostic & operator<< (journal::Diagnostic & s, journal::set_t m)
+{
+ return (*m._f)(s, m._key, m._value);
+}
+
+journal::Diagnostic & operator<< (journal::Diagnostic & s, journal::loc2_t m)
+{
+ return (*m._f)(s, m._file, m._line);
+}
+
+journal::Diagnostic & operator<< (journal::Diagnostic & s, journal::loc3_t m)
+{
+ return (*m._f)(s, m._file, m._line, m._function);
+}
+
+
#endif
// version
Deleted: cs/pythia/trunk/journal/include/manip-explicit.icc
===================================================================
--- cs/pythia/trunk/journal/include/manip-explicit.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/manip-explicit.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,50 +0,0 @@
-// -*- C++ -*-
-//
-//--------------------------------------------------------------------------------
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// <LicenseText>
-//
-//--------------------------------------------------------------------------------
-//
-
-#if !defined(journal_manip_explicit_icc)
-#error This header file contains manipulator implementation details
-#else
-
-journal::set_t::set_t(factory_t f, const char * key, const char * value) :
- _f(f), _key(key), _value(value)
-{}
-
-journal::loc2_t::loc2_t(factory_t f, const char * file, long line) :
- _f(f), _file(file), _line(line)
-{}
-
-journal::loc3_t::loc3_t(factory_t f, const char * file, long line, const char * function) :
- _f(f), _file(file), _line(line), _function(function)
-{}
-
-journal::Diagnostic & operator<< (journal::Diagnostic & s, journal::set_t m)
-{
- return (*m._f)(s, m._key, m._value);
-}
-
-journal::Diagnostic & operator<< (journal::Diagnostic & s, journal::loc2_t m)
-{
- return (*m._f)(s, m._file, m._line);
-}
-
-journal::Diagnostic & operator<< (journal::Diagnostic & s, journal::loc3_t m)
-{
- return (*m._f)(s, m._file, m._line, m._function);
-}
-
-#endif
-
-// version
-// $Id: manip-explicit.icc,v 1.1.1.1 2005/03/08 16:13:56 aivazis Exp $
-
-// End of file
Modified: cs/pythia/trunk/journal/include/manip-templated.h
===================================================================
--- cs/pythia/trunk/journal/include/manip-templated.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/manip-templated.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -59,7 +59,8 @@
// meta-methods
public:
- manip_1(factory_t f, arg1_t arg1);
+ manip_1(factory_t f, arg1_t arg1) :
+ _f(f), _arg1(arg1) {}
// data
private:
@@ -69,6 +70,14 @@
};
+template <typename arg1_t>
+journal::Diagnostic & operator<< (
+ journal::Diagnostic & s, journal::manip_1<arg1_t> m)
+{
+ return (*m._f)(s, m._arg1);
+}
+
+
template <typename arg1_t, typename arg2_t>
class journal::manip_2 {
@@ -82,7 +91,8 @@
// meta-methods
public:
- manip_2(factory_t f, arg1_t arg1, arg2_t arg2);
+ manip_2(factory_t f, arg1_t arg1, arg2_t arg2) :
+ _f(f), _arg1(arg1), _arg2(arg2) {}
// data
private:
@@ -93,6 +103,15 @@
};
+template <typename arg1_t, typename arg2_t>
+journal::Diagnostic &
+operator<< (
+ journal::Diagnostic & s, journal::manip_2<arg1_t, arg2_t> m)
+{
+ return (*m._f)(s, m._arg1, m._arg2);
+}
+
+
template <typename arg1_t, typename arg2_t, typename arg3_t>
class journal::manip_3 {
@@ -106,7 +125,8 @@
// meta-methods
public:
- manip_3(factory_t f, arg1_t arg1, arg2_t arg2, arg3_t arg3);
+ manip_3(factory_t f, arg1_t arg1, arg2_t arg2, arg3_t arg3) :
+ _f(f), _arg1(arg1), _arg2(arg2), _arg3(arg3) {}
// data
private:
@@ -117,11 +137,14 @@
arg3_t _arg3;
};
-// get the inlined definitions
-#define journal_manip_templated_icc
-#include "manip-templated.icc"
-#undef journal_manip_templated_icc
+template <typename arg1_t, typename arg2_t, typename arg3_t>
+journal::Diagnostic & operator<<
+(journal::Diagnostic & s, journal::manip_3<arg1_t, arg2_t, arg3_t> m) {
+ return (*m._f)(s, m._arg1, m._arg2, m._arg3);
+}
+
+
#endif
// version
Deleted: cs/pythia/trunk/journal/include/manip-templated.icc
===================================================================
--- cs/pythia/trunk/journal/include/manip-templated.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/manip-templated.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,61 +0,0 @@
-// -*- C++ -*-
-//
-//--------------------------------------------------------------------------------
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// <LicenseText>
-//
-//--------------------------------------------------------------------------------
-//
-
-#if !defined(journal_manip_templated_icc)
-#error This header file contains manipulator implementation details
-#else
-
-template <typename arg1_t>
-journal::manip_1<arg1_t>::manip_1(factory_t f, arg1_t arg1) :
- _f(f), _arg1(arg1)
-{}
-
-template <typename arg1_t>
-journal::Diagnostic & operator<< (
- journal::Diagnostic & s, journal::manip_1<arg1_t> m)
-{
- return (*m._f)(s, m._arg1);
-}
-
-template <typename arg1_t, typename arg2_t>
-journal::manip_2<arg1_t, arg2_t>::manip_2(
- factory_t f, arg1_t arg1, arg2_t arg2) :
- _f(f), _arg1(arg1), _arg2(arg2)
-{}
-
-template <typename arg1_t, typename arg2_t>
-journal::Diagnostic &
-operator<< (
- journal::Diagnostic & s, journal::manip_2<arg1_t, arg2_t> m)
-{
- return (*m._f)(s, m._arg1, m._arg2);
-}
-
-template <typename arg1_t, typename arg2_t, typename arg3_t>
-journal::manip_3<arg1_t, arg2_t, arg3_t>::manip_3(
- factory_t f, arg1_t arg1, arg2_t arg2, arg3_t arg3) :
- _f(f), _arg1(arg1), _arg2(arg2), _arg3(arg3)
-{}
-
-template <typename arg1_t, typename arg2_t, typename arg3_t>
-journal::Diagnostic & operator<<
-(journal::Diagnostic & s, journal::manip_3<arg1_t, arg2_t, arg3_t> m) {
- return (*m._f)(s, m._arg1, m._arg2, m._arg3);
-}
-
-#endif
-
-// version
-// $Id: manip-templated.icc,v 1.1.1.1 2005/03/08 16:13:56 aivazis Exp $
-
-// End of file
Modified: cs/pythia/trunk/journal/include/manipulators.h
===================================================================
--- cs/pythia/trunk/journal/include/manipulators.h 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/manipulators.h 2006-07-19 04:15:11 UTC (rev 4030)
@@ -25,26 +25,70 @@
namespace journal {
class Diagnostic;
- inline Diagnostic & endl(Diagnostic &);
- inline Diagnostic & newline(Diagnostic &);
+ // end of entry
+ Diagnostic & endl(Diagnostic & diag) {
+ diag.record();
+ return diag;
+ }
+
+ // add a newline
+ Diagnostic & newline(Diagnostic & diag) {
+ diag.newline();
+ return diag;
+ }
- inline set_t set(const char *, const char *);
- inline Diagnostic & __diagmanip_set(Diagnostic &, const char *, const char *);
+ // set metadata key to value
+ Diagnostic & __diagmanip_set(Diagnostic & s, const char * key, const char * value) {
+ s.attribute(key, value);
+ return s;
+ }
- inline loc2_t at(const char *, long);
- inline Diagnostic & __diagmanip_loc(Diagnostic &, const char *, long);
+ set_t set(const char * key, const char * value) {
+ return set_t(__diagmanip_set, key, value);
+ }
+
+ // location information
+ Diagnostic & __diagmanip_loc(Diagnostic & s, const char * filename, long line) {
+ s.attribute("filename", filename);
- inline loc3_t at(const char *, long, const char *);
- inline Diagnostic & __diagmanip_loc(Diagnostic &, const char *, long, const char *);
+ std::stringstream tmp;
+ tmp << line;
+
+ s.attribute("line", tmp.str());
+
+ return s;
+ }
+
+ loc2_t at(const char * file, long line) {
+ return loc2_t(__diagmanip_loc, file, line);
+ }
+
+ Diagnostic & __diagmanip_loc(
+ Diagnostic & s, const char * filename, long line, const char * function)
+ {
+ s.attribute("filename", filename);
+ s.attribute("function", function);
+
+ std::stringstream tmp;
+ tmp << line;
+
+ s.attribute("line", tmp.str());
+
+ return s;
+ }
+
+ loc3_t at(const char * file, long line, const char * function) {
+ return loc3_t(__diagmanip_loc, file, line, function);
+ }
+
}
-inline journal::Diagnostic &
-operator<< (journal::Diagnostic &, journal::Diagnostic & (*)(journal::Diagnostic &));
+journal::Diagnostic &
+operator<< (journal::Diagnostic & s, journal::Diagnostic & (m)(journal::Diagnostic &))
+{
+ return (*m)(s);
+}
-// get the inline definitions
-#define journal_manipulators_icc
-#include "manipulators.icc"
-#undef journal_manipulators_icc
#endif
Deleted: cs/pythia/trunk/journal/include/manipulators.icc
===================================================================
--- cs/pythia/trunk/journal/include/manipulators.icc 2006-07-19 03:07:41 UTC (rev 4029)
+++ cs/pythia/trunk/journal/include/manipulators.icc 2006-07-19 04:15:11 UTC (rev 4030)
@@ -1,90 +0,0 @@
-// -*- C++ -*-
-//
-//--------------------------------------------------------------------------------
-//
-// Michael A.G. Aivazis
-// California Institute of Technology
-// (C) 1998-2005 All Rights Reserved
-//
-// <LicenseText>
-//
-//--------------------------------------------------------------------------------
-//
-
-#if !defined(journal_manipulators_icc)
-#error This header file contains implementation details of the Diagnostic manipulators
-#else
-
-// inlines
-// manipulators without arguments
-journal::Diagnostic &
-operator<< (journal::Diagnostic & s, journal::Diagnostic & (m)(journal::Diagnostic &))
-{
- return (*m)(s);
-}
-
-// end of entry
-journal::Diagnostic & journal::endl(journal::Diagnostic & diag) {
- diag.record();
- return diag;
-}
-
-// add a newline
-journal::Diagnostic & journal::newline(journal::Diagnostic & diag) {
- diag.newline();
- return diag;
-}
-
-// set metadata key to value
-journal::Diagnostic &
-journal::__diagmanip_set(journal::Diagnostic & s, const char * key, const char * value) {
- s.attribute(key, value);
- return s;
-}
-
-journal::set_t journal::set(const char * key, const char * value) {
- return journal::set_t(journal::__diagmanip_set, key, value);
-}
-
-// location information
-journal::Diagnostic &
-journal::__diagmanip_loc(journal::Diagnostic & s, const char * filename, long line) {
- s.attribute("filename", filename);
-
- std::stringstream tmp;
- tmp << line;
-
- s.attribute("line", tmp.str());
-
- return s;
-}
-
-journal::loc2_t journal::at(const char * file, long line) {
- return journal::loc2_t(journal::__diagmanip_loc, file, line);
-}
-
-journal::Diagnostic &
-journal::__diagmanip_loc(
- journal::Diagnostic & s, const char * filename, long line, const char * function)
-{
- s.attribute("filename", filename);
- s.attribute("function", function);
-
- std::stringstream tmp;
- tmp << line;
-
- s.attribute("line", tmp.str());
-
- return s;
-}
-
-journal::loc3_t journal::at(const char * file, long line, const char * function) {
- return journal::loc3_t(journal::__diagmanip_loc, file, line, function);
-}
-
-#endif
-
-// version
-// $Id: manipulators.icc,v 1.1.1.1 2005/03/08 16:13:55 aivazis Exp $
-
-// End of file
More information about the cig-commits
mailing list