[glibmm] Markup: Add move operations
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Markup: Add move operations
- Date: Tue, 1 Sep 2015 14:54:25 +0000 (UTC)
commit 489860d061b518ead43c096de5c076d168491ae5
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Sep 1 16:49:40 2015 +0200
Markup: Add move operations
glib/src/markup.ccg | 31 +++++++++++++++++++++++++++++++
glib/src/markup.hg | 6 ++++++
2 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/glib/src/markup.ccg b/glib/src/markup.ccg
index 738ce78..14f5c25 100644
--- a/glib/src/markup.ccg
+++ b/glib/src/markup.ccg
@@ -219,6 +219,17 @@ void ParserCallbacks::error(GMarkupParseContext* context,
Parser::Parser()
{}
+Parser::Parser(Parser&& other) noexcept
+: sigc::trackable(std::move(other))
+{
+}
+
+Parser& Parser::operator=(Parser&& other) noexcept
+{
+ sigc::trackable::operator=(std::move(other));
+ return *this;
+}
+
Parser::~Parser()
{}
@@ -247,6 +258,26 @@ ParseContext::ParseContext(Parser& parser, ParseFlags flags)
this, &ParseContext::destroy_notify_callback))
{}
+ParseContext::ParseContext(ParseContext&& other) noexcept
+: sigc::trackable(std::move(other)),
+ parser_(std::move(other.parser_)),
+ gobject_(std::move(other.gobject_))
+{
+}
+
+ParseContext& ParseContext::operator=(ParseContext&& other) noexcept
+{
+ sigc::trackable::operator=(std::move(other));
+
+ parser_ = std::move(other.parser_);
+ gobject_ = std::move(other.gobject_);
+
+ other.parser_ = nullptr;
+ other.gobject_ = nullptr;
+
+ return *this;
+}
+
ParseContext::~ParseContext()
{
parser_ = nullptr;
diff --git a/glib/src/markup.hg b/glib/src/markup.hg
index 005eab1..14c4163 100644
--- a/glib/src/markup.hg
+++ b/glib/src/markup.hg
@@ -176,6 +176,9 @@ protected:
Parser(const Parser&) = delete;
Parser& operator=(const Parser&) = delete;
+ Parser(Parser&& other) noexcept;
+ Parser& operator=(Parser&& other) noexcept;
+
/** Called for open tags <tt>\<foo bar="baz"\></tt>.
* This virtual method is invoked when the opening tag of an element is seen.
* @param context The Markup::ParseContext object the parsed data belongs to.
@@ -263,6 +266,9 @@ public:
ParseContext(const ParseContext&) = delete;
ParseContext& operator=(const ParseContext&) = delete;
+ ParseContext(ParseContext&& other) noexcept;
+ ParseContext& operator=(ParseContext&& other) noexcept;
+
virtual ~ParseContext();
/** Feed some data to the ParseContext.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]