[glom] C++11: Replace throw() with noexcept.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] C++11: Replace throw() with noexcept.
- Date: Sun, 19 Jul 2015 20:59:45 +0000 (UTC)
commit c9ecbfd54a3ec419b5fa3cb54382fd4f2ad3cc56
Author: Murray Cumming <murrayc murrayc com>
Date: Sun Jul 19 21:34:38 2015 +0200
C++11: Replace throw() with noexcept.
glom/libglom/connectionpool.cc | 10 +++++-----
glom/libglom/connectionpool.h | 8 ++++----
glom/libglom/connectionpool_backends/backend.cc | 4 ++--
glom/libglom/connectionpool_backends/backend.h | 6 +++---
glom/libglom/connectionpool_backends/mysql.cc | 2 +-
glom/libglom/connectionpool_backends/mysql.h | 2 +-
glom/libglom/connectionpool_backends/postgres.cc | 2 +-
glom/libglom/connectionpool_backends/postgres.h | 2 +-
glom/libglom/connectionpool_backends/sqlite.cc | 4 ++--
glom/libglom/connectionpool_backends/sqlite.h | 4 ++--
10 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index 30f61c4..085df51 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -713,8 +713,8 @@ bool ConnectionPool::connect_nothrow()
return (m_refGdaConnection != 0);
}
-//TODO: Why do we use throw() here and on change_columns()?
-bool ConnectionPool::add_column(const Glib::ustring& table_name, const std::shared_ptr<const Field>& field)
throw()
+//TODO: Why do we use noexcept here and on change_columns()?
+bool ConnectionPool::add_column(const Glib::ustring& table_name, const std::shared_ptr<const Field>& field)
noexcept
{
if(!connect_nothrow())
return false;
@@ -733,7 +733,7 @@ bool ConnectionPool::add_column(const Glib::ustring& table_name, const std::shar
return false;
}
-bool ConnectionPool::drop_column(const Glib::ustring& table_name, const Glib::ustring& field_name) throw()
+bool ConnectionPool::drop_column(const Glib::ustring& table_name, const Glib::ustring& field_name) noexcept
{
if(!connect_nothrow())
return false;
@@ -752,7 +752,7 @@ bool ConnectionPool::drop_column(const Glib::ustring& table_name, const Glib::us
return false;
}
-bool ConnectionPool::change_column(const Glib::ustring& table_name, const std::shared_ptr<const Field>&
field_old, const std::shared_ptr<const Field>& field) throw()
+bool ConnectionPool::change_column(const Glib::ustring& table_name, const std::shared_ptr<const Field>&
field_old, const std::shared_ptr<const Field>& field) noexcept
{
type_vec_const_fields old_fields(1, field_old);
type_vec_const_fields new_fields(1, field);
@@ -760,7 +760,7 @@ bool ConnectionPool::change_column(const Glib::ustring& table_name, const std::s
return change_columns(table_name, old_fields, new_fields);
}
-bool ConnectionPool::change_columns(const Glib::ustring& table_name, const type_vec_const_fields&
old_fields, const type_vec_const_fields& new_fields) throw()
+bool ConnectionPool::change_columns(const Glib::ustring& table_name, const type_vec_const_fields&
old_fields, const type_vec_const_fields& new_fields) noexcept
{
if(!connect_nothrow())
return false;
diff --git a/glom/libglom/connectionpool.h b/glom/libglom/connectionpool.h
index 1693c08..73f78af 100644
--- a/glom/libglom/connectionpool.h
+++ b/glom/libglom/connectionpool.h
@@ -252,7 +252,7 @@ public:
* @param table_name The parent table of the fields to be changed.
* @param field The field to be added.
*/
- bool add_column(const Glib::ustring& table_name, const std::shared_ptr<const Field>& field) throw();
+ bool add_column(const Glib::ustring& table_name, const std::shared_ptr<const Field>& field) noexcept;
/** Remove a field from the database.
* The caller should then update the document's list of fields,
@@ -261,7 +261,7 @@ public:
* @param table_name The parent table of the fields to be changed.
* @param field_name The name of the field to be removed.
*/
- bool drop_column(const Glib::ustring& table_name, const Glib::ustring& field_name) throw();
+ bool drop_column(const Glib::ustring& table_name, const Glib::ustring& field_name) noexcept;
/** Change some detail about a field in the database.
* The caller should then update the document's list of fields,
@@ -271,7 +271,7 @@ public:
* @param field_old The old field information.
* @param field The new field information.
*/
- bool change_column(const Glib::ustring& table_name, const std::shared_ptr<const Field>& field_old, const
std::shared_ptr<const Field>& field) throw();
+ bool change_column(const Glib::ustring& table_name, const std::shared_ptr<const Field>& field_old, const
std::shared_ptr<const Field>& field) noexcept;
/** Change some detail about some fields in the database.
* The caller should then update the document's list of fields,
@@ -281,7 +281,7 @@ public:
* @param old_fields The old field information.
* @param fields The new field information.
*/
- bool change_columns(const Glib::ustring& table_name, const type_vec_const_fields& old_fields, const
type_vec_const_fields& fields) throw();
+ bool change_columns(const Glib::ustring& table_name, const type_vec_const_fields& old_fields, const
type_vec_const_fields& fields) noexcept;
/** Specify a callback that the ConnectionPool can call to get a pointer to the document.
* This callback avoids Connection having to link to AppWindow,
diff --git a/glom/libglom/connectionpool_backends/backend.cc b/glom/libglom/connectionpool_backends/backend.cc
index 1a5c7f1..21cf37f 100644
--- a/glom/libglom/connectionpool_backends/backend.cc
+++ b/glom/libglom/connectionpool_backends/backend.cc
@@ -28,11 +28,11 @@ ExceptionConnection::ExceptionConnection(failure_type failure)
{
}
-ExceptionConnection::~ExceptionConnection() throw()
+ExceptionConnection::~ExceptionConnection() noexcept
{
}
-const char* ExceptionConnection::what() const throw()
+const char* ExceptionConnection::what() const noexcept
{
return "Glom database connection failed.";
}
diff --git a/glom/libglom/connectionpool_backends/backend.h b/glom/libglom/connectionpool_backends/backend.h
index a02d465..da26337 100644
--- a/glom/libglom/connectionpool_backends/backend.h
+++ b/glom/libglom/connectionpool_backends/backend.h
@@ -45,9 +45,9 @@ public:
};
ExceptionConnection(failure_type failure);
- virtual ~ExceptionConnection() throw();
+ virtual ~ExceptionConnection() noexcept;
- virtual const char* what() const throw();
+ virtual const char* what() const noexcept;
virtual failure_type get_failure_type() const;
@@ -180,7 +180,7 @@ protected:
*/
virtual bool drop_column(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const Glib::ustring& field_name);
- virtual bool change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) throw() = 0;
+ virtual bool change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) noexcept = 0;
/** This method is called to create a new database on the
* database server. */
diff --git a/glom/libglom/connectionpool_backends/mysql.cc b/glom/libglom/connectionpool_backends/mysql.cc
index ec4b303..2372355 100644
--- a/glom/libglom/connectionpool_backends/mysql.cc
+++ b/glom/libglom/connectionpool_backends/mysql.cc
@@ -174,7 +174,7 @@ Glib::RefPtr<Gnome::Gda::Connection> MySQL::attempt_connect(const Glib::ustring&
return connection;
}
-bool MySQL::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) throw()
+bool MySQL::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) noexcept
{
static const char TRANSACTION_NAME[] = "glom_change_columns_transaction";
static const char TEMP_COLUMN_NAME[] = "glom_temp_column"; // TODO: Find a unique name.
diff --git a/glom/libglom/connectionpool_backends/mysql.h b/glom/libglom/connectionpool_backends/mysql.h
index 59a7f82..c86b3d1 100644
--- a/glom/libglom/connectionpool_backends/mysql.h
+++ b/glom/libglom/connectionpool_backends/mysql.h
@@ -62,7 +62,7 @@ private:
virtual Gnome::Gda::SqlOperatorType get_string_find_operator() const;
virtual const char* get_public_schema_name() const;
- virtual bool change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) throw();
+ virtual bool change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) noexcept;
protected:
bool attempt_create_database(const SlotProgress& slot_progress, const Glib::ustring& database_name, const
Glib::ustring& host, const Glib::ustring& port, const Glib::ustring& username, const Glib::ustring& password);
diff --git a/glom/libglom/connectionpool_backends/postgres.cc
b/glom/libglom/connectionpool_backends/postgres.cc
index e4e28a9..463adbf 100644
--- a/glom/libglom/connectionpool_backends/postgres.cc
+++ b/glom/libglom/connectionpool_backends/postgres.cc
@@ -161,7 +161,7 @@ Glib::RefPtr<Gnome::Gda::Connection> Postgres::attempt_connect(const Glib::ustri
return connection;
}
-bool Postgres::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) throw()
+bool Postgres::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) noexcept
{
static const char TRANSACTION_NAME[] = "glom_change_columns_transaction";
static const char TEMP_COLUMN_NAME[] = "glom_temp_column"; // TODO: Find a unique name.
diff --git a/glom/libglom/connectionpool_backends/postgres.h b/glom/libglom/connectionpool_backends/postgres.h
index 8c84153..79f3ce6 100644
--- a/glom/libglom/connectionpool_backends/postgres.h
+++ b/glom/libglom/connectionpool_backends/postgres.h
@@ -62,7 +62,7 @@ private:
virtual Gnome::Gda::SqlOperatorType get_string_find_operator() const;
virtual const char* get_public_schema_name() const;
- virtual bool change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) throw();
+ virtual bool change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) noexcept;
protected:
bool attempt_create_database(const SlotProgress& slot_progress, const Glib::ustring& database_name, const
Glib::ustring& host, const Glib::ustring& port, const Glib::ustring& username, const Glib::ustring& password);
diff --git a/glom/libglom/connectionpool_backends/sqlite.cc b/glom/libglom/connectionpool_backends/sqlite.cc
index 5d2577a..2deaa21 100644
--- a/glom/libglom/connectionpool_backends/sqlite.cc
+++ b/glom/libglom/connectionpool_backends/sqlite.cc
@@ -176,7 +176,7 @@ bool Sqlite::add_column_to_server_operation(const Glib::RefPtr<Gnome::Gda::Serve
return true;
}
-bool Sqlite::recreate_table(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_strings& fields_removed, const type_vec_const_fields& fields_added, const
type_mapFieldChanges& fields_changed) throw()
+bool Sqlite::recreate_table(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_strings& fields_removed, const type_vec_const_fields& fields_added, const
type_mapFieldChanges& fields_changed) noexcept
{
static const gchar TEMPORARY_TABLE_NAME[] = "GLOM_TEMP_TABLE"; // TODO: Make sure this is unique.
static const gchar TRANSACTION_NAME[] = "GLOM_RECREATE_TABLE_TRANSACTION";
@@ -397,7 +397,7 @@ bool Sqlite::drop_column(const Glib::RefPtr<Gnome::Gda::Connection>& connection,
return recreate_table(connection, table_name, type_vec_strings(1, field_name), type_vec_const_fields(),
type_mapFieldChanges());
}
-bool Sqlite::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) throw()
+bool Sqlite::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) noexcept
{
type_mapFieldChanges fields_changed;
diff --git a/glom/libglom/connectionpool_backends/sqlite.h b/glom/libglom/connectionpool_backends/sqlite.h
index e8dfd25..9c2071c 100644
--- a/glom/libglom/connectionpool_backends/sqlite.h
+++ b/glom/libglom/connectionpool_backends/sqlite.h
@@ -49,11 +49,11 @@ private:
//typedef std::vector<std::shared_ptr<const Field> > type_vec_fields;
typedef std::map<Glib::ustring, std::shared_ptr<const Field> > type_mapFieldChanges;
- bool recreate_table(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_strings& fields_removed, const type_vec_const_fields& fields_added, const
type_mapFieldChanges& fields_changed) throw();
+ bool recreate_table(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_strings& fields_removed, const type_vec_const_fields& fields_added, const
type_mapFieldChanges& fields_changed) noexcept;
virtual bool add_column(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const std::shared_ptr<const Field>& field);
virtual bool drop_column(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const Glib::ustring& field_name);
- virtual bool change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) throw();
+ virtual bool change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) noexcept;
virtual Glib::RefPtr<Gnome::Gda::Connection> connect(const Glib::ustring& database, const Glib::ustring&
username, const Glib::ustring& password, bool fake_connection = false);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]