msl 1.3.0
Loading...
Searching...
No Matches
helpers.h File Reference

Go to the source code of this file.

Namespaces

namespace  msl
 Top-level namespace of the msl library.
 

Macros

#define ON_ERROR_RETURN_FALSE(S)
 Execute statement S, and, if not MRRESULT_SUCCESS, return false.
 
#define ON_ERROR_RETURN_STATUS(S)
 Execute statement S, and, if not MRRESULT_SUCCESS, return the status.
 
#define ON_ERROR_SET_STATUS_AND_RETURN_FALSE(S)
 Execute statement S, and, if not MRRESULT_SUCCESS, set the status of the current object and return false.
 
#define ON_FALSE_RETURN_FALSE(S)
 Execute statement S, and, if false, return false.
 
#define ON_FALSE_RETURN_STATUS(O, S)
 Execute statement O.S, and, if false, return the status of object O.
 
#define ON_FALSE_SET_STATUS_AND_RETURN_FALSE(O, S)
 Execute statement O.S, and, if false, set the status of the current object to that of object O and return false.
 

Functions

double msl::roundUp (double value, double base)
 Round up the value to the nearest multiple of base.
 
long msl::roundUpGRT (double value)
 Round up the value to the nearest multiple of GRAD_RASTER_TIME.
 
double msl::roundDown (double value, double base)
 Round down the value to the nearest multiple of base.
 
long msl::roundDownGRT (double value)
 Round down the value to the nearest multiple of GRAD_RASTER_TIME.
 
template<typename T >
long msl::endTime (T const &x)
 Get the end time of an non-GRAD_PULSE IDEA object.
 
long msl::endTime (sGRAD_PULSE const &x)
 Get the end time of a GRAD_PULSE object.
 

Macro Definition Documentation

◆ ON_ERROR_RETURN_FALSE

#define ON_ERROR_RETURN_FALSE (   S)
Value:
{ \
MrResult const __status = (S); \
if(!MrSucceeded(__status)) \
{ \
return false; \
} \
}

Execute statement S, and, if not MRRESULT_SUCCESS, return false.

◆ ON_ERROR_RETURN_STATUS

#define ON_ERROR_RETURN_STATUS (   S)
Value:
{ \
MrResult const __status = (S); \
if(!MrSucceeded(__status)) \
{ \
return __status; \
} \
}

Execute statement S, and, if not MRRESULT_SUCCESS, return the status.

◆ ON_ERROR_SET_STATUS_AND_RETURN_FALSE

#define ON_ERROR_SET_STATUS_AND_RETURN_FALSE (   S)
Value:
{\
MrResult const __status = (S); \
if(!MrSucceeded(__status)) \
{ \
this->setNLSStatus(__status); \
return false; \
} \
}

Execute statement S, and, if not MRRESULT_SUCCESS, set the status of the current object and return false.

◆ ON_FALSE_RETURN_FALSE

#define ON_FALSE_RETURN_FALSE (   S)
Value:
if(!(S)) \
{ \
return false; \
}

Execute statement S, and, if false, return false.

◆ ON_FALSE_RETURN_STATUS

#define ON_FALSE_RETURN_STATUS (   O,
 
)
Value:
if(!(O).S) \
{ \
return (O).getNLSStatus(); \
}

Execute statement O.S, and, if false, return the status of object O.

◆ ON_FALSE_SET_STATUS_AND_RETURN_FALSE

#define ON_FALSE_SET_STATUS_AND_RETURN_FALSE (   O,
 
)
Value:
if(!(O).S) \
{ \
this->setNLSStatus((O).getNLSStatus()); \
return false; \
}

Execute statement O.S, and, if false, set the status of the current object to that of object O and return false.