<commit_before>/* dtkSmartPointer.h ---
 *
 * Author: <NAME>
 * Copyright (C) 2011 - <NAME>, Inria.
 * Created: Wed May 25 14:00:00 2011 (+0100)
 * Version: $Id$
 * Last-Updated: Tue Jul  5 17:09:00 2011 (+0200)
 *           By: <NAME>
 *     Update #: 54
 */

/* Commentary:
 *
 */

/* Change log:
 *
 */

#ifndef DTKSMARTPOINTER_H
#define DTKSMARTPOINTER_H

#include <QtCore/QHash>

template<class T> class dtkSmartPointer
{
public:
    typedef T ObjectType;

    dtkSmartPointer(void) : d(0) {

    }

    dtkSmartPointer(const dtkSmartPointer<T> &p) : d(p.d) {
        this->retain();
    }

    template <typename TR> dtkSmartPointer(const dtkSmartPointer<TR> &p) : d(dynamic_cast<T*>( p.operator->())) {
        this->retain();
    }

    dtkSmartPointer(T *p) : d(p) {
        this->retain();
    }

    ~dtkSmartPointer(void)
    {
        this->release();
    }

    T* operator->(void) const {
        return d;
    }
<commit_msg>Fix some coding style elements.<commit_after>/* dtkSmartPointer.h ---
 *
 * Author: <NAME>
 * Copyright (C) 2011 - <NAME>, Inria.
 * Created: Wed May 25 14:00:00 2011 (+0100)
 * Version: $Id$
 * Last-Updated: Wed Aug  3 09:00:13 2011 (+0200)
 *           By: <NAME>
 *     Update #: 55
 */

/* Commentary:
 *
 */

/* Change log:
 *
 */

#ifndef DTKSMARTPOINTER_H
#define DTKSMARTPOINTER_H

#include <QtCore/QHash>

template<class T> class dtkSmartPointer
{
public:
    typedef T ObjectType;

    dtkSmartPointer(void) : d(0) {

    }

    dtkSmartPointer(const dtkSmartPointer<T> &p) : d(p.d) {
        this->retain();
    }

    template <typename TR> dtkSmartPointer(const dtkSmartPointer<TR> &p) : d(dynamic_cast<T*>( p.operator->())) {
        this->retain();
    }

    dtkSmartPointer(T *p) : d(p) {
        this->retain();
    }

    ~dtkSmartPointer(void) {
        this->release();
    }

    T* operator->(void) const {
        return d;
    }

{'fraction_non_alphanumeric': 0.1631467793030623, 'fraction_numerical': 0.04012671594508976, 'mean_word_length': 2.548689138576779, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5774491', 'n_tokens_mistral': 790, 'n_tokens_neox': 696, 'n_words': 150}