From 6ba6af2934095f54f51d17c1d9ed8216b6249aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sun, 5 Dec 2010 14:40:40 +0100 Subject: Use make_shared in parsers. diff --git a/Swiften/Parser/GenericElementParser.h b/Swiften/Parser/GenericElementParser.h index ebd85dc..a0795f0 100644 --- a/Swiften/Parser/GenericElementParser.h +++ b/Swiften/Parser/GenericElementParser.h @@ -4,12 +4,12 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_GenericElementParser_H -#define SWIFTEN_GenericElementParser_H +#pragma once #include +#include -#include "Swiften/Parser/ElementParser.h" +#include namespace Swift { class String; @@ -19,7 +19,7 @@ namespace Swift { class GenericElementParser : public ElementParser { public: GenericElementParser() { - stanza_ = boost::shared_ptr(new ElementType()); + stanza_ = boost::make_shared(); } virtual boost::shared_ptr getElement() const { @@ -44,5 +44,3 @@ namespace Swift { boost::shared_ptr stanza_; }; } - -#endif diff --git a/Swiften/Parser/GenericPayloadParser.h b/Swiften/Parser/GenericPayloadParser.h index a1720e8..3514541 100644 --- a/Swiften/Parser/GenericPayloadParser.h +++ b/Swiften/Parser/GenericPayloadParser.h @@ -7,8 +7,9 @@ #pragma once #include +#include -#include "Swiften/Parser/PayloadParser.h" +#include namespace Swift { class String; @@ -24,7 +25,7 @@ namespace Swift { class GenericPayloadParser : public PayloadParser { public: GenericPayloadParser() : PayloadParser() { - payload_ = boost::shared_ptr(new PAYLOAD_TYPE()); + payload_ = boost::make_shared(); } virtual boost::shared_ptr getPayload() const { diff --git a/Swiften/Parser/GenericStanzaParser.h b/Swiften/Parser/GenericStanzaParser.h index 4c4f6a2..9c274f5 100644 --- a/Swiften/Parser/GenericStanzaParser.h +++ b/Swiften/Parser/GenericStanzaParser.h @@ -4,12 +4,12 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_GenericStanzaParser_H -#define SWIFTEN_GenericStanzaParser_H +#pragma once #include +#include -#include "Swiften/Parser/StanzaParser.h" +#include namespace Swift { class String; @@ -20,7 +20,7 @@ namespace Swift { public: GenericStanzaParser(PayloadParserFactoryCollection* collection) : StanzaParser(collection) { - stanza_ = boost::shared_ptr(new STANZA_TYPE()); + stanza_ = boost::make_shared(); } virtual boost::shared_ptr getElement() const { @@ -35,5 +35,3 @@ namespace Swift { boost::shared_ptr stanza_; }; } - -#endif -- cgit v0.10.2-6-g49f6