Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Dropped throw-specs, that being one of the things we always wanted to do for "MySQL++ 4.0". This obviates the porting of the MAY_THROW() stuff from MySQL++ 3.2.x. |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
bc21e10c05dea38963b618918d9693bc |
User & Date: | tangent 2018-10-28 11:08:57 |
Context
2018-10-28
| ||
11:53 | Forward-ported all of the differences between MySQL++ 3.2.1 (the point where libtabula originally forked off) and the current trunk version, which includes changes made after the release of MySQL++ 3.2.4. Leaf check-in: 6c22637ceb user: tangent tags: trunk | |
11:08 | Dropped throw-specs, that being one of the things we always wanted to do for "MySQL++ 4.0". This obviates the porting of the MAY_THROW() stuff from MySQL++ 3.2.x. check-in: bc21e10c05 user: tangent tags: trunk | |
10:47 | Updated the Doxyfile.in files for Doxygen 1.8.14. check-in: f3a0657c56 user: tangent tags: trunk | |
Changes
Changes to src/beemutex.cpp.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 .. 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 .. 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 ... 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 ... 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
/*********************************************************************** beemutex.cpp - Implements the BeecryptMutex class. The name comes from the fact that we lifted this essentially intact from the Beecrypt library, which is also LGPL. See beecrypt.h for the list of changes we made on integrating it into libtabula. Copyright © 2004 Beeyond Software Holding BV and © 2007 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. libtabula is free software; you can redistribute it and/or modify it ................................................................................ # if defined(LIBTABULA_PLATFORM_WINDOWS) static bc_mutex_t impl_val(void* p) { return *static_cast<bc_mutex_t*>(p); } # endif #endif BeecryptMutex::BeecryptMutex() throw (MutexFailed) #if defined(ACTUALLY_DOES_SOMETHING) : pmutex_(new bc_mutex_t) #endif { #if defined(LIBTABULA_PLATFORM_WINDOWS) *impl_ptr(pmutex_) = CreateMutex((LPSECURITY_ATTRIBUTES) 0, FALSE, (LPCTSTR) 0); ................................................................................ delete impl_ptr(pmutex_); #endif } void BeecryptMutex::lock() throw (MutexFailed) { #if defined(LIBTABULA_PLATFORM_WINDOWS) if (WaitForSingleObject(impl_val(pmutex_), INFINITE) == WAIT_OBJECT_0) return; throw MutexFailed("WaitForSingleObject failed"); #else # if HAVE_SYNCH_H || HAVE_PTHREAD ................................................................................ throw MutexFailed(strerror(rc)); # endif #endif } bool BeecryptMutex::trylock() throw (MutexFailed) { #if defined(ACTUALLY_DOES_SOMETHING) # if defined(LIBTABULA_PLATFORM_WINDOWS) switch (WaitForSingleObject(impl_val(pmutex_), 0)) { case WAIT_TIMEOUT: return false; case WAIT_OBJECT_0: ................................................................................ #else return true; // no-op build, so always succeed #endif } void BeecryptMutex::unlock() throw (MutexFailed) { #if defined(LIBTABULA_PLATFORM_WINDOWS) if (!ReleaseMutex(impl_val(pmutex_))) throw MutexFailed("ReleaseMutex failed"); #else # if HAVE_SYNCH_H || HAVE_PTHREAD register int rc; |
| | | | | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 .. 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 .. 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 ... 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 ... 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
/*********************************************************************** beemutex.cpp - Implements the BeecryptMutex class. The name comes from the fact that we lifted this essentially intact from the Beecrypt library, which is also LGPL. See beecrypt.h for the list of changes we made on integrating it into libtabula. Copyright © 2004 Beeyond Software Holding BV and © 2007, 2018 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. libtabula is free software; you can redistribute it and/or modify it ................................................................................ # if defined(LIBTABULA_PLATFORM_WINDOWS) static bc_mutex_t impl_val(void* p) { return *static_cast<bc_mutex_t*>(p); } # endif #endif BeecryptMutex::BeecryptMutex() #if defined(ACTUALLY_DOES_SOMETHING) : pmutex_(new bc_mutex_t) #endif { #if defined(LIBTABULA_PLATFORM_WINDOWS) *impl_ptr(pmutex_) = CreateMutex((LPSECURITY_ATTRIBUTES) 0, FALSE, (LPCTSTR) 0); ................................................................................ delete impl_ptr(pmutex_); #endif } void BeecryptMutex::lock() { #if defined(LIBTABULA_PLATFORM_WINDOWS) if (WaitForSingleObject(impl_val(pmutex_), INFINITE) == WAIT_OBJECT_0) return; throw MutexFailed("WaitForSingleObject failed"); #else # if HAVE_SYNCH_H || HAVE_PTHREAD ................................................................................ throw MutexFailed(strerror(rc)); # endif #endif } bool BeecryptMutex::trylock() { #if defined(ACTUALLY_DOES_SOMETHING) # if defined(LIBTABULA_PLATFORM_WINDOWS) switch (WaitForSingleObject(impl_val(pmutex_), 0)) { case WAIT_TIMEOUT: return false; case WAIT_OBJECT_0: ................................................................................ #else return true; // no-op build, so always succeed #endif } void BeecryptMutex::unlock() { #if defined(LIBTABULA_PLATFORM_WINDOWS) if (!ReleaseMutex(impl_val(pmutex_))) throw MutexFailed("ReleaseMutex failed"); #else # if HAVE_SYNCH_H || HAVE_PTHREAD register int rc; |
Changes to src/beemutex.h.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
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
|
/// a .cpp file so we don't have to make the header depend on config.h /// on autoconf-using systems /// - made private mutex member a void* so we don't have to define the /// full type in the .h file, due to previous item /// - added more Doxygen comments, and changed some existing comments /*********************************************************************** Copyright © 2004 Beeyond Software Holding BV and © 2007-2008 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. libtabula is free software; you can redistribute it and/or modify it ................................................................................ class LIBTABULA_EXPORT BeecryptMutex { public: /// \brief Create the mutex object /// /// Throws a MutexFailed exception if we can't acquire the lock for /// some reason. The exception contains a message saying why. BeecryptMutex() throw (MutexFailed); /// \brief Destroy the mutex /// /// Failures are quietly ignored. ~BeecryptMutex(); /// \brief Acquire the mutex, blocking if it can't be acquired /// immediately. void lock() throw (MutexFailed); /// \brief Acquire the mutex immediately and return true, or return /// false if it would have to block to acquire the mutex. bool trylock() throw (MutexFailed); /// \brief Release the mutex void unlock() throw (MutexFailed); private: void* pmutex_; }; /// \brief Wrapper around BeecryptMutex to add scope-bound locking |
|
|
|
|
|
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
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
|
/// a .cpp file so we don't have to make the header depend on config.h /// on autoconf-using systems /// - made private mutex member a void* so we don't have to define the /// full type in the .h file, due to previous item /// - added more Doxygen comments, and changed some existing comments /*********************************************************************** Copyright © 2004 Beeyond Software Holding BV and © 2007-2008, 2018 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. libtabula is free software; you can redistribute it and/or modify it ................................................................................ class LIBTABULA_EXPORT BeecryptMutex { public: /// \brief Create the mutex object /// /// Throws a MutexFailed exception if we can't acquire the lock for /// some reason. The exception contains a message saying why. BeecryptMutex(); /// \brief Destroy the mutex /// /// Failures are quietly ignored. ~BeecryptMutex(); /// \brief Acquire the mutex, blocking if it can't be acquired /// immediately. void lock(); /// \brief Acquire the mutex immediately and return true, or return /// false if it would have to block to acquire the mutex. bool trylock(); /// \brief Release the mutex void unlock(); private: void* pmutex_; }; /// \brief Wrapper around BeecryptMutex to add scope-bound locking |
Changes to src/common.h.
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
/// /// This file mostly takes care of platform differences. /*********************************************************************** Copyright © 1998 by Kevin Atkinson © 1999-2001 by MySQL AB © 2004-2009, 2015 by Educational Technology Resources, Inc. © 2009, 2014 by Warren Young Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. ................................................................................ // Make DLL stuff a no-op on this platform. #define LIBTABULA_EXPORT // Assume POSIX path separator #define LIBTABULA_PATH_SEPARATOR '/' #endif #if defined(LIBTABULA_MYSQL_HEADERS_BURIED) # include <mysql/mysql_version.h> #else # include <mysql_version.h> #endif namespace libtabula { /// \brief Alias for 'true', to make code requesting exceptions more /// readable. const bool use_exceptions = true; |
|
|
|
|
|
>
>
>
|
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
/// /// This file mostly takes care of platform differences. /*********************************************************************** Copyright © 1998 by Kevin Atkinson © 1999-2001 by MySQL AB © 2004-2009, 2015, 2018 by Educational Technology Resources, Inc. © 2009, 2014 by Warren Young Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. ................................................................................ // Make DLL stuff a no-op on this platform. #define LIBTABULA_EXPORT // Assume POSIX path separator #define LIBTABULA_PATH_SEPARATOR '/' #endif // C++11 added unique_ptr as a replacement for auto_ptr. We don't have // the ABI problem above with this one, so we switch to it with the // oldest release possible. As with the above ifdef, this one only // currently works for g++ and clang++. #if __cplusplus >= 201103L # define UNIQUE_PTR(what) std::unique_ptr<what> # define UNIQUE_PTR(what) std::auto_ptr<what> #endif namespace libtabula { /// \brief Alias for 'true', to make code requesting exceptions more /// readable. const bool use_exceptions = true; |
Changes to src/exceptions.h.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/// \brief Declares the libtabula-specific exception classes. /// /// When exceptions are enabled for a given libtabula::OptionalExceptions /// derivative, any of these exceptions can be thrown on error. /*********************************************************************** Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and © 2004-2010 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. libtabula is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published ................................................................................ /// \brief Base class for all libtabula custom exceptions class LIBTABULA_EXPORT Exception : public std::exception { public: /// \brief Create exception object as copy of another Exception(const Exception& e) throw() : std::exception(e), what_(e.what_) { } /// \brief Assign another exception object's contents to this one Exception& operator=(const Exception& rhs) throw() |
|
|
|
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/// \brief Declares the libtabula-specific exception classes. /// /// When exceptions are enabled for a given libtabula::OptionalExceptions /// derivative, any of these exceptions can be thrown on error. /*********************************************************************** Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and © 2004-2010, 2018 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. libtabula is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published ................................................................................ /// \brief Base class for all libtabula custom exceptions class LIBTABULA_EXPORT Exception : public std::exception { public: /// \brief Create exception object as copy of another Exception(const Exception& e) : std::exception(e), what_(e.what_) { } /// \brief Assign another exception object's contents to this one Exception& operator=(const Exception& rhs) throw() |
Changes to src/stadapter.cpp.
1
2
3
4
5
6
7
8
9
10
11
12
...
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
|
/*********************************************************************** stadapter.cpp - Implements the SQLTypeAdapter class. Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and © 2004-2009 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. libtabula is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published ................................................................................ { buffer_ = new SQLBuffer(null_str, typeid(void), true); is_processed_ = false; return *this; } char SQLTypeAdapter::at(size_type i) const throw(std::out_of_range) { if (buffer_) { if (i <= length()) { return *(buffer_->data() + i); } else { throw BadIndex("Not enough chars in SQLTypeAdapter", int(i), |
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
...
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
|
/*********************************************************************** stadapter.cpp - Implements the SQLTypeAdapter class. Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and © 2004-2009, 2018 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. libtabula is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published ................................................................................ { buffer_ = new SQLBuffer(null_str, typeid(void), true); is_processed_ = false; return *this; } char SQLTypeAdapter::at(size_type i) const { if (buffer_) { if (i <= length()) { return *(buffer_->data() + i); } else { throw BadIndex("Not enough chars in SQLTypeAdapter", int(i), |
Changes to src/stadapter.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
...
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
/// \file stadapter.h /// \brief Declares the SQLTypeAdapter class /*********************************************************************** Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and © 2004-2009 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. libtabula is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published ................................................................................ /// \brief Returns the character at a given position within the /// string buffer. /// /// \throw libtabula::BadIndex if the internal buffer is not /// initialized (default ctor called, and no subsequent assignment) /// or if there are not at least i + 1 characters in the buffer. /// /// WARNING: The throw-spec is incorrect, but it can't be changed /// until v4, where we can break the ABI. Throw-specs shouldn't be /// relied on anyway. char at(size_type i) const throw(std::out_of_range); /// \brief Compare the internal buffer to the given string /// /// Works just like string::compare(const std::string&). int compare(const SQLTypeAdapter& other) const; /// \brief Compare the internal buffer to the given string |
|
<
<
<
<
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
...
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
/// \file stadapter.h /// \brief Declares the SQLTypeAdapter class /*********************************************************************** Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and © 2004-2009, 2018 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS.md file in the top directory of the distribution for details. This file is part of libtabula. libtabula is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published ................................................................................ /// \brief Returns the character at a given position within the /// string buffer. /// /// \throw libtabula::BadIndex if the internal buffer is not /// initialized (default ctor called, and no subsequent assignment) /// or if there are not at least i + 1 characters in the buffer. char at(size_type i) const; /// \brief Compare the internal buffer to the given string /// /// Works just like string::compare(const std::string&). int compare(const SQLTypeAdapter& other) const; /// \brief Compare the internal buffer to the given string |