cartodata 6.0.0
doi.h
Go to the documentation of this file.
1/* This software and supporting documentation are distributed by
2 * Institut Federatif de Recherche 49
3 * CEA/NeuroSpin, Batiment 145,
4 * 91191 Gif-sur-Yvette cedex
5 * France
6 *
7 * This software is governed by the CeCILL-B license under
8 * French law and abiding by the rules of distribution of free software.
9 * You can use, modify and/or redistribute the software under the
10 * terms of the CeCILL-B license as circulated by CEA, CNRS
11 * and INRIA at the following URL "http://www.cecill.info".
12 *
13 * As a counterpart to the access to the source code and rights to copy,
14 * modify and redistribute granted by the license, users are provided only
15 * with a limited warranty and the software's author, the holder of the
16 * economic rights, and the successive licensors have only limited
17 * liability.
18 *
19 * In this respect, the user's attention is drawn to the risks associated
20 * with loading, using, modifying and/or developing or reproducing the
21 * software by the user in light of its specific status of free software,
22 * that may mean that it is complicated to manipulate, and that also
23 * therefore means that it is reserved for developers and experienced
24 * professionals having in-depth computer knowledge. Users are therefore
25 * encouraged to load and test the software's suitability as regards their
26 * requirements in conditions enabling the security of their systems and/or
27 * data to be ensured and, more generally, to use and operate it in the
28 * same conditions as regards security.
29 *
30 * The fact that you are presently reading this means that you have had
31 * knowledge of the CeCILL-B license and that you accept its terms.
32 */
33
34#ifndef CARTODATA_ROI_DOI_H
35#define CARTODATA_ROI_DOI_H
36
37#include <cartobase/object/object_d.h>
39
40#define DECLARE_VIRTUAL_GENERIC_OBJECT_TYPE( T ) \
41template <> \
42struct GenericObjectTypeDeclared< T > \
43{ \
44 static inline void check() {}; \
45}; \
46template <> \
47void DictionaryInterface::setProperty( const std::string &key, \
48 T const &value ); \
49template <> \
50bool DictionaryInterface::getProperty( const std::string &key, T &value ) const; \
51extern template class TypedObject< T >; \
52extern template class ReferenceObject< T >; \
53extern template class PointerObject< T >; \
54extern template \
55T const &GenericObject::value< T >() const; \
56extern template \
57T &GenericObject::value< T >(); \
58template <> \
59bool GenericObject::value( T &dest ) const; \
60template <> \
61void GenericObject::setValue( T const & x ); \
62extern template bool DictionaryInterface:: \
63getProperty( const std::string &, T & ) const; \
64extern template void DictionaryInterface:: \
65setProperty( const std::string &, T const & ); \
66
67
68namespace carto {
69
70
71 //------------------//
72 // RcptrObject<T> //
73//------------------//
74
75// This class has nthing to do here, it should go in object.h.
76// It is just for testing without compiling everything.
77template <typename T>
78class RcptrObject : public TypedObject<T>
79{
80public:
81 inline RcptrObject( T &x );
82 virtual ~RcptrObject();
83 virtual T &getValue();
84
85 virtual Object clone() const;
86
87private:
88
89 mutable rc_ptr<T> _pvalue;
90};
91
92
93 //--------------------//
94 // RcptrObject<T> //
95//--------------------//
96
97//-----------------------------------------------------------------------------
98template <typename T>
99inline RcptrObject<T>::RcptrObject( T &x ) : _pvalue( &x )
100{
101}
102
103
104 //----------------//
105 // DiscreteDOI //
106//----------------//
107
108class DiscreteDOI : public virtual RCObject, virtual public IterableInterface
109{
110public:
111 virtual ~DiscreteDOI();
112
113 virtual Object objectIterator() const = 0;
114 virtual Object valueAt( const Site &site ) const;
115
116};
117
118// DECLARE_VIRTUAL_GENERIC_OBJECT_TYPE( DiscreteDOI );
119
120#if 0
121#define T DiscreteDOI
122template <>
124{
125 static inline void check() {};
126};
127template <>
128void DictionaryInterface::setProperty( const std::string &key,
129 T const &value );
130template <>
131bool DictionaryInterface::getProperty( const std::string &key, T &value ) const;
132template <>
133bool GenericObject::value( T &dest ) const;
134template <>
135void GenericObject::setValue( T const & x );
136extern template class TypedObject< T >;
137extern template class ReferenceObject< T >;
138extern template class PointerObject< T >;
139extern template
140T const &GenericObject::value< T >() const;
141extern template
143extern template
144bool GenericObject::value( T &dest ) const;
145extern template
146void GenericObject::setValue( T const & x );
147extern template bool DictionaryInterface::
148getProperty( const std::string &, T & ) const;
149extern template void DictionaryInterface::
150setProperty( const std::string &, T const & );
151#undef T
152#endif
153
154
155 //-------------------//
156 // NumberIterator //
157//-------------------//
158
159class NumberIterator : public virtual RCObject, virtual public IteratorInterface
160{
161 Object currentValue() const;
162 virtual double currentNumber() const = 0;
163};
164
165// DECLARE_VIRTUAL_GENERIC_OBJECT_TYPE( NumberIterator );
166
167
168 //----------------------//
169 // DiscreteNumberDOI //
170//----------------------//
171
173{
174 virtual Object objectIterator() const;
175 virtual Object valueAt( const Site &site ) const;
176 virtual NumberIterator *numberIterator() const = 0;
177 virtual double numberAt( const Site &site ) const;
178};
179
180// DECLARE_VIRTUAL_GENERIC_OBJECT_TYPE( DiscreteNumberDOI );
181
182
183
184} // namespace carto
185
186#endif // ifndef CARTODATA_ROI_DOI_H
virtual bool getProperty(const std::string &key, Object &value) const=0
virtual void setProperty(const std::string &key, Object value)=0
virtual ~DiscreteDOI()
virtual Object objectIterator() const =0
virtual Object valueAt(const Site &site) const
const T & value() const
void setValue(const T &val)
virtual T & getValue()
RcptrObject(T &x)
Definition doi.h:99
virtual ~RcptrObject()
virtual Object clone() const
static void check(T *x=NULL)