FLImaging 6.5.13.1
FLBase.h
1#pragma once
2
11#include <stdint.h>
12#include <type_traits>
13#include <typeinfo>
14
15#include "FLLibTags.h"
16#include "DefinitionsBase.h"
17
19namespace FLImaging
20{
22 namespace Base
23 {
24 class CFLBaseInternal;
25 class CProcessingUnitBase;
26 class CBroadcastMessage;
27
35 class FL_EXPORT CFLBase
36 {
37 SupportToDuplicateAbstractObject(CFLBase);
38
39 public:
48
56 virtual ~CFLBase();
57
58
66 void Lock() const;
67
77 bool TryLock() const;
78
86 void Unlock() const;
87
99 virtual const CProcessingUnitBase* GetProcessingUnit() const;
100
117
134
142 virtual void ResetProcessingUnit();
143
153 virtual bool IsValid() const;
154
166 template <class T>
167 bool IsValid(T& tValue) const;
168
180 template <class T>
181 bool IsValid(T* pTValue) const;
182
192 template <class T>
193 void GenerateMin(T& tValue) const;
194
204 template <class T>
205 void GenerateMin(T* pTValue) const;
206
216 template <class T>
217 void GenerateMinInt32(T& tValue) const;
218
228 template <class T>
229 void GenerateMinInt32(T* pTValue) const;
230
240 template <class T>
241 void GenerateMinInt31(T& tValue) const;
242
252 template <class T>
253 void GenerateMinInt31(T* pTValue) const;
254
264 template <class T>
265 void GenerateMax(T& tValue) const;
266
276 template <class T>
277 void GenerateMax(T* pTValue) const;
278
288 template <class T>
289 void GenerateMaxInt32(T& tValue) const;
290
300 template <class T>
301 void GenerateMaxInt32(T* pTValue) const;
302
312 template <class T>
313 void GenerateMaxInt31(T& tValue) const;
314
324 template <class T>
325 void GenerateMaxInt31(T* pTValue) const;
326
336 template <class T>
337 void GenerateInvalid(T& tValue) const;
338
348 template <class T>
349 void GenerateInvalid(T* pTValue) const;
350
362 virtual void OnReceiveBroadcast(const CBroadcastMessage* pMessage);
363
373 virtual int64_t GetClassType() const = 0;
374
384 const char* GetClassNameWithNamespace() const;
385
395 const char* GetClassNameWithoutNamespace() const;
396
406 virtual uint32_t GetClassHash() const;
407
417 virtual bool IsLicenseAvailable() const;
418
432 const CResult ShareSynchronizationObject(const CFLBase* pSrcObject) const;
433
444
458 virtual void Throw(const CResult& res, const wchar_t* pWcsExtraMessage = nullptr) const;
459
473 virtual void Throw(const std::exception& res, const wchar_t* pWcsExtraMessage) const;
474
476 // For CLR
477 virtual size_t GetHandle() const;
478 virtual void SetHandle(size_t stHandle);
479
480 virtual size_t GetHandleType() const;
481 virtual void SetHandleType(size_t stHandleType);
483
484
485 private:
486
487 volatile CFLBaseInternal* m_pInternal;
488 };
489 }
490}
Broadcast message class.
Definition BroadcastMessage.h:27
Top-level base class of FLImaging.
Definition FLBase.h:36
virtual uint32_t GetClassHash() const
Returns the class hash value of the actual instance. For the same class, even if the instance is diff...
const CResult ShareSynchronizationObject(const CFLBase *pSrcObject) const
Share synchronization object of original object.
bool IsSharedSynchronizationObject() const
Is shared synchronization object.
void GenerateMaxInt31(T &tValue) const
Generate maximum signed 31-bit integer value.
virtual void ResetProcessingUnit()
Rest the ProcessingUnit.
void GenerateMin(T *pTValue) const
Generate the minimum value of that type.
const char * GetClassNameWithoutNamespace() const
Returns the class name that does not include the namespace of the actual instance.
virtual bool IsLicenseAvailable() const
Returns whether the algorithm can be used with the current license.
void Unlock() const
Unlock the object.
void GenerateMaxInt31(T *pTValue) const
Generate maximum signed 31-bit integer value.
virtual const CProcessingUnitBase * GetProcessingUnit() const
Returns the set ProcessingUnit.
void Lock() const
Set a lock on an object.
bool IsValid(T &tValue) const
Validate input values.
virtual void Throw(const std::exception &res, const wchar_t *pWcsExtraMessage) const
Raise an exception. Information and error codes of the object that occurred are recorded in the log.
void GenerateMaxInt32(T *pTValue) const
Generate maximum signed 32-bit integer value.
void GenerateInvalid(T *pTValue) const
Generate invalid value.
void GenerateMinInt32(T *pTValue) const
Generate minimum signed 32-bit integer value.
void GenerateInvalid(T &tValue) const
Generate invalid value.
virtual const CResult SetProcessingUnit(const CProcessingUnitBase *pPub)
Set the ProcessingUnit.
virtual int64_t GetClassType() const =0
Returns the Type value of Class. The returned value itself has no meaning, but if it is the same type...
virtual void Throw(const CResult &res, const wchar_t *pWcsExtraMessage=nullptr) const
Raise an exception. Information and error codes of the object that occurred are recorded in the log.
virtual void OnReceiveBroadcast(const CBroadcastMessage *pMessage)
Callback function. A function that receives a BroadcastMessage.
const char * GetClassNameWithNamespace() const
Returns the class name including the namespace of the actual instance.
void GenerateMax(T *pTValue) const
Generate the maximum value of that type.
virtual ~CFLBase()
Destructor.
void GenerateMaxInt32(T &tValue) const
Generate maximum signed 32-bit integer value.
void GenerateMinInt31(T &tValue) const
Generate minimum signed 31-bit integer value.
void GenerateMinInt32(T &tValue) const
Generate minimum signed 32-bit integer value.
bool IsValid(T *pTValue) const
Validate input values.
virtual const CResult SetProcessingUnit(const CProcessingUnitBase &pub)
set the ProcessingUnit
bool TryLock() const
Try to lock the object.
void GenerateMin(T &tValue) const
Generate the minimum value of that type.
void GenerateMax(T &tValue) const
Generate the maximum value of that type.
virtual bool IsValid() const
Validate the object.
CFLBase()
Default constructor.
void GenerateMinInt31(T *pTValue) const
Generate minimum signed 31-bit integer value.
Processing unit base class.
Definition ProcessingUnitBase.h:27
FLImaging module execution result object.
Definition ResultsDef.h:1514