@@ -200,21 +200,6 @@ class flxDescriptor
200
200
bool _titleAlloc;
201
201
};
202
202
203
- // typedef enum
204
- // {
205
- // flxTypeNone = 0,
206
- // flxTypeBool,
207
- // flxTypeInt8,
208
- // flxTypeInt16,
209
- // flxTypeInt32,
210
- // flxTypeUInt8,
211
- // flxTypeUInt16,
212
- // flxTypeUInt32,
213
- // flxTypeFloat,
214
- // flxTypeDouble,
215
- // flxTypeString
216
- // } flxDataType_t;
217
-
218
203
// The number used for the datatype codes is based on the sizeof() value and other attributes determined at compile
219
204
// time. This is something picked up from the NVS system of esp32 - solid hack.
220
205
enum flxDataType_t : std::uint8_t
@@ -473,101 +458,6 @@ class flxDataVariable
473
458
};
474
459
};
475
460
476
- class flxDataTyper
477
- {
478
- public:
479
- // some method overloading to determine types
480
- static flxDataType_t type (std::nullptr_t *t)
481
- {
482
- return flxTypeNone;
483
- };
484
- static flxDataType_t type (bool *t)
485
- {
486
- return flxTypeBool;
487
- };
488
- static flxDataType_t type (int8_t *t)
489
- {
490
- return flxTypeInt8;
491
- };
492
- static flxDataType_t type (int16_t *t)
493
- {
494
- return flxTypeInt16;
495
- };
496
- static flxDataType_t type (int32_t *t)
497
- {
498
- return flxTypeInt32;
499
- };
500
- static flxDataType_t type (uint8_t *t)
501
- {
502
- return flxTypeUInt8;
503
- };
504
- static flxDataType_t type (uint16_t *t)
505
- {
506
- return flxTypeUInt16;
507
- };
508
- static flxDataType_t type (uint32_t *t)
509
- {
510
- return flxTypeUInt32;
511
- };
512
- static flxDataType_t type (float *t)
513
- {
514
- return flxTypeFloat;
515
- };
516
- static flxDataType_t type (double *t)
517
- {
518
- return flxTypeDouble;
519
- };
520
- static flxDataType_t type (std::string *t)
521
- {
522
- return flxTypeString;
523
- };
524
- static flxDataType_t type (char *t)
525
- {
526
- return flxTypeString;
527
- };
528
-
529
- // non pointer
530
- static flxDataType_t type (bool &t)
531
- {
532
- return type (&t);
533
- };
534
- static flxDataType_t type (int8_t &t)
535
- {
536
- return type (&t);
537
- };
538
- static flxDataType_t type (int16_t &t)
539
- {
540
- return type (&t);
541
- };
542
- static flxDataType_t type (int32_t &t)
543
- {
544
- return type (&t);
545
- };
546
- static flxDataType_t type (uint8_t &t)
547
- {
548
- return type (&t);
549
- };
550
- static flxDataType_t type (uint16_t &t)
551
- {
552
- return type (&t);
553
- };
554
- static flxDataType_t type (uint32_t &t)
555
- {
556
- return type (&t);
557
- };
558
- static flxDataType_t type (float &t)
559
- {
560
- return type (&t);
561
- };
562
- static flxDataType_t type (double &t)
563
- {
564
- return type (&t);
565
- };
566
- static flxDataType_t type (std::string &t)
567
- {
568
- return type (&t);
569
- };
570
- };
571
461
const char *flxGetTypeName (flxDataType_t type);
572
462
573
463
// ----------------------------------------------------------------------------------------
@@ -666,8 +556,7 @@ template <typename T> class flxDataArrayType : public flxDataArray
666
556
667
557
flxDataType_t type (void )
668
558
{
669
- T c = {0 };
670
- return flxDataTyper::type (c); // use the typer object - leverage overloading
559
+ return flxGetTypeOf<T>();
671
560
}
672
561
673
562
// --------------------------------------------------------------------
@@ -909,8 +798,7 @@ template <typename T> class _flxDataOut : public flxDataOut
909
798
// Type of property
910
799
flxDataType_t type (void )
911
800
{
912
- T c;
913
- return flxDataTyper::type (c);
801
+ return flxGetTypeOf<T>();
914
802
};
915
803
916
804
virtual T get (void ) const = 0;
@@ -1297,8 +1185,7 @@ template <typename T> class _flxDataIn : public flxDataIn
1297
1185
1298
1186
flxDataType_t type (void )
1299
1187
{
1300
- T c;
1301
- return flxDataTyper::type (c);
1188
+ return flxGetTypeOf<T>();
1302
1189
};
1303
1190
virtual void set (T const &value) = 0;
1304
1191
0 commit comments