* @brief Returns the number of bytes of a number type. */
| 204 | * @brief Returns the number of bytes of a number type. |
| 205 | */ |
| 206 | inline size_t sizeBytes(const NumType &type) { |
| 207 | switch (type) { |
| 208 | case kf16: |
| 209 | return sizeof(uint16_t); |
| 210 | case kf32: |
| 211 | return sizeof(float); |
| 212 | case ki32: |
| 213 | return sizeof(int32_t); |
| 214 | default: |
| 215 | LOG(kDefLog, kError, "Invalid NumType in size calculation."); |
| 216 | return 0; |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * @brief Converts NumType to string. |