Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of libmDot by
Utils.h
00001 #ifndef UTILS_H 00002 #define UTILS_H 00003 00004 #include <string> 00005 00006 //Defines a max function that can be used. 00007 inline int mts_max(int a, int b) { return a > b ? a : b; } 00008 00009 //Defines a min function that can be used. 00010 inline int mts_min(int a, int b) { return a < b ? a : b; } 00011 00012 ///An enumeration for relational operators 00013 enum RelationalOperator { 00014 GREATER, LESS, EQUAL, GREATER_EQUAL, LESS_EQUAL 00015 }; 00016 00017 /** A static method for getting a string representation for the RelationalOperator 00018 * enumeration. 00019 * 00020 * @param relationalOperator a RelationalOperator enumeration. 00021 * @returns the enumeration name as a string. 00022 */ 00023 static inline std::string getRelationalOperatorNames(RelationalOperator relationalOperator) 00024 { 00025 switch(relationalOperator) { 00026 case GREATER: 00027 return "GREATER"; 00028 case LESS: 00029 return "LESS"; 00030 case EQUAL: 00031 return "EQUAL"; 00032 case GREATER_EQUAL: 00033 return "GREATER_EQUAL"; 00034 case LESS_EQUAL: 00035 return "LESS_EQUAL"; 00036 default: 00037 return "UNKNOWN ENUM"; 00038 } 00039 } 00040 00041 #endif
Generated on Tue Jul 12 2022 19:53:49 by
