16 class InstrumentInstance;
17 class ExceptionContainer;
33 template <
typename InstrumentT>
36 return std::make_shared<typename InstrumentT::ConfigType>();
46 template <
typename InstrumentT>
49 dynamic_Params_cast<InstrumentT>(Params.get())->InstrumentData = std::make_unique<typename InstrumentT::InstrumentDataType>();
51 return std::make_shared<InstrumentT>(OwnerThreadID, std::move(Params));
62 template <
typename TaskT,
typename... ArgTs>
63 std::unique_ptr<TaskT>
MakeTask(ArgTs&& ...Args)
65 return std::make_unique<TaskT>(std::forward<ArgTs>(Args)...);
164 void EnqueueTask(std::unique_ptr<TaskBase>&& Task,
bool CallFromInstrThread,
bool NotifyReceiver) {
Parent.
EnqueueTask(std::move(Task), CallFromInstrThread, NotifyReceiver); }
303 void EnqueueTask(std::unique_ptr<TaskBase>&& Task,
bool CallFromInstrThread,
bool NotifyReceiver);
313 void EnqueuePriorityTask(std::unique_ptr<TaskBase>&& Task,
bool CallFromInstrThread,
bool NotifyReceiver);
416 virtual const char*
GetParamClassTag() const noexcept
override {
return "InstrumentParamsBase"; }
511 constexpr
static auto Category() noexcept {
return "General"; }
536 virtual std::chrono::milliseconds
GetTaskQueueDelay()
const {
return std::chrono::milliseconds(std::chrono::milliseconds::max()); }
626 template <
typename TaskT,
typename... ArgTs>
629 auto Task = MakeTask<TaskT>(std::forward<ArgTs>(Args)...);
648 template <
typename DerivedInstrT,
typename... TaskFuncArgTs,
typename... ArgTs>
651 std::atomic<bool> FinishedFlag =
false;
653 auto CallbackFunc = [&FinishedFlag, &Exception](
const TaskBase& Task,
auto E) {
660 (
dynamic_cast<const DerivedInstrT&
>(*this).*TaskFunc)(std::forward<ArgTs>(Args)..., CallbackFunc);
662 while (!FinishedFlag)
663 std::this_thread::yield();
693 void ResetImpl(dispatch_tag<RunnableObject>)
override final;
712 std::exception_ptr
GetExceptionChild([[maybe_unused]] const std::chrono::milliseconds
Timeout) const override final;
742 virtual std::unique_ptr<InitTaskBase>
MakeInitTask()
const {
return nullptr; }
751 virtual std::unique_ptr<ExitTaskBase>
MakeExitTask()
const {
return nullptr; }
760 virtual std::unique_ptr<UpdateTaskBase>
MakeUpdateTask()
const {
return nullptr; }
807 template <
typename To,
typename From, std::enable_if_t<
808 std::is_same_v<InstrumentDataBase, std::remove_cv_t<From>>,
int> = 0
812 if (!InstrumentDataPtr)
816 std::conditional_t<std::is_const_v<From>, std::add_const_t<typename To::InstrumentDataType>,
typename To::InstrumentDataType>
817 >(std::move(InstrumentDataPtr));
1233 template <
typename... InstrTs>
1236 static_assert(std::conjunction_v<std::is_base_of<InstrumentBase, InstrTs>...>);
1237 static_assert(
sizeof...(InstrTs) > 0);
1238 static_assert(
sizeof...(InstrTs) <= std::latch::max());
1240 std::latch Latch(
sizeof...(InstrTs));
1241 std::array<std::reference_wrapper<const InstrumentBase>,
sizeof...(InstrTs)> Instrs{ Instruments... };
1243 for (
auto& Instr : Instrs)
1244 Instr.get().EnqueueArriveAtLatchTask(Latch);
Implementation of DynExp objects as the base for derived resources and implementation of the object p...
Defines a task which arrives at a std::latch when it is executed. This is useful to synchronize multi...
~ArriveAtLatchTask()
If the task has been aborted or never executed, the destructor arrives at the latch in order to avoid...
ArriveAtLatchTask(std::latch &Latch, CallbackType CallbackFunc=nullptr)
Constructs an instrument task.
bool HasArrived
Indicates whether the task has already arrived at the latch.
std::latch & Latch
Latch the task arrives at when it is executed.
virtual TaskResultType RunChild(InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
Default task which does not do anything. Though, calling it ensures that TaskBase::CallbackFunc gets ...
DefaultTask(CallbackType CallbackFunc) noexcept
Constructs an instrument task.
virtual TaskResultType RunChild(InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
Wrapper holding a pointer to an exception and providing functionality for accessing it....
auto GetException() const
Getter for Exception.
std::exception_ptr Exception
Exception stored in the wrapper.
void ClearError()
Removes the stored exception. If this method is called by a task's CallbackFunc in case of an excepti...
ExceptionContainer(const std::exception_ptr &Exception=nullptr) noexcept
Constructs an ExceptionContainer instance.
bool IsError() const
Checks whether the wrapper holds an exception.
void Throw() const
Throws the stored exception. Doesn't do anything if there isn't a stored exception.
Defines a task for deinitializing an instrument within an instrument inheritance hierarchy....
TaskResultType RunChild(InstrumentInstance &Instance) override final
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
virtual void ExitFuncImpl(dispatch_tag< ExitTaskBase >, InstrumentInstance &Instance)=0
Deinitializes the respective instrument within the instrument inheritance hierarchy....
Refer to DynExp::ParamsBase::dispatch_tag.
Defines a task for initializing an instrument within an instrument inheritance hierarchy....
virtual void InitFuncImpl(dispatch_tag< InitTaskBase >, InstrumentInstance &Instance)=0
Initializes the respective instrument within the instrument inheritance hierarchy....
TaskResultType RunChild(InstrumentInstance &Instance) override final
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
Refer to DynExp::ParamsBase::dispatch_tag.
Allow exclusive access to some of InstrumentBase's private methods to the instrument thread Instrumen...
constexpr InstrumenThreadOnlyType(InstrumentBase &Parent) noexcept
Construcs an instance - one for each InstrumentBase instance.
void UpdateData()
Inserts an update task (UpdateTaskBase) into the instrument's task queue. Override UpdateAdditionalDa...
InstrumentBase & Parent
Owning InstrumentBase instance.
void OnError()
Derived classes can perform critical shutdown actions after an error has occurred....
void SetInitialized()
Sets InstrumentBase::Initialized to true.
bool HandleTask(InstrumentInstance &Instance)
Executes and removes the next pending task from the instrument's task queue.
friend int InstrumentThreadMain(InstrumentInstance, InstrumentBase *const)
Instruments run in their own thread. This is the instrument thread's main function.
Base class for instruments. Instruments comprise virtual devices (meta instruments) and physial devic...
static auto GetExceptionUnsafe(const InstrumentDataTypeSyncPtrConstType &InstrumentDataPtr)
Getter for InstrumentDataBase::InstrumentException.
bool IsReadyChild() const override final
Returns wheter this Object instance is ready (e.g. it is running or connected to a hardware device) a...
void ResetImpl(dispatch_tag< RunnableObject >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
virtual bool UpdateAdditionalData()
Determines whether to enqueue update tasks (UpdateTaskBase).
InstrumentBase(const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params)
Constructs an instrument instance.
constexpr static auto Category() noexcept
Every derived class has to redefine this function.
bool HandleTask(InstrumentInstance &Instance)
Executes and removes the next pending task from the instrument's task queue.
virtual void ResetImpl(dispatch_tag< InstrumentBase >)=0
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
virtual std::unique_ptr< InitTaskBase > MakeInitTask() const
Factory function for an init task (InitTaskBase). Override to define the desired initialization task ...
void UpdateData() const
Enqueues an update task (instance of class UpdateTaskBase).
std::atomic< bool > Initialized
Determines whether the init task (InitTaskBase) has run.
void OnPrepareExit()
This function enables derived classes to enqueue tasks to be executed directly before the final exit ...
void EnqueueArriveAtLatchTask(std::latch &Latch) const
Enqueues a task which arrives at a latch when executed (instance of class ArriveAtLatchTask).
virtual std::unique_ptr< ExitTaskBase > MakeExitTask() const
Factory function for an exit task (ExitTaskBase). Override to define the desired deinitialization tas...
void MakeAndEnqueueTask(ArgTs &&...Args) const
Calls MakeTask() to construct a new task and subsequently enqueues the task into the instrument's tas...
virtual std::chrono::milliseconds GetTaskQueueDelay() const
Specifies in which time intervals the instrument's task queue runs to handle pending tasks.
virtual void OnPrepareExitChild() const
This function enables derived classes to enqueue tasks to be executed directly before the final exit ...
void UpdateDataInternal()
Inserts an update task (UpdateTaskBase) into the instrument's task queue. Override UpdateAdditionalDa...
static constexpr auto GetInstrumentDataTimeoutDefault
Determines the default timeout for GetInstrumentData() to lock the mutex synchronizing the instrument...
void TerminateChild(const std::chrono::milliseconds Timeout) override final
Signals derived classes that terminating the RunnableObject instance's thread is about to be requeste...
virtual void OnErrorChild() const
Derived classes can perform critical shutdown actions after an error has occurred....
void RunChild() override final
Refer to Run().
std::exception_ptr GetExceptionChild([[maybe_unused]] const std::chrono::milliseconds Timeout) const override final
InstrumentDataTypeSyncPtrType GetInstrumentData(const std::chrono::milliseconds Timeout=GetInstrumentDataTimeoutDefault)
Locks the mutex of the instrument data class instance InstrumentData assigned to this InstrumentBase ...
virtual std::unique_ptr< UpdateTaskBase > MakeUpdateTask() const
Factory function for an update task (UpdateTaskBase). Override to define the desired update task in d...
Util::SynchronizedPointer< InstrumentDataType > InstrumentDataTypeSyncPtrType
Alias for the return type of InstrumentBase::GetInstrumentData(). Data class instances wrapped into U...
InstrumenThreadOnlyType InstrumentThreadOnly
Allow exclusive access to some of InstrumentBase's private methods to the instrument thread Instrumen...
virtual bool HandleAdditionalTask()
Determines whether task handling should continue.
ExceptionContainer AsSyncTask(void(DerivedInstrT::*TaskFunc)(TaskFuncArgTs...) const, ArgTs &&...Args) const
Calls a (derived) instrument's function which inserts a task into the instrument's task queue synchro...
InstrumentDataTypeSyncPtrType GetNonConstInstrumentData(const std::chrono::milliseconds Timeout=GetInstrumentDataTimeoutDefault) const
Always allows InstrumentBase to obtain a non-const pointer to the instrument's data - even in const t...
void OnError()
Derived classes can perform critical shutdown actions after an error has occurred....
virtual ~InstrumentBase()=0
virtual std::string GetCategory() const override
Returns the category of this Object type.
const std::unique_ptr< InstrumentDataType > InstrumentData
Instrument data belonging to this InstrumentBase instance.
bool IsInitialized() const
Getter for Initialized.
void NotifyChild() override final
Notify derived classes that some state has changed (e.g. the termination of Thread is requested) and ...
Configurator class for InstrumentBase.
virtual ~InstrumentConfiguratorBase()=0
InstrumentConfiguratorBase()=default
Allow exclusive access to some of InstrumentDataBase's private methods to the instrument thread Instr...
constexpr InstrumenThreadOnlyType(InstrumentDataBase &Parent) noexcept
Construcs an instance - one for each InstrumentDataBase instance.
void SetException(std::exception_ptr InstrumentException) noexcept
Setter for InstrumentDataBase::InstrumentException.
InstrumentDataBase & Parent
Owning InstrumentDataBase instance.
void SetLastUpdateTime(std::chrono::system_clock::time_point LastUpdate)
Setter for InstrumentDataBase::LastUpdate.
friend int InstrumentThreadMain(InstrumentInstance, InstrumentBase *const)
Instruments run in their own thread. This is the instrument thread's main function.
auto & GetNewTaskNotifier() noexcept
Getter for NewTaskNotifier.
Allow exclusive access to some of InstrumentDataBase's private methods to InstrumentBase.
auto & GetNewTaskNotifier() noexcept
Getter for NewTaskNotifier.
constexpr InstrumentBaseOnlyType(InstrumentDataBase &Parent) noexcept
Construcs an instance - one for each InstrumentDataBase instance.
void Reset()
Resets the InstrumentDataBase's instance and calls ResetImpl(dispatch_tag<InstrumentDataBase>) subseq...
InstrumentDataBase & Parent
Owning InstrumentDataBase instance.
void CloseQueue()
Clsoes the instrument's task queue setting QueueClosed to true.
void RemoveTaskFromQueue(TaskQueueIteratorType &Task)
Removes a task from the instrument's task queue and inserts it into the instrument's list of finished...
void RemoveAllTasks()
Clears the instrument's task queue.
void EnqueuePriorityTask(std::unique_ptr< TaskBase > &&Task, bool CallFromInstrThread, bool NotifyReceiver)
Enqueues a task at the front of an instrument's task queue and notifies the instrument about the new ...
void EnqueueTask(std::unique_ptr< TaskBase > &&Task, bool CallFromInstrThread, bool NotifyReceiver)
Enqueues a task at the back of an instrument's task queue and notifies the instrument about the new t...
void RemoveAllTasksExceptFront()
Clears the instrument's task queue but keeps the front task (the task with highest priority which is ...
Data structure to contain data which is synchronized in between different threads....
Util::OneToOneNotifier & GetNewTaskNotifier() noexcept
Getter for NewTaskNotifier.
virtual void ResetImpl(dispatch_tag< InstrumentDataBase >)
Refer to DynExp::InstrumentDataBase::Reset(). Using tag dispatch mechanism to ensure that ResetImpl()...
std::list< std::unique_ptr< TaskBase > > TaskQueueType
Type of an instrument task queue owning the tasks within.
TaskQueueType TaskQueue
FIFO task queue of the instrument owning this InstrumentDataBase instance.
std::chrono::system_clock::time_point LastUpdate
Time point when the instrument thread called InstrumentBase::UpdateDataInternal() the last time.
auto GetLastUpdateTime() const
Getter for LastUpdate.
void CheckError() const
Throws InstrumentException if it is not nullptr using Util::ForwardException().
bool IsQueueClosed() const noexcept
Determines whether the instrument task queue is closed.
void Reset()
Resets the InstrumentDataBase's instance and calls ResetImpl(dispatch_tag<InstrumentDataBase>) subseq...
virtual ~InstrumentDataBase()
std::unique_ptr< TaskBase > PopTaskBack()
Removes a task from the back of an instrument's task queue.
void EnqueuePriorityTask(std::unique_ptr< TaskBase > &&Task)
Enqueues a task at the front of an instrument's task queue and notifies the instrument about the new ...
InstrumentBaseOnlyType InstrumentBaseOnly
Allow exclusive access to some of InstrumentDataBase's private methods to InstrumentBase.
void RemoveAllTasks()
Clears the instrument's task queue.
TaskQueueType::const_iterator TaskQueueIteratorType
Const iterator type to elements of TaskQueueType.
void CloseQueue()
Clsoes the instrument's task queue setting QueueClosed to true.
auto GetTaskFront() noexcept
Getter for first enqueued task.
void EnqueueTask(std::unique_ptr< TaskBase > &&Task)
Enqueues a task at the back of an instrument's task queue and notifies the instrument about the new t...
std::unique_ptr< TaskBase > PopTaskFront()
Removes a task from the front of an instrument's task queue.
Util::OneToOneNotifier NewTaskNotifier
Used to notify the instrument thread about new tasks when enqueuing tasks into the task queue....
InstrumenThreadOnlyType InstrumentThreadOnly
Allow exclusive access to some of InstrumentDataBase's private methods to the instrument thread Instr...
size_t GetNumFinishedTasks() const noexcept
Getter for the length of the instrument's list of finished tasks.
auto GetException() const noexcept
Getter for InstrumentDataBase::InstrumentException.
std::exception_ptr InstrumentException
Used to transfer exceptions from the instrument thread to the main thread. Stores the exception respo...
std::unique_ptr< TaskBase > PopFinishedTask()
Removes a task from the front of an instrument's list of finished tasks.
void RemoveAllTasksExceptFront()
Clears the instrument's task queue but keeps the front task (the task with highest priority which is ...
void CheckQueueState(bool CallFromInstrThread) const
Checks whether it is currently allowed to enqueue tasks into the instrument task queue.
size_t GetNumEnqueuedTasks() const noexcept
Getter for the instrument task queue's length.
void RemoveTaskFromQueue(TaskQueueIteratorType &Task)
Removes a task from the instrument's task queue and inserts it into the instrument's list of finished...
bool QueueClosed
If set to true, no new tasks can be enqueued (useful if an instrument is e.g. stopped).
auto GetTaskBack() noexcept
Getter for last enqueued task.
TaskQueueType FinishedTasks
List of the instrument's finished tasks. Tasks are moved here from TaskQueue after completion.
Refer to ParamsBase::dispatch_tag.
Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance.
const InstrumentBase::InstrumentDataGetterType InstrumentDataGetter
Getter for instrument's data. Refer to InstrumentBase::InstrumentDataGetterType.
InstrumentInstance(InstrumentBase &Owner, std::promise< void > &&ThreadExitedPromise, const InstrumentBase::InstrumentDataGetterType InstrumentDataGetter)
Constructs a non-empty RunnableInstance instance.
~InstrumentInstance()=default
Parameter class for InstrumentBase.
virtual void ConfigureParamsImpl(dispatch_tag< InstrumentParamsBase >)
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
DummyParam Dummy
Dummy parameter which is to be owned once by parameter classes that do not contain any other paramete...
virtual ~InstrumentParamsBase()=0
std::unique_ptr< InstrumentDataBase > InstrumentData
Just used temporarily during the construction of an instrument. Refer to MakeInstrument() and to Inst...
virtual const char * GetParamClassTag() const noexcept override
This function is intended to be overridden once in each derived class returning the name of the respe...
InstrumentParamsBase(ItemIDType ID, const DynExpCore &Core)
Constructs the parameters for a InstrumentBase instance.
void ConfigureParamsImpl(dispatch_tag< RunnableObjectParams >) override final
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
friend InstrumentPtrType MakeInstrument(const std::thread::id, ParamsBasePtrType &&)
Factory function to generate an instrument of a specific type.
const std::thread::id OwnerThreadID
Thread id of the thread which has constructed (and owns) this Object instance.
const ParamsBasePtrType Params
Pointer to the parameter class instance belonging to this Object instance.
Refer to ParamsBase::dispatch_tag.
Dummy parameter which is to be owned once by parameter classes that do not contain any other paramete...
const ItemIDType ID
ID of the Object this parameter class instance belongs to.
const DynExpCore & Core
Reference to DynExp's core.
Tag for function dispatching mechanism within this class used when derived classes are not intended t...
Defines data for a thread belonging to a RunnableObject instance. This data is only accessed by the R...
const RunnableObject & Owner
RunnableObject instance which operates on this RunnableInstance (by its thread). The RunnableObject i...
std::promise< void > ThreadExitedPromise
Signals the RunnableObject instance owning the thread that its thread has terminated....
Configurator class for RunnableObject.
Parameter class for RunnableObject.
Defines an Object which possesses a thread it runs in. The RunnableObject can be started and stopped ...
bool IsCallFromRunnableThread() const
Checks whether Thread's id matches the id of the calling thread. This is thread-safe if the function ...
Allow exclusive access to some of TaskBase's private methods to InstrumentBase.
void Lock()
Locks the task to prepare it for execution.
constexpr InstrumentBaseOnlyType(TaskBase &Parent) noexcept
Construcs an instance - one for each TaskBase instance.
bool Run(InstrumentInstance &Instance)
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
TaskBase & Parent
Owning TaskBase instance.
Allow exclusive access to some of TaskBase's private methods to InstrumentDataBase.
TaskBase & Parent
Owning TaskBase instance.
bool KeepFinishedTask() const noexcept
Determines whether the task should be kept to check its results after execution. InstrumentDataBase::...
constexpr InstrumentDataBaseOnlyType(TaskBase &Parent) noexcept
Construcs an instance - one for each TaskBase instance.
Base class for all tasks being processed by instruments. The class must not contain public virtual fu...
void Abort()
Requests the task to abort. There is no guarantee that the derived task does call IsAborting() to che...
void Lock()
Locks the task to prepare it for execution.
std::function< void(const TaskBase &, ExceptionContainer &)> CallbackType
Type of a callback function which is invoked when a task has finished, failed or has been aborted....
int GetErrorCode() const noexcept
Getter for the error code related to an error possibly occurred while the task was executed.
bool IsAborting() const noexcept
Determines whether the task should abort. A derived task is encouraged to call this method before per...
virtual TaskResultType RunChild(InstrumentInstance &Instance)=0
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
TaskBase(CallbackType CallbackFunc=nullptr) noexcept
Constructs an instrument task.
std::atomic< int > ErrorCode
Holds the error code of an error which occurred during execution of the task function.
std::atomic< TaskState > State
Holds the task's current state. Refer to TaskBase::TaskState.
InstrumentBaseOnlyType InstrumentBaseOnly
Allow exclusive access to some of TaskBase's private methods to InstrumentBase.
bool IsLocked() const noexcept
Determines whether the task is locked.
bool Run(InstrumentInstance &Instance)
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
InstrumentDataBaseOnlyType InstrumentDataBaseOnly
Allow exclusive access to some of TaskBase's private methods to InstrumentDataBase.
std::atomic< bool > ShouldAbort
Indicates whether the task should abort. Refer to Abort() and IsAborting().
const CallbackType CallbackFunc
This callback function is called after the task has finished (either successfully or not) with a refe...
TaskState GetState() const noexcept
Getter for the instrument task's current state.
virtual bool KeepFinishedTask() const noexcept
Determines whether the task should be kept to check its results after execution. InstrumentDataBase::...
virtual ~TaskBase()=0
The destructor aborts a waiting task setting State to TaskState::Aborted. Then, it calls CallbackFunc...
TaskState
Defines states an instrument's task can undergo. Possible state transitions are:
Defines the return type of task functions.
constexpr int GetErrorCode() const noexcept
Getter for the error code of an error which occurred during execution of the task function.
const int ErrorCode
DynExp error code from DynExpErrorCodes::DynExpErrorCodes. Anything else than 0 indicates an error.
constexpr TaskResultType(const ContinueTaskHandlingType ContinueTaskHandling=ContinueTaskHandlingType::Continue, const AbortedType Aborted=AbortedType::NotAborted, const int ErrorCode=0) noexcept
Constructs a TaskResultType instance.
const AbortedType Aborted
Determines whether a task has been aborted.
constexpr bool ShouldContinue() const noexcept
Determines whether the instrument having handled this task should continue or terminate.
const ContinueTaskHandlingType ContinueTaskHandling
Determines whether an instrument should terminate after handling the task.
constexpr bool HasAborted() const noexcept
Determines whether this task has been aborted.
AbortedType
Determines whether a task has been aborted.
ContinueTaskHandlingType
Determines whether an instrument should terminate after handling the task.
Defines a task for updating an instrument within an instrument inheritance hierarchy....
TaskResultType RunChild(InstrumentInstance &Instance) override final
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
virtual void UpdateFuncImpl(dispatch_tag< UpdateTaskBase >, InstrumentInstance &Instance)=0
Updates the respective instrument within the instrument inheritance hierarchy. Call UpdateFuncImpl() ...
Refer to DynExp::ParamsBase::dispatch_tag.
Wraps a member function of some object and stores its default arguments. Moving from CallableMemberWr...
Interface to allow synchronizing the access to derived classes between different threads by making th...
An invalid argument like a null pointer has been passed to a function.
Helper class to communicate flags between different threads based on a condition variable and a mutex...
Pointer to lock a class derived from ISynchronizedPointerLockable for synchronizing between threads....
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
constexpr auto Instrument
DynExp's main namespace contains the implementation of DynExp including classes to manage resources (...
InstrumentPtrType MakeInstrument(const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params)
Factory function to generate an instrument of a specific type.
std::shared_ptr< InstrumentBase > InstrumentPtrType
Pointer type to store an instrument (DynExp::InstrumentBase) with.
void WaitForInstruments(InstrTs &... Instruments)
Blocks until every instrument passed to the function as a reference parameter has arrived at a synchr...
std::unique_ptr< TaskT > MakeTask(ArgTs &&...Args)
Factory function to create a task to be enqueued in an instrument's task queue.
auto dynamic_InstrumentData_cast(Util::SynchronizedPointer< From > &&InstrumentDataPtr)
Casts the data base class From into a derived InstrumentBase's (To) data class keeping the data locke...
int InstrumentThreadMain(InstrumentInstance Instance, InstrumentBase *const Instrument)
Instruments run in their own thread. This is the instrument thread's main function.
std::unique_ptr< ParamsBase > ParamsBasePtrType
Alias for a pointer to the parameter system base class ParamsBase.
size_t ItemIDType
ID type of objects/items managed by DynExp.
ConfiguratorBasePtrType MakeInstrumentConfig()
Factory function to generate a configurator for a specific instrument type.
std::shared_ptr< ConfiguratorBase > ConfiguratorBasePtrType
Alias for a pointer to the configurator base class ConfiguratorBase.
Accumulates include statements to provide a precompiled header.