diff --git a/makefile.am b/makefile.am
index 841ec5a..8e9af59 100644
--- a/makefile.am
+++ b/makefile.am
@@ -8,79 +8,6 @@
## @copy © Marc Wäckerlin
## @license LGPL, see file COPYING
##
-## $Log$
-## Revision 1.24 2005/04/10 15:00:13 marc
-## improved targets for makefile
-##
-## Revision 1.23 2005/04/07 21:01:46 marc
-## reordering of dependencies (i.e. make release)
-## documentation is now generated in root dir, no more in mrw subdir
-##
-## Revision 1.22 2005/03/11 23:28:30 marc
-## - new multithreaded package
-## - new log4cxx package
-##
-## Revision 1.21 2005/02/28 08:11:46 marc
-## stack trace and dynamic library are conditional
-##
-## Revision 1.20 2005/02/28 07:54:57 marc
-## added functiontrace
-##
-## Revision 1.19 2005/02/21 16:33:41 marc
-## source rpm: no "-devel"!
-##
-## Revision 1.18 2005/02/18 16:19:13 marc
-## Also build source RPM
-## No more install RPMs after build
-## Added dynamiclibrary.hpp
-##
-## Revision 1.17 2005/02/08 12:34:14 marc
-## added errno / unix_error
-##
-## Revision 1.16 2005/01/07 00:37:10 marc
-## config file handler and file
-##
-## Revision 1.15 2004/12/17 16:30:06 marc
-## added tokenizer
-##
-## Revision 1.14 2004/12/14 20:22:42 marc
-## added regexp
-##
-## Revision 1.13 2004/10/11 18:33:53 marc
-## add stdext.hpp
-##
-## Revision 1.12 2004/10/07 17:25:40 marc
-## make rpm also installs the new rpm (to check whether this is possible)
-##
-## Revision 1.11 2004/10/07 16:12:52 marc
-## a backslash too much
-##
-## Revision 1.10 2004/10/07 16:01:03 marc
-## new headers missing in installation
-##
-## Revision 1.9 2004/10/07 13:41:16 marc
-## devel in the same spec file
-##
-## Revision 1.8 2004/09/09 20:09:06 marc
-## library versioning now works how i want it
-##
-## Revision 1.7 2004/08/31 16:22:29 marc
-## webserver now depends on tag and rpm
-## added .PHONY
-##
-## Revision 1.6 2004/08/28 16:21:07 marc
-## mrw-c++-0.92 (mrw)
-## - new file: version.cpp
-## - new file header for all sources
-## - work around warning in mrw::auto
-## - possibility to compile without log4cxx
-## - work around bugs in demangle.h and libiberty.h
-## - corrections in documentation
-## - added simple tracing mechanism
-## - more warnings
-## - small corrections in Auto<>::Free and a new test for it
-## - possibility to compile without stack trace
-##
SUBDIRS = mrw
diff --git a/mrw/arg.hpp b/mrw/arg.hpp
index ae2c0b8..91223d2 100644
--- a/mrw/arg.hpp
+++ b/mrw/arg.hpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.7 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.6 2005/02/08 12:31:36 marc
new static methods to simplify access to options
@@ -130,7 +133,7 @@ namespace mrw {
/** @brief List of additional (mandatory) parameter to one command
line argument.
- @pre #include
+ @pre \#include
A new mandatory parameter is added to the list of parameter, by
shifting the default value into the instance of @c
@@ -207,7 +210,7 @@ namespace mrw {
public:
/** @brief Abstract base class to represent one single parameter value.
- @pre #include
+ @pre \#include
*/
class Value {
@@ -372,7 +375,7 @@ namespace mrw {
};
/** @brief this class represents one command line option
- @pre #include
+ @pre \#include
The library user needs this class when setting up the list of
supported command line ooptions: Simply shift one instance of @c
@@ -469,7 +472,7 @@ namespace mrw {
};
/** @brief handle command line arguments
- @pre #include
+ @pre \#include
This class handles command line arguments. It is a
singleton. Get the one and only instance of this class with @c
diff --git a/mrw/auto.hpp b/mrw/auto.hpp
index 6bb89b2..eff4660 100644
--- a/mrw/auto.hpp
+++ b/mrw/auto.hpp
@@ -8,32 +8,6 @@
@copy © Marc Wäckerlin
@license LGPL, see file COPYING
- $Log$
- Revision 1.7 2004/12/20 07:40:35 marc
- documentation improved, new grouping
-
- Revision 1.6 2004/10/11 16:48:29 marc
- better comment and operators -> and * for AutoPtr
-
- Revision 1.5 2004/10/11 16:05:02 marc
- new AutoPtr
-
- Revision 1.4 2004/10/07 09:24:08 marc
- enhance windoze compatibility
-
- Revision 1.3 2004/08/28 16:21:25 marc
- mrw-c++-0.92 (mrw)
- - new file: version.cpp
- - new file header for all sources
- - work around warning in mrw::auto
- - possibility to compile without log4cxx
- - work around bugs in demangle.h and libiberty.h
- - corrections in documentation
- - added simple tracing mechanism
- - more warnings
- - small corrections in Auto<>::Free and a new test for it
- - possibility to compile without stack trace
-
*/
#ifndef __MRW_AUTO_HPP__
#define __MRW_AUTO_HPP__
@@ -89,7 +63,7 @@ namespace mrw {
//@{
/** @brief Automatically frees a resource when destructed.
- @pre #include
+ @pre \#include
AutoResource works exactly like std::auto_ptr, but for any
resource instead of new allocated pointers. Whenever the context
@@ -135,6 +109,17 @@ namespace mrw {
AutoResource(AutoResource& o) throw(std::bad_exception):
_res(o.release()) {
}
+ //! @brief Do not use this method!
+ //! This method had to be introduced for the @c std::map, where
+ //! @c operator[] first creates an empty element, then assigns it
+ //! the real value. Because that empty element is temporary, gcc can
+ //! not use @c AutoResource(AutoResource&) since release 4.0.
+ AutoResource(const AutoResource& o) throw(std::bad_exception):
+ _res(INITIAL_VALUE) {
+ assert(o._res==INITIAL_VALUE);
+ if (o._res!=INITIAL_VALUE)
+ _res = const_cast(o).release();
+ }
/// @brief Free resource. Calls @c reset().
~AutoResource() throw(std::bad_exception) {reset();}
/// @brief Assign new resource. Calls @c reset().
@@ -183,7 +168,7 @@ namespace mrw {
};
/** @brief Automatically deletes a pointer when destructed.
- @pre #include
+ @pre \#include
mrw::AutoPtr is a replacement for std::auto_ptr. The problem with
standard std::auto_ptr is, that it cannot be stored in a std::map.
@@ -208,6 +193,16 @@ namespace mrw {
AutoPtr(AutoPtr& o) throw(std::bad_exception):
_res(o.release()) {
}
+ //! @brief Do not use this method!
+ //! This method had to be introduced for the @c std::map, where
+ //! @c operator[] first creates an empty element, then assigns it
+ //! the real value. Because that empty element is temporary, gcc can
+ //! not use @c AutoResource(AutoResource&) since release 4.0.
+ AutoPtr(const AutoPtr& o) throw(std::bad_exception): _res(0) {
+ assert(o._res==0);
+ if (o._res!=0)
+ _res = const_cast(o).release();
+ }
/// @brief Free resource. Calls @c reset().
~AutoPtr() throw(std::bad_exception) {reset();}
/// @brief Assign new resource. Calls @c reset().
@@ -260,7 +255,7 @@ namespace mrw {
};
/** @brief Automatically closes a file when destructed.
- @pre #include
+ @pre \#include
AutoFile works exactly like std::auto_ptr, but for files
instead of pointers. Whenever the context of AutoFile is left,
@@ -297,7 +292,7 @@ namespace mrw {
::munmap((char*)res.first, res.second); // char* conversion for windoze cygwin compatibility
}
/** @brief Automatically calls @c munmap on destruction for mmaped files.
- @pre #include
+ @pre \#include
It's the same as std::auto_ptr, but for @c mmap instead of @c
new. When the context of @c AutoMapper is left, @c munmap is
@@ -307,7 +302,7 @@ namespace mrw {
AutoMapper;
/** @brief Automatically calls @c bfd_close for @c bfd*.
- @pre #include
+ @pre \#include
It acts like a @c std::auto_ptr, but for @c bfd*, that means it
calls @c bfd_close whenever the context is left.
@@ -316,7 +311,7 @@ namespace mrw {
/** @brief Automatically calls @c free for @c malloc allocated memory.
Instanciate it as @c mrw::Auto::Free.
- @pre #include
+ @pre \#include
It works like a @c std::auto_ptr, but for memory that was
allocated with @c malloc, not @c new. Memory is freed, whenever
diff --git a/mrw/autofunctiontracelog4cxx.cpp b/mrw/autofunctiontracelog4cxx.cpp
index e47aa39..db5568f 100644
--- a/mrw/autofunctiontracelog4cxx.cpp
+++ b/mrw/autofunctiontracelog4cxx.cpp
@@ -8,17 +8,6 @@
@copy © Marc Wäckerlin
@license LGPL, see file COPYING
- $Log$
- Revision 1.3 2005/04/14 19:12:18 marc
- better formatting for operators
-
- Revision 1.2 2005/04/07 20:42:38 marc
- renamed loggerhierarchy from mrw.gccfunctiontrace to mrw.fn
-
- Revision 1.1 2005/03/11 21:07:54 marc
- initial version
-
-
1 2 3 4 5 6 7 8
5678901234567890123456789012345678901234567890123456789012345678901234567890
*/
@@ -34,6 +23,10 @@
#include
#include
+#if (__GNUC__==3 && __GNUC_MINOR__<4 || __GNUC__<3) && _REENTRANT && !_MT
+#define _MT
+#endif
+
// these are special built in functions of GNU Compiler Collection
extern "C" void __cyg_profile_func_enter (void *, void *) __attribute__((no_instrument_function));
extern "C" void __cyg_profile_func_exit (void *, void *) __attribute__((no_instrument_function));
@@ -45,7 +38,7 @@ namespace mrw {
bool recurse;
};
-#ifdef _REENTRANT
+#ifdef _MT
static __thread ThreadInfo info = {0, false};
#else
static ThreadInfo info = {0, false};
@@ -58,13 +51,17 @@ namespace mrw {
Lock() __attribute__((no_instrument_function));
~Lock() __attribute__((no_instrument_function));
};
+ // workaround doxygen problem:
+ // - the C++ compiler compiles the following code
+ // - doxygen ignores it
+#ifndef LET_DOXYGEN_IGNORE_THIS // doxygen can't match with __attribute__ above
Lock::Lock() {
info.recurse = true;
}
Lock::~Lock() {
info.recurse = false;
}
-
+#endif
}
extern "C" int main(int, char**);
@@ -169,7 +166,7 @@ extern "C" void __cyg_profile_func_enter(void *this_fn, void*) {
{
static bool init(mrw::StackTrace::createSymtable());
if (!init) return;
- mrw::StackTrace::CodePos pos(mrw::StackTrace::translate(this_fn));
+ const mrw::StackTrace::CodePos& pos(mrw::StackTrace::translate(this_fn));
std::string hierarchy(pos.function);
for (std::string::size_type p(0);
(p=hierarchy.find("::", p))!=std::string::npos;
@@ -182,7 +179,7 @@ extern "C" void __cyg_profile_func_enter(void *this_fn, void*) {
log4cxx::Logger* logger
(log4cxx::Logger::getLogger(_T("mrw.fn.")+hierarchy));
if (logger->isDebugEnabled()) {
- std::stringstream ss;
+ std::ostringstream ss;
ss<forcedLog(::log4cxx::Level::DEBUG, ss.str(),
@@ -204,7 +201,7 @@ extern "C" void __cyg_profile_func_exit(void *this_fn, void*) {
if (mrw::info.recurse || mrw::info.level==0) return;
mrw::Lock lock;
{
- mrw::StackTrace::CodePos pos(mrw::StackTrace::translate(this_fn));
+ const mrw::StackTrace::CodePos& pos(mrw::StackTrace::translate(this_fn));
std::string hierarchy(pos.function);
for (std::string::size_type p(0);
(p=hierarchy.find("::", p))!=std::string::npos;
@@ -217,7 +214,7 @@ extern "C" void __cyg_profile_func_exit(void *this_fn, void*) {
log4cxx::Logger* logger
(log4cxx::Logger::getLogger(_T("mrw.fn.")+hierarchy));
if (logger->isDebugEnabled()) {
- std::stringstream ss;
+ std::ostringstream ss;
ss<forcedLog(::log4cxx::Level::DEBUG, ss.str(),
diff --git a/mrw/autostacktracelog4cxx.cpp b/mrw/autostacktracelog4cxx.cpp
index 2e89a4e..916f281 100644
--- a/mrw/autostacktracelog4cxx.cpp
+++ b/mrw/autostacktracelog4cxx.cpp
@@ -8,41 +8,16 @@
@copy © Marc Wäckerlin
@license LGPL, see file COPYING
- $Log$
- Revision 1.7 2005/04/07 20:43:50 marc
- docu corrected, new doxygen
-
- Revision 1.6 2005/02/25 16:18:15 marc
- now naming for the logger: "mrw.stacktrace" instead of simply "libmrw"
-
- Revision 1.5 2005/01/28 12:13:11 marc
- interference between group name StackTrace and class name StackTrace
-
- Revision 1.4 2005/01/28 12:13:11 marc
- interference between group name StackTrace and class name StackTrace
-
- Revision 1.3 2005/01/28 07:42:23 marc
- added terminate handler (uncaught handler)
-
- Revision 1.2 2004/08/28 16:21:25 marc
- mrw-c++-0.92 (mrw)
- - new file: version.cpp
- - new file header for all sources
- - work around warning in mrw::auto
- - possibility to compile without log4cxx
- - work around bugs in demangle.h and libiberty.h
- - corrections in documentation
- - added simple tracing mechanism
- - more warnings
- - small corrections in Auto<>::Free and a new test for it
- - possibility to compile without stack trace
-
*/
#include
#include
#include
#include
+#ifndef _T
+#define _T
+#endif
+
namespace mrw {
/** @addtogroup AutoTrace
diff --git a/mrw/autostacktracestderr.cpp b/mrw/autostacktracestderr.cpp
index 2ffdbd6..c41bcff 100644
--- a/mrw/autostacktracestderr.cpp
+++ b/mrw/autostacktracestderr.cpp
@@ -8,32 +8,6 @@
@copy © Marc Wäckerlin
@license LGPL, see file COPYING
- $Log$
- Revision 1.7 2005/01/28 12:13:11 marc
- interference between group name StackTrace and class name StackTrace
-
- Revision 1.6 2005/01/28 12:13:11 marc
- interference between group name StackTrace and class name StackTrace
-
- Revision 1.5 2005/01/28 07:42:23 marc
- added terminate handler (uncaught handler)
-
- Revision 1.4 2004/10/13 10:41:28 marc
- no newline at the end of stack trace
-
- Revision 1.3 2004/08/28 16:21:25 marc
- mrw-c++-0.92 (mrw)
- - new file: version.cpp
- - new file header for all sources
- - work around warning in mrw::auto
- - possibility to compile without log4cxx
- - work around bugs in demangle.h and libiberty.h
- - corrections in documentation
- - added simple tracing mechanism
- - more warnings
- - small corrections in Auto<>::Free and a new test for it
- - possibility to compile without stack trace
-
*/
#include
#include
diff --git a/mrw/configfile.cpp b/mrw/configfile.cpp
index 0be203f..794b3ff 100644
--- a/mrw/configfile.cpp
+++ b/mrw/configfile.cpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.3 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.2 2005/01/28 07:49:32 marc
Save configuration using file.hpp
@@ -129,7 +132,12 @@ mrw::ConfigFileReader&
mrw::ConfigFileWriter&
#endif
mrw::ConfigFileWriter::reload() throw(std::exception) {
+#if __GNUC__ == 3 && __GNUC_MINOR__ < 4
return parse(_file=mrw::File::read(_filename));
+#else
+ return dynamic_cast
+ (parse(_file=mrw::File::read(_filename)));
+#endif
}
mrw::ConfigFileWriter& mrw::ConfigFileWriter::save() throw(std::exception) {
diff --git a/mrw/configfile.hpp b/mrw/configfile.hpp
index 9d75740..535389a 100644
--- a/mrw/configfile.hpp
+++ b/mrw/configfile.hpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.3 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.2 2005/01/28 07:49:32 marc
Save configuration using file.hpp
@@ -27,7 +30,7 @@ namespace mrw {
/** @defgroup config Configuration File Handler
- @pre #include
+ @pre \#include
Read configuration parameters from a file.
diff --git a/mrw/deque.hpp b/mrw/deque.hpp
index 0f71c7c..0d30ffd 100644
--- a/mrw/deque.hpp
+++ b/mrw/deque.hpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.4 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.3 2005/04/07 20:48:20 marc
docu: new doxygen, new grouping
@@ -43,7 +46,7 @@
@param l a deque of values
@param o a value to be inserted into deque @c l
- @pre #include
+ @pre \#include
*/
template
std::deque& operator<<(std::deque& l, const T& o) throw(std::bad_exception) {
@@ -67,7 +70,7 @@ std::deque& operator<<(std::deque& l, const T& o) throw(std::bad_exc
@note when something is extracted from a deque, it is removed
from the deque, that means after every shift the deque is
shortened by the shifted element
- @pre #include
+ @pre \#include
*/
template
std::deque& operator>>(std::deque& l, T& o) throw(std::exception) {
diff --git a/mrw/doxyfile.in b/mrw/doxyfile.in
index 0c43fd9..fe2847b 100644
--- a/mrw/doxyfile.in
+++ b/mrw/doxyfile.in
@@ -9,6 +9,9 @@
## @license LGPL, see file COPYING
##
## $Log$
+## Revision 1.16 2005/11/29 12:39:42 marc
+## make it compilable with gcc 4.0.2 and newer doxygen
+##
## Revision 1.15 2005/04/07 20:55:21 marc
## Oops, there's a make distcheck...? Now it works.
##
@@ -898,7 +901,7 @@ MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# in the INCLUDE_PATH (see below) will be search if a \#include is found.
SEARCH_INCLUDES = YES
@@ -921,7 +924,7 @@ INCLUDE_FILE_PATTERNS =
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.
-PREDEFINED = HAVE_STACKTRACE
+PREDEFINED = HAVE_STACKTRACE LET_DOXYGEN_IGNORE_THIS
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
diff --git a/mrw/dynamiclibrary.hpp b/mrw/dynamiclibrary.hpp
index ad45fc1..a288796 100644
--- a/mrw/dynamiclibrary.hpp
+++ b/mrw/dynamiclibrary.hpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.3 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.2 2005/02/21 16:16:47 marc
finished and documented
@@ -48,7 +51,7 @@ namespace mrw {
}
@endcode
- @pre #include
+ @pre \#include
@pre Files that use this wrapper must be linked with libltdl,
with GNU g++ on UNIX, this is link option: @c -lltdl
diff --git a/mrw/errno.hpp b/mrw/errno.hpp
index c807def..12ab30e 100644
--- a/mrw/errno.hpp
+++ b/mrw/errno.hpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.3 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.2 2005/02/18 15:53:07 marc
I'm so stupid, there's strerror for mapping errno to a string...
@@ -40,7 +43,7 @@ namespace mrw {
/** @brief Stores a UNIX errno error number and converts it to string.
- @pre #include */
+ @pre \#include */
class Errno {
//................................................................ methods
@@ -74,7 +77,7 @@ namespace mrw {
/** @brief to be thrown when a unix system call fails, evaluates @c errno
- @pre #include */
+ @pre \#include */
class unix_error: public mrw::runtime_error {
diff --git a/mrw/exception.hpp b/mrw/exception.hpp
index ec46db7..2ddc2d3 100644
--- a/mrw/exception.hpp
+++ b/mrw/exception.hpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.12 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.11 2005/03/14 16:25:23 marc
changed size of dot image so that it fits an A4
@@ -236,7 +239,7 @@ call of fn0 successful
//@{
/** @brief replacement for @c std::exception, that collects a stack trace
- @pre #include
+ @pre \#include
This exception class behaves exactely like @c std::exception,
but it collects a stack trace in the constructor and offers a
diff --git a/mrw/exec.cpp b/mrw/exec.cpp
index 2ac7dff..652bcae 100644
--- a/mrw/exec.cpp
+++ b/mrw/exec.cpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.14 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.13 2005/04/20 18:32:14 marc
*** empty log message ***
@@ -385,7 +388,7 @@ mrw::PartialExec::PartialExec(const mrw::PartialExec& e)
_input(e._input),
_num0(e._num0), _num1(e._num1), _num2(e._num2),
_lastPid(e._lastPid), _pid(e._pid) {
- /// @warning @c const is casted away
+ /** @warning @c const is casted away */
mrw::PartialExec& nonConstE(const_cast(e));
_stdIn = nonConstE._stdIn;
_stdOut = nonConstE._stdOut;
diff --git a/mrw/exec.hpp b/mrw/exec.hpp
index 75db4aa..4e1d3b0 100644
--- a/mrw/exec.hpp
+++ b/mrw/exec.hpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.8 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.7 2005/04/20 18:12:55 marc
added kill() for PartialExec
@@ -95,7 +98,7 @@ namespace mrw {
//============================================================================
/** @brief Exception: Execution of command failed.
- @pre #include
+ @pre \#include
This exception is thrown, if the exection of a command in
mrw::Exec is failed. That means, it was not possible to fork or
@@ -115,7 +118,7 @@ namespace mrw {
//============================================================================
/** @brief Execute a command in a new process.
- @pre #include
+ @pre \#include
This class handles the execution of a command in a new process
and returns the two streams @c cout and @c cerr, also known as @c
@@ -280,7 +283,7 @@ namespace mrw {
//============================================================================
/** @brief Execute a UNIX program in non blocking parts.
- @pre #include
+ @pre \#include
A given UNIX command is executed, but the class does not wait
until it is finished, instead it gives back the control to the
@@ -437,7 +440,7 @@ while (!exec.finished()) res+=exec.read().first;
//============================================================================
/** @brief A system command to be executed
- @pre #include
+ @pre \#include
This class is used in conjunction with mrw::Exec. It must be
initialized with the command name, then the command parameters
diff --git a/mrw/functiontrace.hpp b/mrw/functiontrace.hpp
index a145bda..dac9cd7 100644
--- a/mrw/functiontrace.hpp
+++ b/mrw/functiontrace.hpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.3 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.2 2005/04/07 20:50:13 marc
docu: new doxygen, new grouping
@@ -28,13 +31,22 @@
#include
#include
+// support for log4cxx 0.9.7 and for new CVS version
+#ifndef LOG4CXX_LOCATION
+# define MRW_LOG4CXX_LOCATION _file.c_str(), _line
+#else
+# define LOG4CXX_CVS
+# define MRW_LOG4CXX_LOCATION \
+ ::log4cxx::spi::LocationInfo(_name.c_str(), _file.c_str(), _line)
+#endif
+
namespace mrw {
/** @addtogroup debug */
//@{
/** @defgroup FunctionTrace Function Tracing (using log4cxx)
- @pre #include
+ @pre \#include
Place the macro @ref METHOD as first line of all methods you want to
trace, and macro @ref FUNCTION as first line of all functions to be
@@ -56,8 +68,8 @@ namespace mrw {
The trace of the following code:
@code
- #include
- #include
+ \#include
+ \#include
void fn(int i=0) {
FUNCTION("fn(int)"); // trace entry and exit
if (i<4) fn(++i);
@@ -234,7 +246,7 @@ namespace mrw {
oss<forcedLog(log4cxx::Level::DEBUG, oss.str(),
- _file.c_str(), _line);
+ MRW_LOG4CXX_LOCATION);
++_level;
}
}
@@ -248,7 +260,7 @@ namespace mrw {
oss<forcedLog(log4cxx::Level::DEBUG, oss.str(),
- _file.c_str(), _line);
+ MRW_LOG4CXX_LOCATION);
++_level;
}
}
@@ -263,7 +275,7 @@ namespace mrw {
oss<forcedLog(log4cxx::Level::DEBUG, oss.str(),
- _file.c_str(), _line);
+ MRW_LOG4CXX_LOCATION);
}
}
private:
diff --git a/mrw/list.hpp b/mrw/list.hpp
index c4ed330..cf8f6ea 100644
--- a/mrw/list.hpp
+++ b/mrw/list.hpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.4 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.3 2005/04/07 20:48:20 marc
docu: new doxygen, new grouping
@@ -62,14 +65,39 @@
@param l a list of values
@param o a value to be inserted into list @c l
- @pre #include
+ @pre \#include
*/
+// template
+// std::list& operator<<(std::list& l, const FROM& o)
+// throw(std::bad_exception) {
+// l.push_back(T(o));
+// return l;
+// }
template
-std::list& operator<<(std::list& l, const T& o) throw(std::bad_exception) {
+ std::list& operator<<(std::list& l, const T& o)
+ throw(std::bad_exception) {
l.push_back(o);
return l;
}
+/* @brief push a char* to a list of string
+
+ @code
+ std::list test;
+ test<<"Hello"<<"World";
+ @endcode
+
+ @param l a list of string values (that can be constructed from char*)
+ @param o a value to be inserted into list @c l
+ @pre \#include */
+template
+ std::list& operator<<(std::list& l,
+ const char *const o)
+ throw(std::bad_exception) {
+ l.push_back(T(o));
+ return l;
+}
+
/** @brief extract the first value of a list
@code
@@ -86,7 +114,7 @@ std::list& operator<<(std::list& l, const T& o) throw(std::bad_excep
@note when something is extracted from a list, it is removed
from the list, that means after every shift the list is
shortened by the shifted element
- @pre #include
+ @pre \#include
*/
template
std::list& operator>>(std::list& l, T& o) throw(std::exception) {
@@ -100,7 +128,6 @@ std::list& operator>>(std::list& l, T& o) throw(std::exception) {
return l;
}
-//@}
//@}
//@}
diff --git a/mrw/log4cxxconfiguration.cpp b/mrw/log4cxxconfiguration.cpp
index 3685cfc..8dcd8a2 100644
--- a/mrw/log4cxxconfiguration.cpp
+++ b/mrw/log4cxxconfiguration.cpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.3 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.2 2005/04/14 19:06:37 marc
no more duplicated traces, better filtering for Qt
@@ -24,6 +27,10 @@
#include
#include
+#if (__GNUC__==3 && __GNUC_MINOR__<4 || __GNUC__<3) && _REENTRANT && !_MT
+#define _MT
+#endif
+
namespace mrw {
/** @addtogroup debug
@@ -153,7 +160,7 @@ log4j.appender.A1.layout.ConversionPattern = 60c%m%n
"org.apache.log4j.ConsoleAppender");
properties.setProperty("log4j.appender.A1.layout",
"org.apache.log4j.PatternLayout");
-#ifdef _REENTRANT
+#ifdef _MT
properties.setProperty("log4j.appender.A1.layout.ConversionPattern",
"%t-%-60c%m%n");
#else
@@ -167,4 +174,4 @@ log4j.appender.A1.layout.ConversionPattern = 60c%m%n
//@}
//@}
-};
+}
diff --git a/mrw/map.hpp b/mrw/map.hpp
index c023937..a1f6f95 100644
--- a/mrw/map.hpp
+++ b/mrw/map.hpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.4 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.3 2005/04/07 20:48:20 marc
docu: new doxygen, new grouping
@@ -45,7 +48,7 @@
@throw mrw::invalid_argument, if element is already in map
@param l a map of values
@param o a value to be inserted into map @c l
- @pre #include
+ @pre \#include
*/
template
std::map& operator<<(std::map& l, const std::pair& o)
@@ -75,7 +78,7 @@ std::map& operator<<(std::map& l, const std::pair&
@note when something is extracted from a map, it is removed
from the map, that means after every shift the map is
shortened by the shifted element
- @pre #include
+ @pre \#include
*/
template
std::map& operator>>(std::map& l, std::pair& o)
diff --git a/mrw/mrw.hpp.in b/mrw/mrw.hpp.in
index fa29f3c..25c48fb 100644
--- a/mrw/mrw.hpp.in
+++ b/mrw/mrw.hpp.in
@@ -104,7 +104,7 @@
Include the headers you need with prefix @c mrw, e.g.:
@verbatim
- #include
+ \#include
@endverbatim
All classes are in the @c mrw namespace.
@@ -132,9 +132,19 @@
/** @page threads Thread Safety
+ There is a severe bug in the g++ compiler with version
+ >= 3.4: The macro @c _REENTRANT is always set and cannot be
+ used to check whether we are in a multithreaded compilation or
+ not! See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11953 for
+ more details. Workaround: To enable multithreading, you must pass
+ the @c -D_MT compiler flag for the GNU gcc verions 3.4 and above!
+
To enable thread safety, you must link to @c libmrw-mt instead of
@c libmrw. That means, your link option is: @c -lmrw-mt
+ For GNU gcc verions 3.4 and above, you must use the compile option
+ @c -D_MT in addition, because of a severe bug in the compiler.
+
Different instances of classes can run in different threads, but
instances of classes can not be shared between different threads.
diff --git a/mrw/mrwautofunctiontracelog4cxx_test.cpp b/mrw/mrwautofunctiontracelog4cxx_test.cpp
index fbb3bf2..73fb463 100644
--- a/mrw/mrwautofunctiontracelog4cxx_test.cpp
+++ b/mrw/mrwautofunctiontracelog4cxx_test.cpp
@@ -9,6 +9,9 @@
@license LGPL, see file COPYING
$Log$
+ Revision 1.3 2005/11/29 12:39:42 marc
+ make it compilable with gcc 4.0.2 and newer doxygen
+
Revision 1.2 2005/04/07 20:42:38 marc
renamed loggerhierarchy from mrw.gccfunctiontrace to mrw.fn
@@ -32,6 +35,10 @@
#include
#include