summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-12-05 13:40:40 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-12-05 13:40:40 (GMT)
commit6ba6af2934095f54f51d17c1d9ed8216b6249aa3 (patch)
tree7bc2236f1f6feb6f821dee8ca0fcb395751740e0 /Swiften/Parser
parent5c30503d671d54c3e2950be7b4f17a1ba5843475 (diff)
downloadswift-contrib-6ba6af2934095f54f51d17c1d9ed8216b6249aa3.zip
swift-contrib-6ba6af2934095f54f51d17c1d9ed8216b6249aa3.tar.bz2
Use make_shared in parsers.
Diffstat (limited to 'Swiften/Parser')
-rw-r--r--Swiften/Parser/GenericElementParser.h10
-rw-r--r--Swiften/Parser/GenericPayloadParser.h5
-rw-r--r--Swiften/Parser/GenericStanzaParser.h10
3 files changed, 11 insertions, 14 deletions
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 <boost/shared_ptr.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
-#include "Swiften/Parser/ElementParser.h"
+#include <Swiften/Parser/ElementParser.h>
namespace Swift {
class String;
@@ -19,7 +19,7 @@ namespace Swift {
class GenericElementParser : public ElementParser {
public:
GenericElementParser() {
- stanza_ = boost::shared_ptr<ElementType>(new ElementType());
+ stanza_ = boost::make_shared<ElementType>();
}
virtual boost::shared_ptr<Element> getElement() const {
@@ -44,5 +44,3 @@ namespace Swift {
boost::shared_ptr<ElementType> 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 <boost/shared_ptr.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
-#include "Swiften/Parser/PayloadParser.h"
+#include <Swiften/Parser/PayloadParser.h>
namespace Swift {
class String;
@@ -24,7 +25,7 @@ namespace Swift {
class GenericPayloadParser : public PayloadParser {
public:
GenericPayloadParser() : PayloadParser() {
- payload_ = boost::shared_ptr<PAYLOAD_TYPE>(new PAYLOAD_TYPE());
+ payload_ = boost::make_shared<PAYLOAD_TYPE>();
}
virtual boost::shared_ptr<Payload> 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 <boost/shared_ptr.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
-#include "Swiften/Parser/StanzaParser.h"
+#include <Swiften/Parser/StanzaParser.h>
namespace Swift {
class String;
@@ -20,7 +20,7 @@ namespace Swift {
public:
GenericStanzaParser(PayloadParserFactoryCollection* collection) :
StanzaParser(collection) {
- stanza_ = boost::shared_ptr<STANZA_TYPE>(new STANZA_TYPE());
+ stanza_ = boost::make_shared<STANZA_TYPE>();
}
virtual boost::shared_ptr<Element> getElement() const {
@@ -35,5 +35,3 @@ namespace Swift {
boost::shared_ptr<STANZA_TYPE> stanza_;
};
}
-
-#endif