summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/otemplatebase.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/otemplatebase.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/otemplatebase.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/libopie2/opiepim/core/otemplatebase.h b/libopie2/opiepim/core/otemplatebase.h
index cadac74..17d9961 100644
--- a/libopie2/opiepim/core/otemplatebase.h
+++ b/libopie2/opiepim/core/otemplatebase.h
@@ -1,20 +1,49 @@
1/*
2 This file is part of the Opie Project
3 Copyright (C) The Main Author <main-author@whereever.org>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l.
6 .>+-=
7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
16 : .. .:, . . . without even the implied warranty of
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.= = ; Library General Public License for more
20++= -. .` .: details.
21 : = ...= . :.=-
22 -. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28*/
1#ifndef OPIE_TEMPLATE_BASE_H 29#ifndef OPIE_TEMPLATE_BASE_H
2#define OPIE_TEMPLATE_BASE_H 30#define OPIE_TEMPLATE_BASE_H
3 31
4#include <qarray.h> 32#include <qarray.h>
5 33
6#include <opie/opimrecord.h> 34#include <opie2/opimrecord.h>
7 35
8 36
37namespace Opie {
9/** 38/**
10 * Templates do not have a base class, This is why 39 * Templates do not have a base class, This is why
11 * we've this class 40 * we've this class
12 * this is here to give us the possibility 41 * this is here to give us the possibility
13 * to have a common base class 42 * to have a common base class
14 * You may not want to use that interface internaly 43 * You may not want to use that interface internaly
15 * POOR mans interface 44 * POOR mans interface
16 */ 45 */
17class OPimBasePrivate; 46class OPimBasePrivate;
18struct OPimBase { 47struct OPimBase {
19 /** 48 /**
20 * return the rtti 49 * return the rtti
@@ -86,13 +115,15 @@ OPimRecord* OTemplateBase<T>::record()const {
86template <class T> 115template <class T>
87OPimRecord* OTemplateBase<T>::record(int uid )const { 116OPimRecord* OTemplateBase<T>::record(int uid )const {
88 T t2 = find(uid ); 117 T t2 = find(uid );
89 T* t1 = new T(t2); 118 T* t1 = new T(t2);
90 119
91 return t1; 120 return t1;
92}; 121};
93template <class T> 122template <class T>
94T* OTemplateBase<T>::rec() { 123T* OTemplateBase<T>::rec() {
95 return new T; 124 return new T;
96} 125}
97 126
127}
128
98#endif 129#endif