Gaia
origtypes.h
1 /*
2  * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
3  *
4  * This file is part of Gaia
5  *
6  * Gaia is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License as published by the Free
8  * Software Foundation (FSF), either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the Affero GNU General Public License
17  * version 3 along with this program. If not, see http://www.gnu.org/licenses/
18  */
19 
20 #ifndef GAIA_STL_ORIGTYPES_H
21 #define GAIA_STL_ORIGTYPES_H
22 
23 #include <string>
24 #include <assert.h>
25 #include "baseexception.h"
26 
27 namespace gaia2 {
28 
29 class DataSet;
30 class Point;
31 class PointLayout;
32 class Transformation;
33 class Analyzer;
34 class ParameterMap;
35 class DistanceFunction;
36 class SearchPoint;
37 
38 template <typename DataSetType, typename PointType, typename SearchPointType, typename DistanceType>
39 class BaseView;
40 typedef BaseView<DataSet, Point, SearchPoint, DistanceFunction> View;
41 
42 
43 } // namespace gaia2
44 
45 
46 namespace gaia2std {
47 
48 // include inside the namespace
49 #include "counted_ptr.h"
50 
51 #define proxy_ptr counted_ptr
52 
53 // forward-declare some classes so they can all be friends!
54 class DataSet;
55 class Collection;
56 class Point;
57 class ParameterMap;
58 class DistanceFunction;
59 
60 } // namespace gaia2std
61 
62 
63 // useful define to make sure we define everything necessary for proxy-classes
64 #define DECLARE_PROXY(classname) \
65  public: \
66  ~classname(); \
67  private: \
68  bool _ownsData; \
69  ::gaia2::classname* _d; \
70  classname(const ::gaia2::classname* c) : \
71  _ownsData(false), \
72  _d(const_cast< ::gaia2::classname*>(c)) {} \
73  ::gaia2::classname* impl() const { \
74  return _d; \
75  }
76 
77 #define PROXY_DESTRUCTOR(classname) \
78 classname::~classname() { \
79  if (_ownsData) delete _d; \
80 }
81 
82 #endif // GAIA_STL_ORIGTYPES_H
Definition: parameter.h:28
Definition: distancefunction.h:28
Definition: baseexception.h:26
Main Gaia namespace, which contains all the library functions.
Definition: addfield.cpp:22
Definition: view.h:32
Definition: dataset.h:31
Definition: point.h:28