File indexing completed on 2024-04-28 12:45:41

0001 /*
0002  * This file is part of TelepathyLoggerQt4
0003  *
0004  * Copyright (C) 2014 Daniel Vrátil <dvratil@redhat.com>
0005  *
0006  * This library is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU Lesser General Public License as published
0008  * by the Free Software Foundation; either version 2.1 of the License, or
0009  * (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General Public License
0017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 #ifndef _TelepathyLoggerQt_object_h_HEADER_GUARD_
0020 #define _TelepathyLoggerQt_object_h_HEADER_GUARD_
0021 
0022 #include "types.h"
0023 
0024 #include <TelepathyLoggerQt_export.h>
0025 
0026 namespace Tpl
0027 {
0028 
0029 class TELEPATHY_LOGGER_QT_EXPORT Object
0030 {
0031 public:
0032     explicit Object(void *tplPtr, bool ref = false);
0033 
0034     virtual ~Object();
0035 
0036 protected:
0037     template<typename T>
0038     T* object() const {
0039         return reinterpret_cast<T*>(m_tplPtr);
0040     }
0041 
0042 private:
0043     friend class ::TPLoggerQtWrapper;
0044     void *m_tplPtr;
0045 };
0046 
0047 } //namespace
0048 
0049 #endif