15 #if defined(AJA_WINDOWS) 16 extern void __cdecl log_odprintf(
const char *format, ...);
17 #elif defined (AJA_MAC) 18 #pragma GCC diagnostic ignored "-Wformat-security" 28 #if defined(AJA_WINDOWS) 30 #if defined(AJA_DEBUG) 35 #define AJA_ULOG(_unit_,...) 37 #elif (AJA_LOGTYPE==1) 38 #define AJA_LOG(...) log_odprintf(__VA_ARGS__) 39 #define AJA_ULOG(_unit_,...) \ 40 do {if (AJADebug::IsActive(_unit_)) log_odprintf(__VA_ARGS__);} while(0); 42 #elif (AJA_LOGTYPE==2) 43 #define AJA_LOG(...) AJA_REPORT(AJA_DebugUnit_Critical, AJA_DebugSeverity_Info, __VA_ARGS__) 44 #define AJA_ULOG(_unit_,...) \ 45 do {if (AJADebug::IsActive(_unit_)) AJA_REPORT(_unit_, AJA_DebugSeverity_Info, __VA_ARGS__);} while(0); 50 #define AJA_ULOG(_unit_,...) 56 #define AJA_ULOG(_unit_,...) 59 #elif defined(AJA_LINUX) || defined(AJA_MAC) 61 #if defined(AJA_DEBUG) 65 #define AJA_LOG(_format_...) 66 #define AJA_ULOG(_unit_, _format_...) 68 #elif (AJA_LOGTYPE==1) 71 #define AJA_LOG(_format_...) printf(_format_) 72 #define AJA_ULOG(_unit_, _format_...) \ 73 do {if (AJADebug::IsActive(_unit_)) printf(_format_);} while(0); 75 #elif (AJA_LOGTYPE==2) 76 #define AJA_LOG(_format_...) AJA_REPORT(AJA_DebugUnit_Critical, AJA_DebugSeverity_Info, _format_) 77 #define AJA_ULOG(_unit_, _format_...) \ 78 do {if (AJADebug::IsActive(_unit_)) AJA_REPORT(_unit_, AJA_DebugSeverity_Info, _format_);} while(0); 84 #define AJA_LOG(_format_...) 85 #define AJA_ULOG(_unit_, _format_...) 91 #define Make4CC(my4CC) ((my4CC < 0x40) ? ' ' : ((char*)(&my4CC))[3]), \ 92 ((my4CC < 0x40) ? ' ' : ((char*)(&my4CC))[2]), \ 93 ((my4CC < 0x40) ? ('0' + (char)(my4CC / 10)) : ((char*)(&my4CC))[1]), \ 94 ((my4CC < 0x40) ? ('0' + (char)(my4CC % 10)) : ((char*)(&my4CC))[0]) 116 static bool bInitialized;
146 { Resize(sampleSize); }
150 virtual void Resize(uint64_t sampleSize);
151 virtual void Reset();
153 void Mark(int64_t val);
155 int64_t MarkAverage(int64_t val);
157 uint64_t
Total() {
return _samplesTotal; }
177 virtual void Resize(uint64_t sampleSize);
178 virtual void Reset();
179 virtual void ResetTime();
181 int64_t MarkDeltaTime();
182 int64_t MarkDeltaAverage();
208 {
if (bEnable) PrintReset(); }
214 void PrintDelta(
bool bReset=
true);
215 void PrintDelta(
const char* addedTag,
bool bReset=
true);
216 void PrintDelta(uint64_t threashold,
const char* addedTag,
bool bReset);
218 inline void PrintDelta(
const std::string& addedTag,
bool bReset=
true)
219 { PrintDelta(addedTag.c_str(), bReset); }
227 {
if (bEnable) PrintDelta(bReset); }
228 inline void PrintDeltaIf(
bool bEnable,
const char* addedTag,
bool bReset=
true)
229 {
if (bEnable) PrintDelta(addedTag, bReset); }
230 inline void PrintDeltaIf(
bool bEnable,
const std::string& addedTag,
bool bReset=
true)
231 { PrintDeltaIf(bEnable, addedTag.c_str(), bReset); }
237 int32_t GetDelta(
bool bReset=
true);
239 {
return (int32_t)_lastDelta; }
241 {
return (int32_t)(_lastDelta/1000); }
247 void PrintValue(int64_t val);
248 void PrintValue(int64_t val,
const char* addedTag);
249 inline void PrintValue(int64_t val,
const std::string& addedTag)
250 { PrintValue(val, addedTag.c_str()); }
252 void Print(
const char* str);
254 { Print(str.c_str()); }
virtual void Resize(uint64_t sampleSize)
std::vector< int64_t > _samples
void PrintValue(int64_t val, const std::string &addedTag)
Declares the AJADebug class.
void PrintDeltaIf(bool bEnable, const char *addedTag, bool bReset=true)
void PrintResetIf(bool bEnable=true)
void PrintDelta(const std::string &addedTag, bool bReset=true)
Master header for the ajabase library.
AJARunAverage(uint64_t sampleSize)
void PrintDeltaIf(bool bEnable, bool bReset=true)
void SetTag(const char *tag)
void PrintDeltaIf(bool bEnable, const std::string &addedTag, bool bReset=true)
void Print(const std::string &str)
virtual ~AJARunTimeAverage()