C++: Introduce CreateBindings::Ptr

typedef for QSharedPointer<CreateBindings>

Change-Id: Idf7a9984bb90da82407abd4b7dec9f40926beac8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-05-18 22:08:14 +03:00
committed by Orgad Shaneh
parent de68ac5407
commit cbc122e2e2
4 changed files with 10 additions and 8 deletions

View File

@@ -162,7 +162,7 @@ LookupContext::LookupContext(Document::Ptr thisDocument,
LookupContext::LookupContext(Document::Ptr expressionDocument,
Document::Ptr thisDocument,
const Snapshot &snapshot,
QSharedPointer<CreateBindings> bindings)
CreateBindings::Ptr bindings)
: _expressionDocument(expressionDocument)
, _thisDocument(thisDocument)
, _snapshot(snapshot)

View File

@@ -107,6 +107,8 @@ class CPLUSPLUS_EXPORT CreateBindings
Q_DISABLE_COPY(CreateBindings)
public:
typedef QSharedPointer<CreateBindings> Ptr;
CreateBindings(Document::Ptr thisDocument, const Snapshot &snapshot);
virtual ~CreateBindings();
@@ -214,7 +216,7 @@ public:
LookupContext(Document::Ptr expressionDocument,
Document::Ptr thisDocument,
const Snapshot &snapshot,
QSharedPointer<CreateBindings> bindings = QSharedPointer<CreateBindings>());
CreateBindings::Ptr bindings = CreateBindings::Ptr());
LookupContext(const LookupContext &other);
LookupContext &operator = (const LookupContext &other);
@@ -236,7 +238,7 @@ public:
LookupScope *lookupParent(Symbol *symbol) const;
/// \internal
QSharedPointer<CreateBindings> bindings() const
CreateBindings::Ptr bindings() const
{ return _bindings; }
static QList<const Name *> fullyQualifiedName(Symbol *symbol);
@@ -264,7 +266,7 @@ private:
Snapshot _snapshot;
// Bindings
QSharedPointer<CreateBindings> _bindings;
CreateBindings::Ptr _bindings;
bool m_expandTemplates;
};

View File

@@ -50,7 +50,7 @@ TypeOfExpression::TypeOfExpression():
}
void TypeOfExpression::init(Document::Ptr thisDocument, const Snapshot &snapshot,
QSharedPointer<CreateBindings> bindings,
CreateBindings::Ptr bindings,
const QSet<const Declaration *> &autoDeclarationsBeingResolved)
{
m_thisDocument = thisDocument;
@@ -62,7 +62,7 @@ void TypeOfExpression::init(Document::Ptr thisDocument, const Snapshot &snapshot
Q_ASSERT(m_bindings.isNull());
m_bindings = bindings;
if (m_bindings.isNull())
m_bindings = QSharedPointer<CreateBindings>(new CreateBindings(thisDocument, snapshot));
m_bindings = CreateBindings::Ptr(new CreateBindings(thisDocument, snapshot));
m_environment.clear();
m_autoDeclarationsBeingResolved = autoDeclarationsBeingResolved;

View File

@@ -62,7 +62,7 @@ public:
*/
void init(Document::Ptr thisDocument,
const Snapshot &snapshot,
QSharedPointer<CreateBindings> bindings = QSharedPointer<CreateBindings>(),
CreateBindings::Ptr bindings = CreateBindings::Ptr(),
const QSet<const Declaration *> &autoDeclarationsBeingResolved
= QSet<const Declaration *>());
@@ -142,7 +142,7 @@ private:
private:
Document::Ptr m_thisDocument;
Snapshot m_snapshot;
QSharedPointer<CreateBindings> m_bindings;
CreateBindings::Ptr m_bindings;
ExpressionAST *m_ast;
Scope *m_scope;
LookupContext m_lookupContext;