xsens_janitors.h
Go to the documentation of this file.
1 
2 // Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification,
6 // are permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice,
9 // this list of conditions, and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice,
12 // this list of conditions, and the following disclaimer in the documentation
13 // and/or other materials provided with the distribution.
14 //
15 // 3. Neither the names of the copyright holders nor the names of their contributors
16 // may be used to endorse or promote products derived from this software without
17 // specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24 // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
26 // TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
28 // SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
29 // OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
30 // ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
31 //
32 
33 
34 // Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
35 // All rights reserved.
36 //
37 // Redistribution and use in source and binary forms, with or without modification,
38 // are permitted provided that the following conditions are met:
39 //
40 // 1. Redistributions of source code must retain the above copyright notice,
41 // this list of conditions, and the following disclaimer.
42 //
43 // 2. Redistributions in binary form must reproduce the above copyright notice,
44 // this list of conditions, and the following disclaimer in the documentation
45 // and/or other materials provided with the distribution.
46 //
47 // 3. Neither the names of the copyright holders nor the names of their contributors
48 // may be used to endorse or promote products derived from this software without
49 // specific prior written permission.
50 //
51 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
52 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
53 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
54 // THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 // SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
56 // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
58 // TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
59 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
60 // SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
61 // OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
62 // ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
63 //
64 
65 #ifndef XSENS_JANITORS_H
66 #define XSENS_JANITORS_H
67 
68 #ifndef __AVR32__
69  #include <functional>
70 #endif
71 
72 // required for gnu c++ compiler versions due to difference in attribute declarations
73 #if defined(__AVR32__)
74  #define __cdecl
75  #define __stdcall
76 #elif defined(_ADI_COMPILER)
77  #define __cdecl
78  #define __stdcall
79 #elif defined(__GNUC__) && !defined(HAVE_CDECL)
80  #if !defined(__cdecl)
81  #if defined(__x86_64__)
82  #define __cdecl
83  #else
84  #define __cdecl __attribute__((cdecl))
85  #endif
86  #endif
87  #if !defined(__stdcall)
88  #if defined(__x86_64__)
89  #define __stdcall
90  #else
91  #define __stdcall __attribute__((stdcall))
92  #endif
93  #endif
94 #endif
95 
96 namespace xsens
97 {
98 
99 #ifndef NOT_FOR_PUBLIC_RELEASE
100 
105 template <class T>
107 {
108 private:
111  bool m_enabled;
112 public:
113 
116  JanitorRestore<T>(T& control, bool enabl = true) :
117  m_control(control), m_value(control), m_enabled(enabl) {}
118 
122  {
123  if (m_enabled)
124  m_control = m_value;
125  }
126 
129  void disable(void)
130  {
131  m_enabled = false;
132  }
133 
136  void enable(void)
137  {
138  m_enabled = true;
139  }
140 };
141 
143 
147 template <class T>
149 {
150 private:
152  bool m_enabled;
153 public:
154 
157  JanitorFree<T>(T* control, bool enabl = true) :
158  m_control(control), m_enabled(enabl) {}
159 
163  {
164  if (m_enabled)
165  free(m_control);
166  }
167 
170  void disable(void)
171  {
172  m_enabled = false;
173  }
174 
177  void enable(void)
178  {
179  m_enabled = true;
180  }
181 };
182 
184 
188 template <class T>
190 {
191 private:
193  bool m_enabled;
194 public:
195 
199  m_control(NULL),
200  m_enabled(true)
201  {
202 
203  }
204 
207  JanitorDelete<T>(T* control, bool enabl = true) :
208  m_control(control),
209  m_enabled(enabl)
210  {
211 
212  }
213 
217  {
218  if (m_enabled)
219  delete m_control;
220  }
221 
225  void setControl(T* control)
226  {
227  m_control = control;
228  }
229 
232  void disable(void)
233  {
234  m_enabled = false;
235  }
236 
239  void enable(void)
240  {
241  m_enabled = true;
242  }
243 
246  const T* operator->() const
247  {
248  return m_control;
249  }
250 
254  {
255  return m_control;
256  }
257 };
258 
260 
264 template <class T>
266 {
267 private:
269  bool m_enabled;
270 public:
271 
274  JanitorDeleteNull<T>(T*& control, bool enabl = true) :
275  m_control(control),
276  m_enabled(enabl)
277  {
278 
279  }
280 
284  {
285  if (m_enabled)
286  {
287  delete m_control;
288  m_control = 0;
289  }
290  }
291 
294  void disable(void)
295  {
296  m_enabled = false;
297  }
298 
301  void enable(void)
302  {
303  m_enabled = true;
304  }
305 
308  const T* operator->() const
309  {
310  return m_control;
311  }
312 
316  {
317  return m_control;
318  }
319 };
320 
322 
326 template <class T>
328 {
329 private:
331  bool m_enabled;
332 public:
333 
336  JanitorDeleteArray<T>(T* control, bool enabl = true) :
337  m_control(control), m_enabled(enabl) {}
338 
342  {
343  if (m_enabled)
344  delete[] m_control;
345  }
346 
349  void disable(void)
350  {
351  m_enabled = false;
352  }
353 
356  void enable(void)
357  {
358  m_enabled = true;
359  }
360 };
361 #endif
362 
364 
368 template <class T, typename R = void>
370 {
371 public:
372  typedef R(T::*t_func_JanitorClassFunc)(void);
373 private:
375 
378  bool m_enabled;
379 public:
380 
383  JanitorClassFunc<T, R>(T& control, t_func_JanitorClassFunc func, bool enabl = true) :
384  m_control(control), m_funcJCF(func), m_enabled(enabl)
385  {
386  }
387 
391  {
392  if (m_enabled)
393  (m_control.*m_funcJCF)();
394  }
395 
398  void disable(void)
399  {
400  m_enabled = false;
401  }
402 
405  void enable(void)
406  {
407  m_enabled = true;
408  }
409 };
410 
412 
416 template <class T, typename P1, typename R = void>
418 {
419 public:
420  typedef R(T::*t_func_JanitorClassFunc)(P1);
421 private:
423 
427  bool m_enabled;
428 public:
429 
432  JanitorClassFuncP1<T, P1, R>(T& control, P1 p1, t_func_JanitorClassFunc func, bool enabl = true) :
433  m_control(control), m_param1(p1), m_funcJCF(func), m_enabled(enabl)
434  {
435  }
436 
440  {
441  if (m_enabled)
443  }
444 
447  void disable(void)
448  {
449  m_enabled = false;
450  }
451 
454  void enable(void)
455  {
456  m_enabled = true;
457  }
458 };
459 
460 #ifndef NOT_FOR_PUBLIC_RELEASE
461 
467 template <typename ResultType = void>
469 {
470 public:
471  typedef ResultType(__cdecl* t_func_JanitorFunc)(void);
472 private:
473  const JanitorFunc0& operator = (const JanitorFunc0&);
475  bool m_enabled;
476 public:
477 
480  JanitorFunc0<ResultType>(t_func_JanitorFunc func, bool enabl = true) :
481  m_funcJF(func), m_enabled(enabl) {}
482 
486  {
487  if (m_enabled)
488  (*m_funcJF)();
489  }
490 
493  void disable(void)
494  {
495  m_enabled = false;
496  }
497 
500  void enable(void)
501  {
502  m_enabled = true;
503  }
504 };
505 
506 #ifndef __AVR32__
507 
513 template <typename ResultType = void>
515 {
516 public:
517  typedef std::function<ResultType(void)> t_func_JanitorFunc;
518 private:
521  bool m_enabled;
522 public:
523 
527  m_funcJF(func), m_enabled(enabl) {}
528 
532  {
533  if (m_enabled)
534  m_funcJF();
535  }
536 
539  void disable(void)
540  {
541  m_enabled = false;
542  }
543 
546  void enable(void)
547  {
548  m_enabled = true;
549  }
550 };
551 #endif
552 
554 
559 template <class ParamType, typename ResultType = void>
561 {
562 public:
563  typedef ResultType(__cdecl* t_func_JanitorFunc)(ParamType);
564 private:
565  const JanitorFunc1& operator = (const JanitorFunc1&);
566  ParamType m_control;
568  bool m_enabled;
569 public:
570 
573  JanitorFunc1<ParamType, ResultType>(t_func_JanitorFunc func, ParamType control, bool enabl = true) :
574  m_control(control), m_funcJF(func), m_enabled(enabl) {}
575 
579  {
580  if (m_enabled)
581  (*m_funcJF)(m_control);
582  }
583 
586  void disable(void)
587  {
588  m_enabled = false;
589  }
590 
593  void enable(void)
594  {
595  m_enabled = true;
596  }
597 };
598 
600 
605 template <class ParamType, typename ResultType = void>
607 {
608 public:
609  typedef ResultType(__cdecl* t_func_JanitorFunc)(ParamType);
610 private:
611  const JanitorFunc1R& operator = (const JanitorFunc1R&);
612  ParamType& m_control;
614  bool m_enabled;
615 public:
616 
619  JanitorFunc1R<ParamType, ResultType>(t_func_JanitorFunc func, ParamType& control, bool enabl = true) :
620  m_control(control), m_funcJF(func), m_enabled(enabl) {}
621 
625  {
626  if (m_enabled)
627  (*m_funcJF)(m_control);
628  }
629 
632  void disable(void)
633  {
634  m_enabled = false;
635  }
636 
639  void enable(void)
640  {
641  m_enabled = true;
642  }
643 };
644 
646 
651 template <class Param1Type, class Param2Type, typename ResultType = void>
653 {
654 public:
655  typedef ResultType(__cdecl* t_func_JanitorFunc)(Param1Type, Param2Type);
656 private:
657  const JanitorFunc2& operator = (const JanitorFunc2&);
658  Param1Type m_control1;
659  Param2Type m_control2;
661  bool m_enabled;
662 public:
663 
666  JanitorFunc2<Param1Type, Param2Type, ResultType>(t_func_JanitorFunc func, Param1Type control1, Param2Type control2, bool enabl = true) :
667  m_funcJF(func), m_control1(control1), m_control2(control2), m_enabled(enabl) {}
668 
672  {
673  if (m_enabled)
674  (*m_funcJF)(m_control1, m_control2);
675  }
676 
679  void disable(void)
680  {
681  m_enabled = false;
682  }
683 
686  void enable(void)
687  {
688  m_enabled = true;
689  }
690 };
691 
693 
698 template <class Param1Type, class Param2Type, typename ResultType = void>
700 {
701 public:
702  typedef ResultType(__cdecl* t_func_JanitorFunc)(Param1Type, Param2Type);
703 private:
704  const JanitorFunc2R& operator = (const JanitorFunc2R&);
705  Param1Type& m_control1;
706  Param2Type& m_control2;
708  bool m_enabled;
709 public:
710 
713  JanitorFunc2R<Param1Type, Param2Type, ResultType>(t_func_JanitorFunc func, Param1Type& control1, Param2Type& control2, bool enabl = true) :
714  m_funcJF(func), m_control1(control1), m_control2(control2), m_enabled(enabl) {}
715 
719  {
720  if (m_enabled)
721  (*m_funcJF)(m_control1, m_control2);
722  }
723 
726  void disable(void)
727  {
728  m_enabled = false;
729  }
730 
733  void enable(void)
734  {
735  m_enabled = true;
736  }
737 };
738 
740 
745 template <class T, class C, typename R = void>
747 {
748 public:
749  typedef R(__cdecl* t_func_JanitorLogFunc)(const char*, const char*, ...);
750 private:
753  const char* m_filter;
754  const char* m_str;
755  const char* m_functionName;
757  bool m_enabled;
758 public:
759 
762  JanitorLogFunc<T, C, R>(t_func_JanitorLogFunc func, const char* filter, const char* str, const char* functionName, T& control, bool enable = true) :
763  m_funcJF(func), m_filter(filter), m_str(str), m_functionName(functionName), m_control(control), m_enabled(enable)
764  {}
765 
768  JanitorLogFunc<T, C, R>(t_func_JanitorLogFunc func, const char* filter, const char* str, T& control, bool enable = true) :
769  m_funcJF(func), m_filter(filter), m_str(str), m_functionName(0), m_control(control), m_enabled(enable) {}
770 
774  {
775  if (m_enabled)
776  {
777  if (m_functionName)
778  (*m_funcJF)(m_filter, m_str, m_functionName, (C) m_control);
779  else
780  (*m_funcJF)(m_filter, m_str, (C) m_control);
781  }
782  }
783 
786  void disable(void)
787  {
788  m_enabled = false;
789  }
790 
793  void enable(void)
794  {
795  m_enabled = true;
796  }
797 };
798 
800 
804 template <typename R = void>
806 {
807 public:
808  typedef R(__cdecl* t_func_JanitorSimpleLogFunc)(const char*, const char*, ...);
809 private:
812  const char* m_filter;
813  const char* m_str;
814  const char* m_functionName;
815  bool m_enabled;
816 public:
817 
820  JanitorSimpleLogFunc<R>(t_func_JanitorSimpleLogFunc func, const char* filter, const char* str, const char* functionName, bool enable = true) :
821  m_funcJF(func), m_filter(filter), m_str(str), m_functionName(functionName), m_enabled(enable)
822  {}
823 
826  JanitorSimpleLogFunc<R>(t_func_JanitorSimpleLogFunc func, const char* filter, const char* str, bool enable = true) :
827  m_funcJF(func), m_filter(filter), m_str(str), m_functionName(0), m_enabled(enable) {}
828 
832  {
833  if (m_enabled)
834  {
835  if (m_functionName)
836  (*m_funcJF)(m_filter, m_str, m_functionName);
837  else
838  (*m_funcJF)(m_filter, m_str);
839  }
840  }
841 
844  void disable(void)
845  {
846  m_enabled = false;
847  }
848 
851  void enable(void)
852  {
853  m_enabled = true;
854  }
855 };
856 
858 
863 template <class ParamType, typename ResultType = void>
865 {
866 public:
867 #ifndef __ANDROID_API__
868  typedef ResultType(__stdcall* t_func_JanitorFuncStdCall)(ParamType);
869 #else
870  typedef ResultType(*t_func_JanitorFuncStdCall)(ParamType);
871 #endif
872 private:
874  ParamType& m_control;
876  bool m_enabled;
877 public:
878 
881  JanitorFuncStdCall<ParamType, ResultType>(t_func_JanitorFuncStdCall func, ParamType& control, bool enabl = true) :
882  m_funcJFSC(func), m_control(control), m_enabled(enabl) {}
883 
887  {
888  if (m_enabled)
889  (*m_funcJFSC)(m_control);
890  }
891 
894  void disable(void)
895  {
896  m_enabled = false;
897  }
898 
901  void enable(void)
902  {
903  m_enabled = true;
904  }
905 };
906 
908 
912 template <class T>
914 {
915 private:
916  const JanitorSet& operator = (const JanitorSet&);
919  bool m_enabled;
920 public:
921 
924  JanitorSet<T>(T& control, const T& val, bool enabl = true) :
925  m_control(control), m_value(val), m_enabled(enabl) {}
926 
930  {
931  if (m_enabled)
932  m_control = m_value;
933  }
934 
937  void disable(void)
938  {
939  m_enabled = false;
940  }
941 
944  void enable(void)
945  {
946  m_enabled = true;
947  }
948 };
949 
950 
952 
956 template <typename T>
958 {
959 public:
963  static void Deallocate(T* p)
964  {
965  delete p;
966  }
967 protected:
972 };
973 
978 template <typename T>
980 {
981 public:
985  static void Deallocate(T* p)
986  {
987  free(p);
988  }
989 protected:
994 };
995 
1000 template <class T, template <class> class DeallocationPolicy>
1002 {
1003 public:
1005  typedef T ElementType;
1006  typedef void (*PostDeallocateFunc)();
1007 
1010  JanitorRCDeallocation(ElementType* target = 0, bool enabled = true)
1011  : m_target(target)
1012  , m_refCounter(0)
1013  , m_enabled(enabled)
1014  {
1015  addRef();
1016  }
1017 
1020  JanitorRCDeallocation(const ThisType& j, bool enabled = true)
1021  : m_target(j.m_target)
1023  , m_enabled(enabled)
1024  {
1025  addRef();
1026  }
1027 
1031  {
1032  removeRef();
1033  }
1034 
1040  {
1041  if (m_target != rhs.m_target)
1042  {
1043  removeRef();
1044  m_target = rhs.m_target;
1045  m_refCounter = rhs.m_refCounter;
1046  addRef();
1047  }
1048  return *this;
1049  }
1053  {
1054  return m_target;
1055  }
1056 
1060  {
1061  return *m_target;
1062  }
1063 
1066  void disable(void)
1067  {
1068  m_enabled = false;
1069  }
1070 
1073  void enable(void)
1074  {
1075  m_enabled = true;
1076  }
1077 
1080  ElementType* get() const throw()
1081  {
1082  return m_target;
1083  }
1084 
1088  void swap(JanitorRCDeallocation& other) throw()
1089  {
1090  using std::swap;
1091  swap(m_target, other.m_target);
1092  swap(m_refCounter, other.m_refCounter);
1093  swap(m_enabled, other.m_enabled);
1094  }
1095 #ifndef SWIG
1096 
1100  inline friend void swap(JanitorRCDeallocation& first, JanitorRCDeallocation& second)
1101  {
1102  first.swap(second);
1103  }
1104 #endif
1105 
1110  void reset(ElementType* p = 0) throw()
1111  {
1112  if (m_target != p)
1113  ThisType(p).swap(*this);
1114  }
1115 
1116 private:
1117 
1121  void addRef(void)
1122  {
1123  if (m_target)
1124  {
1125  if (!m_refCounter)
1126  m_refCounter = new int(0);
1127  (*m_refCounter)++;
1128  }
1129  }
1130 
1134  void removeRef(void)
1135  {
1136  if (m_refCounter)
1137  {
1138  if (*m_refCounter > 1)
1139  (*m_refCounter)--;
1140  else
1141  {
1142  delete m_refCounter;
1143  DeallocationPolicy<ElementType>::Deallocate(m_target);
1144  }
1145  }
1146  }
1147 
1151 };
1152 
1155 template <class T, template <class> class DeallocationPolicy = JanitorRCDeallocationPolicy_Free>
1156 class JanitorRCFree : public JanitorRCDeallocation<T, DeallocationPolicy>
1157 {
1158 public:
1159 
1162  JanitorRCFree(T* target = 0, bool enabled = true): JanitorRCDeallocation<T, DeallocationPolicy>(target, enabled) {}
1163 };
1164 
1167 template <class T, template <class> class DeallocationPolicy = JanitorRCDeallocationPolicy_Delete>
1168 class JanitorRCDelete : public JanitorRCDeallocation<T, DeallocationPolicy>
1169 {
1170 public:
1171 
1174  JanitorRCDelete(T* target = 0, bool enabled = true): JanitorRCDeallocation<T, DeallocationPolicy>(target, enabled) {}
1175 };
1176 
1177 #endif
1178 
1179 }
1180 
1181 #endif
xsens::JanitorStdFunc0::~JanitorStdFunc0
~JanitorStdFunc0()
Destructor.
Definition: xsens_janitors.h:531
xsens::JanitorFunc2R::operator=
const JanitorFunc2R & operator=(const JanitorFunc2R &)
xsens::JanitorStdFunc0::disable
void disable(void)
Disables the function calling.
Definition: xsens_janitors.h:539
xsens::JanitorStdFunc0::t_func_JanitorFunc
std::function< ResultType(void)> t_func_JanitorFunc
A function prototype for a janitor function.
Definition: xsens_janitors.h:517
xsens::JanitorFree::enable
void enable(void)
Enables the memory releasing.
Definition: xsens_janitors.h:177
xsens::JanitorFunc1::t_func_JanitorFunc
ResultType(__cdecl * t_func_JanitorFunc)(ParamType)
A function prototype for a janitor function.
Definition: xsens_janitors.h:563
xsens::JanitorRCDeallocationPolicy_Delete
Reference counting janitor class.
Definition: xsens_janitors.h:957
xsens::JanitorRCDeallocation::disable
void disable(void)
Disables the reference counting.
Definition: xsens_janitors.h:1066
xsens::JanitorSet::disable
void disable(void)
Disables the value restoring.
Definition: xsens_janitors.h:937
xsens::JanitorClassFunc
Class function calling janitor class.
Definition: xsens_janitors.h:369
xsens::JanitorDeleteArray::~JanitorDeleteArray
~JanitorDeleteArray()
Destructor.
Definition: xsens_janitors.h:341
xsens::JanitorFunc2R::~JanitorFunc2R
~JanitorFunc2R()
Destructor.
Definition: xsens_janitors.h:718
xsens::JanitorFunc2::disable
void disable(void)
Disables the function calling.
Definition: xsens_janitors.h:679
xsens::JanitorSimpleLogFunc::m_enabled
bool m_enabled
Definition: xsens_janitors.h:815
xsens::JanitorFunc0::t_func_JanitorFunc
ResultType(__cdecl * t_func_JanitorFunc)(void)
A function prototype for a janitor function.
Definition: xsens_janitors.h:471
xsens::JanitorRCDeallocation::~JanitorRCDeallocation
virtual ~JanitorRCDeallocation()
Destructor.
Definition: xsens_janitors.h:1030
xsens::JanitorFunc1::operator=
const JanitorFunc1 & operator=(const JanitorFunc1 &)
xsens::JanitorRCDeallocation::addRef
void addRef(void)
Adds a reference to a reference counter.
Definition: xsens_janitors.h:1121
xsens::JanitorRCDeallocation
Reference counting janitor class.
Definition: xsens_janitors.h:1001
xsens::JanitorDeleteNull::~JanitorDeleteNull
~JanitorDeleteNull()
Destructor.
Definition: xsens_janitors.h:283
xsens::JanitorDelete::operator->
const T * operator->() const
Definition: xsens_janitors.h:246
xsens::JanitorFunc1R::disable
void disable(void)
Disables the function calling.
Definition: xsens_janitors.h:632
xsens::JanitorFunc1::enable
void enable(void)
Enables the function calling.
Definition: xsens_janitors.h:593
xsens::JanitorLogFunc
Log / printf-like function calling janitor class.
Definition: xsens_janitors.h:746
xsens::JanitorRCDeallocation::swap
friend void swap(JanitorRCDeallocation &first, JanitorRCDeallocation &second)
Swaps the two object's variables.
Definition: xsens_janitors.h:1100
xsens::JanitorDelete::setControl
void setControl(T *control)
Sets the control object.
Definition: xsens_janitors.h:225
xsens::JanitorFunc1::m_funcJF
t_func_JanitorFunc m_funcJF
Definition: xsens_janitors.h:567
xsens::JanitorRCDeallocation::ElementType
T ElementType
A type definition for an element type.
Definition: xsens_janitors.h:1005
xsens::JanitorClassFuncP1::m_param1
P1 m_param1
Definition: xsens_janitors.h:425
xsens::JanitorFunc1R
Function calling janitor class for function with 1 reference parameter.
Definition: xsens_janitors.h:606
xsens::JanitorRestore::m_control
T & m_control
Definition: xsens_janitors.h:109
xsens::JanitorRestore::m_enabled
bool m_enabled
Definition: xsens_janitors.h:111
xsens::JanitorSimpleLogFunc::m_filter
const char * m_filter
Definition: xsens_janitors.h:812
xsens::JanitorFunc1R::m_control
ParamType & m_control
Definition: xsens_janitors.h:612
xsens::JanitorRCFree::JanitorRCFree
JanitorRCFree(T *target=0, bool enabled=true)
Constructor.
Definition: xsens_janitors.h:1162
xsens::JanitorDelete::m_enabled
bool m_enabled
Definition: xsens_janitors.h:193
xsens::JanitorLogFunc::operator=
const JanitorLogFunc & operator=(const JanitorLogFunc &)
xsens::JanitorFunc1R::m_enabled
bool m_enabled
Definition: xsens_janitors.h:614
xsens::JanitorLogFunc::enable
void enable(void)
Enables the log function calling.
Definition: xsens_janitors.h:793
xsens::JanitorClassFunc::~JanitorClassFunc
~JanitorClassFunc()
Destructor.
Definition: xsens_janitors.h:390
xsens::JanitorSet::m_enabled
bool m_enabled
Definition: xsens_janitors.h:919
xsens::JanitorFree::m_enabled
bool m_enabled
Definition: xsens_janitors.h:152
xsens::JanitorRCDeallocation::operator*
ElementType & operator*() const
Definition: xsens_janitors.h:1059
xsens::JanitorLogFunc::m_enabled
bool m_enabled
Definition: xsens_janitors.h:757
xsens::JanitorFuncStdCall::~JanitorFuncStdCall
~JanitorFuncStdCall()
Destructor.
Definition: xsens_janitors.h:886
xsens::JanitorRestore::m_value
T m_value
Definition: xsens_janitors.h:110
xsens::JanitorFunc0
Function calling janitor class for function with 0 parameters.
Definition: xsens_janitors.h:468
xsens::JanitorClassFunc::enable
void enable(void)
Enables the function calling.
Definition: xsens_janitors.h:405
xsens::JanitorFunc0::m_funcJF
t_func_JanitorFunc m_funcJF
Definition: xsens_janitors.h:474
xsens::JanitorFunc1R::~JanitorFunc1R
~JanitorFunc1R()
Destructor.
Definition: xsens_janitors.h:624
xsens::JanitorLogFunc::m_funcJF
t_func_JanitorLogFunc m_funcJF
Definition: xsens_janitors.h:752
xsens::JanitorRestore::disable
void disable(void)
Disables the value restoring.
Definition: xsens_janitors.h:129
xsens::JanitorFunc2R::m_funcJF
t_func_JanitorFunc m_funcJF
Definition: xsens_janitors.h:707
xsens::JanitorRCDeallocationPolicy_Delete::~JanitorRCDeallocationPolicy_Delete
~JanitorRCDeallocationPolicy_Delete()
Destructor.
Definition: xsens_janitors.h:971
xsens::JanitorFunc2R::m_control1
Param1Type & m_control1
Definition: xsens_janitors.h:705
xsens::JanitorRCDeallocation::m_target
ElementType * m_target
Definition: xsens_janitors.h:1148
xsens::JanitorRCDeallocation::ThisType
JanitorRCDeallocation< T, DeallocationPolicy > ThisType
A type definition for this type.
Definition: xsens_janitors.h:1004
xsens::JanitorRestore::~JanitorRestore
~JanitorRestore()
Destructor.
Definition: xsens_janitors.h:121
xsens::JanitorFunc1R::m_funcJF
t_func_JanitorFunc m_funcJF
Definition: xsens_janitors.h:613
xsens::JanitorLogFunc::m_filter
const char * m_filter
Definition: xsens_janitors.h:753
xsens::JanitorSet::operator=
const JanitorSet & operator=(const JanitorSet &)
xsens::JanitorClassFuncP1::m_enabled
bool m_enabled
Definition: xsens_janitors.h:427
xsens::JanitorSimpleLogFunc::m_str
const char * m_str
Definition: xsens_janitors.h:813
xsens::JanitorFuncStdCall::m_funcJFSC
t_func_JanitorFuncStdCall m_funcJFSC
Definition: xsens_janitors.h:875
xsens::JanitorDelete::operator->
T * operator->()
Definition: xsens_janitors.h:253
xsens::JanitorSet::enable
void enable(void)
Enables the value restoring.
Definition: xsens_janitors.h:944
xsens::JanitorLogFunc::m_str
const char * m_str
Definition: xsens_janitors.h:754
xsens::JanitorRCDeallocationPolicy_Free
Reference counting janitor class.
Definition: xsens_janitors.h:979
xsens::JanitorLogFunc::disable
void disable(void)
Disables the log function calling.
Definition: xsens_janitors.h:786
xsens::JanitorRCDeallocation::removeRef
void removeRef(void)
Removes a reference from a reference counter.
Definition: xsens_janitors.h:1134
xsens::JanitorFuncStdCall::m_enabled
bool m_enabled
Definition: xsens_janitors.h:876
xsens::JanitorFunc2::m_control1
Param1Type m_control1
Definition: xsens_janitors.h:658
xsens::JanitorClassFuncP1::m_funcJCF
t_func_JanitorClassFunc m_funcJCF
Definition: xsens_janitors.h:426
xsens::JanitorDeleteNull::operator->
const T * operator->() const
Definition: xsens_janitors.h:308
xsens::JanitorStdFunc0::operator=
const JanitorStdFunc0 & operator=(const JanitorStdFunc0 &)
xsens::JanitorFunc2::m_control2
Param2Type m_control2
Definition: xsens_janitors.h:659
xsens::JanitorFunc0::enable
void enable(void)
Enables the function calling.
Definition: xsens_janitors.h:500
xsens::JanitorClassFuncP1::m_control
T & m_control
Definition: xsens_janitors.h:424
xsens::JanitorClassFunc::m_control
T & m_control
Definition: xsens_janitors.h:376
xsens::JanitorClassFuncP1
Class function calling janitor class with a parameter.
Definition: xsens_janitors.h:417
xsens::JanitorSimpleLogFunc
Log / printf-like function calling janitor class.
Definition: xsens_janitors.h:805
xsens::JanitorClassFunc::m_enabled
bool m_enabled
Definition: xsens_janitors.h:378
xsens::JanitorRCDeallocation::JanitorRCDeallocation
JanitorRCDeallocation(const ThisType &j, bool enabled=true)
Constructor with this type.
Definition: xsens_janitors.h:1020
xsens::JanitorStdFunc0::enable
void enable(void)
Enables the function calling.
Definition: xsens_janitors.h:546
xsens::JanitorClassFuncP1::operator=
const JanitorClassFuncP1 & operator=(const JanitorClassFuncP1 &)
xsens::JanitorClassFuncP1::~JanitorClassFuncP1
~JanitorClassFuncP1()
Destructor.
Definition: xsens_janitors.h:439
xsens::JanitorFunc1::disable
void disable(void)
Disables the function calling.
Definition: xsens_janitors.h:586
xsens::JanitorRCDeallocation::get
ElementType * get() const
Definition: xsens_janitors.h:1080
xsens::JanitorFunc2::t_func_JanitorFunc
ResultType(__cdecl * t_func_JanitorFunc)(Param1Type, Param2Type)
A function prototype for a janitor function.
Definition: xsens_janitors.h:655
xsens::JanitorRCDeallocation::reset
void reset(ElementType *p=0)
Swaps an element type with this type.
Definition: xsens_janitors.h:1110
xsens::JanitorDeleteArray::enable
void enable(void)
Enables the memory releasing.
Definition: xsens_janitors.h:356
xsens::JanitorSimpleLogFunc::operator=
const JanitorSimpleLogFunc & operator=(const JanitorSimpleLogFunc &)
xsens::JanitorDelete::disable
void disable(void)
Disables the memory releasing.
Definition: xsens_janitors.h:232
xsens::JanitorDelete::~JanitorDelete
~JanitorDelete()
Destructor.
Definition: xsens_janitors.h:216
xsens::JanitorFuncStdCall::enable
void enable(void)
Enables the function calling.
Definition: xsens_janitors.h:901
xsens::JanitorFuncStdCall::disable
void disable(void)
Disables the function calling.
Definition: xsens_janitors.h:894
xsens::JanitorFunc2::~JanitorFunc2
~JanitorFunc2()
Destructor.
Definition: xsens_janitors.h:671
xsens::JanitorClassFunc::operator=
const JanitorClassFunc & operator=(const JanitorClassFunc &)
xsens::JanitorFunc0::disable
void disable(void)
Disables the function calling.
Definition: xsens_janitors.h:493
xsens::JanitorFunc1R::t_func_JanitorFunc
ResultType(__cdecl * t_func_JanitorFunc)(ParamType)
A function prototype for a janitor function.
Definition: xsens_janitors.h:609
xsens::JanitorFunc2::m_funcJF
t_func_JanitorFunc m_funcJF
Definition: xsens_janitors.h:660
xsens::JanitorFunc1R::operator=
const JanitorFunc1R & operator=(const JanitorFunc1R &)
xsens::JanitorRCDelete::JanitorRCDelete
JanitorRCDelete(T *target=0, bool enabled=true)
Constructor.
Definition: xsens_janitors.h:1174
xsens::JanitorLogFunc::m_functionName
const char * m_functionName
Definition: xsens_janitors.h:755
xsens::JanitorStdFunc0::m_enabled
bool m_enabled
Definition: xsens_janitors.h:521
xsens::JanitorStdFunc0::m_funcJF
t_func_JanitorFunc m_funcJF
Definition: xsens_janitors.h:520
xsens::JanitorDelete::enable
void enable(void)
Enables the memory releasing.
Definition: xsens_janitors.h:239
xsens::JanitorDelete
Memory releasing janitor class.
Definition: xsens_janitors.h:189
xsens::JanitorClassFunc::disable
void disable(void)
Disables the function calling.
Definition: xsens_janitors.h:398
xsens::JanitorRCDeallocationPolicy_Free::Deallocate
static void Deallocate(T *p)
Deallocates (frees) a pointer to an object.
Definition: xsens_janitors.h:985
xsens::JanitorFree::~JanitorFree
~JanitorFree()
Destructor.
Definition: xsens_janitors.h:162
xsens::JanitorStdFunc0
Function calling janitor class for std::function with 0 parameters.
Definition: xsens_janitors.h:514
xsens::JanitorFuncStdCall::operator=
const JanitorFuncStdCall & operator=(const JanitorFuncStdCall &)
xsens::JanitorFuncStdCall
Function calling janitor class.
Definition: xsens_janitors.h:864
xsens::JanitorSimpleLogFunc::~JanitorSimpleLogFunc
~JanitorSimpleLogFunc()
Destructor.
Definition: xsens_janitors.h:831
xsens::JanitorRCDeallocation::enable
void enable(void)
Enables the reference counting.
Definition: xsens_janitors.h:1073
xsens::JanitorSimpleLogFunc::m_functionName
const char * m_functionName
Definition: xsens_janitors.h:814
xsens::JanitorFunc2::enable
void enable(void)
Enables the function calling.
Definition: xsens_janitors.h:686
xsens::JanitorSet
Value restoring janitor class.
Definition: xsens_janitors.h:913
xsens::JanitorSet::~JanitorSet
~JanitorSet()
Destructor.
Definition: xsens_janitors.h:929
xsens::JanitorFunc2
Function calling janitor class for function with 2 parameters.
Definition: xsens_janitors.h:652
xsens::JanitorDelete::m_control
T * m_control
Definition: xsens_janitors.h:192
xsens::JanitorRCFree
A reference counter memory releasing janitor class.
Definition: xsens_janitors.h:1156
xsens::JanitorSimpleLogFunc::m_funcJF
t_func_JanitorSimpleLogFunc m_funcJF
Definition: xsens_janitors.h:811
xsens::JanitorRCDeallocation::m_refCounter
int * m_refCounter
Definition: xsens_janitors.h:1149
xsens::JanitorFunc1::m_enabled
bool m_enabled
Definition: xsens_janitors.h:568
xsens::JanitorDeleteArray
Memory releasing janitor class.
Definition: xsens_janitors.h:327
xsens::JanitorFunc2R
Function calling janitor class for function with 2 reference parameters.
Definition: xsens_janitors.h:699
xsens::JanitorSet::m_control
T & m_control
Definition: xsens_janitors.h:917
xsens::JanitorRCDeallocation::JanitorRCDeallocation
JanitorRCDeallocation(ElementType *target=0, bool enabled=true)
Constructor with an element type.
Definition: xsens_janitors.h:1010
xsens::JanitorFree
Memory releasing janitor class.
Definition: xsens_janitors.h:148
xsens::JanitorFree::m_control
T * m_control
Definition: xsens_janitors.h:151
xsens::JanitorDeleteNull::operator->
T * operator->()
Definition: xsens_janitors.h:315
xsens::JanitorRCDelete
A reference counter memory releasing janitor class.
Definition: xsens_janitors.h:1168
xsens::JanitorClassFunc::m_funcJCF
t_func_JanitorClassFunc m_funcJCF
Definition: xsens_janitors.h:377
xsens::JanitorFree::disable
void disable(void)
Disables the memory releasing.
Definition: xsens_janitors.h:170
xsens::JanitorSet::m_value
T m_value
Definition: xsens_janitors.h:918
xsens::JanitorSimpleLogFunc::disable
void disable(void)
Disables the log function calling.
Definition: xsens_janitors.h:844
xsens::JanitorFunc1::~JanitorFunc1
~JanitorFunc1()
Destructor.
Definition: xsens_janitors.h:578
xsens::JanitorFuncStdCall::t_func_JanitorFuncStdCall
ResultType(__stdcall * t_func_JanitorFuncStdCall)(ParamType)
A function prototype for a calling janitor function.
Definition: xsens_janitors.h:868
xsens::JanitorLogFunc::m_control
T & m_control
Definition: xsens_janitors.h:756
xsens::JanitorRCDeallocation::m_enabled
bool m_enabled
Definition: xsens_janitors.h:1150
xsens::JanitorFunc0::operator=
const JanitorFunc0 & operator=(const JanitorFunc0 &)
xsens::JanitorClassFuncP1::t_func_JanitorClassFunc
R(T::* t_func_JanitorClassFunc)(P1)
A function prototype for a janitor class.
Definition: xsens_janitors.h:420
xsens::JanitorFunc2::operator=
const JanitorFunc2 & operator=(const JanitorFunc2 &)
xsens::JanitorFunc1::m_control
ParamType m_control
Definition: xsens_janitors.h:566
xsens::JanitorLogFunc::~JanitorLogFunc
~JanitorLogFunc()
Destructor.
Definition: xsens_janitors.h:773
xsens::JanitorDeleteNull::disable
void disable(void)
Disables the memory releasing and nulling.
Definition: xsens_janitors.h:294
xsens::JanitorRCDeallocation::operator->
ElementType * operator->() const
Definition: xsens_janitors.h:1052
xsens::JanitorSimpleLogFunc::enable
void enable(void)
Enables the log function calling.
Definition: xsens_janitors.h:851
xsens::JanitorDeleteArray::disable
void disable(void)
Disables the memory releasing.
Definition: xsens_janitors.h:349
xsens::JanitorDeleteNull
Memory releasing and nulling janitor class.
Definition: xsens_janitors.h:265
xsens::JanitorFunc2R::m_enabled
bool m_enabled
Definition: xsens_janitors.h:708
xsens::JanitorSimpleLogFunc::t_func_JanitorSimpleLogFunc
R(__cdecl * t_func_JanitorSimpleLogFunc)(const char *, const char *,...)
A function prototype for a janitor simple log function.
Definition: xsens_janitors.h:808
xsens::JanitorClassFuncP1::enable
void enable(void)
Enable the function calling.
Definition: xsens_janitors.h:454
xsens::JanitorFunc1R::enable
void enable(void)
Enables the function calling.
Definition: xsens_janitors.h:639
xsens::JanitorRCDeallocation::swap
void swap(JanitorRCDeallocation &other)
Swaps the current object's variables with an other object's variables.
Definition: xsens_janitors.h:1088
xsens::JanitorDeleteNull::m_control
T *& m_control
Definition: xsens_janitors.h:268
xsens::JanitorDeleteNull::m_enabled
bool m_enabled
Definition: xsens_janitors.h:269
xsens::JanitorFunc1
Function calling janitor class for function with 1 parameter.
Definition: xsens_janitors.h:560
xsens::JanitorRCDeallocationPolicy_Free::~JanitorRCDeallocationPolicy_Free
~JanitorRCDeallocationPolicy_Free()
Destructor.
Definition: xsens_janitors.h:993
xsens::JanitorFunc0::m_enabled
bool m_enabled
Definition: xsens_janitors.h:475
xsens::JanitorRCDeallocation::operator=
JanitorRCDeallocation & operator=(const JanitorRCDeallocation &rhs)
Copy the data from rhs.
Definition: xsens_janitors.h:1039
xsens::JanitorFunc2R::disable
void disable(void)
Disables the function calling.
Definition: xsens_janitors.h:726
xsens::JanitorFunc2::m_enabled
bool m_enabled
Definition: xsens_janitors.h:661
xsens::JanitorDeleteArray::m_control
T * m_control
Definition: xsens_janitors.h:330
xsens::JanitorRCDeallocation::PostDeallocateFunc
void(* PostDeallocateFunc)()
A function prototype for a post deallocation function.
Definition: xsens_janitors.h:1006
xsens::JanitorRestore
Value restoring janitor class.
Definition: xsens_janitors.h:106
xsens
Definition: threading.cpp:78
xsens::JanitorLogFunc::t_func_JanitorLogFunc
R(__cdecl * t_func_JanitorLogFunc)(const char *, const char *,...)
A function prototype for a janitor log function.
Definition: xsens_janitors.h:749
xsens::JanitorFuncStdCall::m_control
ParamType & m_control
Definition: xsens_janitors.h:874
xsens::JanitorFunc2R::t_func_JanitorFunc
ResultType(__cdecl * t_func_JanitorFunc)(Param1Type, Param2Type)
A function prototype for a janitor function.
Definition: xsens_janitors.h:702
xsens::JanitorClassFunc::t_func_JanitorClassFunc
R(T::* t_func_JanitorClassFunc)(void)
A function prototype for a janitor class.
Definition: xsens_janitors.h:372
xsens::JanitorDeleteArray::m_enabled
bool m_enabled
Definition: xsens_janitors.h:331
xsens::JanitorClassFuncP1::disable
void disable(void)
Disables the function calling.
Definition: xsens_janitors.h:447
xsens::JanitorFunc0::~JanitorFunc0
~JanitorFunc0()
Destructor.
Definition: xsens_janitors.h:485
xsens::JanitorRCDeallocationPolicy_Delete::Deallocate
static void Deallocate(T *p)
Deallocates (deletes) a pointer to an object.
Definition: xsens_janitors.h:963
xsens::JanitorFunc2R::enable
void enable(void)
Enables the function calling.
Definition: xsens_janitors.h:733
xsens::JanitorRestore::enable
void enable(void)
Enables the value restoring.
Definition: xsens_janitors.h:136
xsens::JanitorDeleteNull::enable
void enable(void)
Enables the memory releasing and nulling.
Definition: xsens_janitors.h:301
xsens::JanitorFunc2R::m_control2
Param2Type & m_control2
Definition: xsens_janitors.h:706


xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:20