 |
OpendTect
6.6
|
Go to the documentation of this file.
26 template <
class T,
class F>
27 inline void set( T& _to,
const F& fr )
28 { _to =
sCast(T,fr); }
33 template <
class T,
class F>
34 inline T
to(
const F& fr )
45 template <
class T,
class F>
57 template <
class T,
class F>
62 udfset<T,F>(ret,fr,und);
71 inline void set(
const char*& _to,
const short& i )
75 inline void set(
const char*& _to,
const unsigned short& i )
95 inline void set(
const char*& _to,
const bool& b )
99 inline void set(
const char*& _to,
const float& f )
103 inline void set(
const char*& _to,
const double& d )
110 inline void set(
short& _to,
const float& f )
114 inline void set(
unsigned short& _to,
const float& f )
134 inline void set(
short& _to,
const double& f )
138 inline void set(
unsigned short& _to,
const double& f )
161 inline void set(
bool& _to,
const char*
const& s )
173 inline void set(
bool& _to,
const int& i )
177 inline void set(
bool& _to,
const float& f )
181 inline void set(
bool& _to,
const double& d )
188 #define mConvDeclFromStrToSimpleType(type) \
189 template <> mGlobal(Basic) void set(type&,const char* const&); \
190 template <> mGlobal(Basic) void set(type&,const FixedString&); \
191 template <> mGlobal(Basic) void set(type&,const BufferString&)
207 #define mConvDefFromStrToSimpleType(type,function) \
210 template <> void set( type& _to, const char* const& s ) \
212 if ( !s || !*s ) { return; } \
214 char* endptr = nullptr; \
215 type tmpval = sCast(type,function); \
217 _to = sCast(type,tmpval); \
218 else if ( Values::Undef<type>::hasUdf() ) \
219 Values::setUdf( _to ); \
221 template <> void set( type& _to, const FixedString& s ) \
223 if ( s.isEmpty() ) { return; } \
225 char* endptr = nullptr; \
226 type tmpval = sCast(type,function); \
227 if ( s.str() != endptr ) \
228 _to = sCast(type,tmpval); \
229 else if ( Values::Undef<type>::hasUdf() ) \
230 Values::setUdf( _to ); \
232 template <> void set( type& _to, const BufferString& s ) \
234 if ( s.isEmpty() ) { return; } \
236 char* endptr = nullptr; \
237 type tmpval = sCast(type,function); \
238 if ( s.str() != endptr ) \
239 _to = sCast(type,tmpval); \
240 else if ( Values::Undef<type>::hasUdf() ) \
241 Values::setUdf( _to ); \
#define od_uint64
Definition: plftypes.h:36
T to(const F &fr)
Definition: convert.h:34
#define mDefEpsD
Definition: commondefs.h:70
#define od_int64
Definition: plftypes.h:35
#define sCast(tp, v)
Definition: commondefs.h:141
T & setUdf(T &u)
Definition: undefval.h:264
#define mRounded(typ, x)
Definition: commondefs.h:57
#define mDefEpsF
Definition: commondefs.h:69
bool isUdf(const T &t)
Definition: undefval.h:245
void udfset(T &_to, const F &fr, const T &und=Values::Undef< T >::val())
template based type converstion, with check for undef
Definition: convert.h:46
T udfto(const F &fr, const T &und=Values::Undef< T >::val())
Definition: convert.h:58
const char * str() const
Definition: odstring.h:47
#define mIsZero(x, eps)
Definition: commondefs.h:66
OD::String that holds an existing text string.
Definition: fixedstring.h:29
bool yesNoFromString(const char *)
#define od_uint16
Definition: plftypes.h:27
void set(T &_to, const F &fr)
template based type conversion
Definition: convert.h:27
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
Template based type conversion.
Definition: convert.h:23
#define od_int32
Definition: plftypes.h:30
Templatized undefined values.
Definition: undefval.h:52
#define od_uint32
Definition: plftypes.h:31
#define mConvDeclFromStrToSimpleType(type)
Definition: convert.h:188
BufferString toString(const BufferStringSet &bss)
Definition: bufstringset.h:156
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021