78 lines
2.6 KiB
C++
78 lines
2.6 KiB
C++
// ****************************************************************************************************
|
|
// File: DeviceUtil.h
|
|
// Authors: Wu YiFei
|
|
// Date : 28/05/2006
|
|
// ****************************************************************************************************
|
|
|
|
|
|
# ifndef DEVICEUTIL_H
|
|
# define DEVICEUTIL_H
|
|
|
|
|
|
// ****************************************************************************************************
|
|
// Identifier Declaration.
|
|
// ****************************************************************************************************
|
|
|
|
|
|
|
|
|
|
namespace DEVICE {
|
|
|
|
// ****************************************************************************************************
|
|
// Constants.
|
|
// ****************************************************************************************************
|
|
|
|
|
|
// ****************************************************************************************************
|
|
// Macros.
|
|
// ****************************************************************************************************
|
|
|
|
// --------------------------------------------------------------------
|
|
// Macro Method "RETURN_EVEN(num)"
|
|
// This Method Macro is return a number even.
|
|
|
|
/* \num must be a integer.
|
|
*/
|
|
|
|
# define RETURN_EVEN(num) \
|
|
(num%2)==0?num:num+1
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
// Macro Method "MAX_INTEGER(a, b)"
|
|
// This Method Macro is return the Max between a and b.
|
|
|
|
/* \a must be a integer.
|
|
* \b must be a integer.
|
|
*/
|
|
|
|
# define MAX_INTEGER(a, b) \
|
|
a>b?a:b
|
|
|
|
|
|
|
|
// ****************************************************************************************************
|
|
// Class.
|
|
// ****************************************************************************************************
|
|
|
|
|
|
// ****************************************************************************************************
|
|
// Variables.
|
|
// ****************************************************************************************************
|
|
|
|
|
|
// ****************************************************************************************************
|
|
// Utilitarians (functions).
|
|
// ****************************************************************************************************
|
|
|
|
|
|
} // END OF NAMESPACE DEVICE
|
|
|
|
|
|
// ****************************************************************************************************
|
|
// Generic Functions.
|
|
// ****************************************************************************************************
|
|
|
|
|
|
# endif
|