22 class LinkedObjectWrapperContainerBase;
24 class RunnableInstance;
25 class HardwareAdapterBase;
28 class CommonResourceManagerBase;
29 class HardwareAdapterManager;
30 class InstrumentManager;
32 class NetworkParamsExtension;
51 std::is_base_of_v<HardwareAdapterBase, ObjectType> || std::is_base_of_v<InstrumentBase, ObjectType>,
59 using type = std::conditional_t<
60 std::is_base_of_v<HardwareAdapterBase, ObjectType>,
71 template <
typename ObjectType>
97 void Register(
const Object& User,
const std::chrono::milliseconds
Timeout = std::chrono::milliseconds(0));
119 size_t CountUsers(std::chrono::milliseconds
Timeout = std::chrono::milliseconds(0))
const;
176 std::unordered_map<const Object*, size_t>
UserList;
208 template <
typename ResourceManagerType>
209 auto ShareResource(
const ResourceManagerType& Manager,
ItemIDType ID) {
return Manager.LinkBaseOnly.ShareResourceAsNonConst(ID); }
221 template <
typename ObjectType>
225 auto FoundIDs = Manager.template Filter<ObjectType>();
228 constexpr
auto FilterTypeBaseName = std::is_base_of_v<HardwareAdapterBase, ObjectType> ?
"hardware adapter" :
229 (std::is_base_of_v<InstrumentBase, ObjectType> ?
"instrument" :
"< error-type >");
232 ObjectType::CategoryAndNameToStr(ObjectType::Category(), ObjectType::Name()) +
" is needed before this item can be created.");
235 std::sort(FoundIDs.begin(), FoundIDs.end(), [&Manager](
const auto& a,
const auto& b) {
236 return Manager.GetResource(a)->GetObjectName() < Manager.GetResource(b)->GetObjectName();
240 for (
const auto& ID : FoundIDs)
242 const auto Resource = Manager.GetResource(ID);
243 std::string Label =
Resource->GetObjectName() +
" (" +
Resource->GetCategoryAndName() +
")";
245 FoundIDsWithLabels.emplace_back(std::move(Label), ID);
248 return FoundIDsWithLabels;
361 template <
typename EnumType>
363 std::is_signed_v<std::underlying_type_t<EnumType>>,
408 ParamBase(
ParamsBase& Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription,
bool NeedsResetToApplyChange);
440 QDomElement ToXMLNode(QDomDocument& Document)
const;
446 void FromXMLNode(
const QDomElement& XMLElement);
463 const auto&
GetOwner() const noexcept {
return Owner; }
487 virtual void ToXMLNodeChild(QDomDocument& Document, QDomElement& XMLElement)
const = 0;
527 virtual void ToXMLNodeChild(QDomDocument& Document, QDomElement& XMLElement)
const override {}
537 template <
typename ParamType>
549 bool NeedsResetToApplyChange =
true, ParamType DefaultValue = ParamType())
550 :
ParamBase(Owner, ParamName, ParamTitle, ParamDescription, NeedsResetToApplyChange),
551 DefaultValue(std::move(DefaultValue)), Value(this->DefaultValue) {}
559 DefaultValue(std::move(DefaultValue)), Value(this->DefaultValue) {}
571 operator ParamType() const noexcept {
return Value; }
577 const ParamType&
Get() const noexcept {
return Value; }
589 if (!ValidateValue(NewValue))
591 "An assignment to a parameter cannot be executed since the given value is considered invalid.");
598 virtual void ToXMLNodeChild(QDomDocument& Document, QDomElement& XMLElement)
const override
600 QDomText NodeValue = Document.createTextNode(QString::fromStdString(
Util::ToStr(Value)));
601 XMLElement.appendChild(NodeValue);
606 Value = Util::GetTFromDOMElement<ParamType>(XMLElement, GetParamName().data());
610 virtual bool ValidateChild() const override final {
return ValidateValue(Value); }
618 virtual bool ValidateValue(
const ParamType& NewValue)
const {
return true; }
630 template <
typename ParamType>
645 bool NeedsResetToApplyChange =
true,
UnderlyingType DefaultValues = {})
646 :
ParamBase(Owner, ParamName, ParamTitle, ParamDescription, NeedsResetToApplyChange),
647 DefaultValues(std::move(DefaultValues)), Values(this->DefaultValues) {}
655 DefaultValues(std::move(DefaultValues)), Values(this->DefaultValues) {}
668 const auto&
Get() const noexcept {
return Values; }
680 if (!ValidateValues(NewValues))
682 "An assignment to a list parameter cannot be executed since the given value vector is considered invalid.");
689 virtual void ToXMLNodeChild(QDomDocument& Document, QDomElement& XMLElement)
const override
691 QDomElement ValuesNode = Document.createElement(
"Values");
693 for (
const auto& value : Values)
695 QDomElement ValueNode = Document.createElement(
"v");
696 QDomText NodeValue = Document.createTextNode(QString::fromStdString(
Util::ToStr(value)));
698 ValueNode.appendChild(NodeValue);
699 ValuesNode.appendChild(ValueNode);
702 XMLElement.appendChild(ValuesNode);
707 QDomElement ValuesNode;
717 const auto Value = Util::GetTFromDOMElement<ParamType>(XMLElement, GetParamName().data());
720 Values.push_back(Value);
728 for (
const auto& value : ValueNodes)
729 Values.push_back(Util::StrToT<ParamType>(value.toElement().text().toStdString()));
733 virtual bool ValidateChild() const override final {
return ValidateValues(Values); }
743 virtual void ResetChild()
override { Values = DefaultValues; }
749 template <
typename ParamType,
typename =
void>
756 template <
typename ParamType>
759 !std::is_arithmetic_v<ParamType> &&
760 !std::is_base_of_v<Text, ParamType> &&
761 !std::is_base_of_v<TextList, ParamType> &&
762 !std::is_base_of_v<IndexedTextList, ParamType> &&
763 !std::is_enum_v<ParamType> &&
764 !std::is_base_of_v<ObjectLinkBase, ParamType>
774 Param(
ParamsBase& Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription,
bool NeedsResetToApplyChange =
true,
775 ParamType DefaultValue = ParamType())
776 :
TypedParamBase<ParamType>(Owner, ParamName, ParamTitle, ParamDescription, NeedsResetToApplyChange, std::move(DefaultValue)) {}
782 :
TypedParamBase<ParamType>(Owner, ParamName, std::move(DefaultValue)) {}
788 "A general (unspecified) parameter cannot be added to a settings dialog.");
792 template <
typename ArithmeticType>
800 template <
typename ArithmeticType>
814 Param(
ParamsBase& Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription,
bool NeedsResetToApplyChange =
true,
815 ArithmeticType DefaultValue = ArithmeticType(),
816 ArithmeticType MinValue = std::numeric_limits<ArithmeticType>::lowest(), ArithmeticType MaxValue = std::numeric_limits<ArithmeticType>::max(),
818 :
UnderlyingArithmeticParamType<ArithmeticType>(Owner, ParamName, ParamTitle, ParamDescription, NeedsResetToApplyChange, std::move(DefaultValue)),
819 MinValue(MinValue), MaxValue(MaxValue), Increment(Increment), Precision(Precision) {}
828 Param(
ParamsBase& Owner, std::string ParamName, ArithmeticType DefaultValue = ArithmeticType(),
829 ArithmeticType MinValue = std::numeric_limits<ArithmeticType>::lowest(), ArithmeticType MaxValue = std::numeric_limits<ArithmeticType>::max(),
832 MinValue(MinValue), MaxValue(MaxValue), Increment(Increment), Precision(Precision) {}
858 return Value >= MinValue && Value <= MaxValue;
874 template <
typename ParamType>
878 using UnderlyingTextParamType::operator=;
887 :
UnderlyingTextParamType(Owner, ParamName, ParamTitle, ParamDescription, NeedsResetToApplyChange, DefaultValue), TextUsage(TextUsage) {}
899 std::filesystem::path
GetPath()
const {
return GetOwner().ToAbsolutePath(Get()); }
913 Dialog.AddParam({ ParamBase::GetParamTitle(), ParamBase::GetParamDescription() }, std::ref(*
static_cast<UnderlyingTextParamType*
>(
this)), Get(), TextUsage);
924 template <
typename ParamType>
928 using UnderlyingTextListParamType::operator=;
970 Dialog.AddParam({ ParamBase::GetParamTitle(), ParamBase::GetParamDescription() }, std::ref(*
static_cast<UnderlyingTextListParamType*
>(
this)),
971 Get(),
TextList, !GetDefaultValue().empty());
991 template <
typename ParamType>
995 using UnderlyingIndexedTextListParamType::operator=;
1026 Get(), GetDefaultValue(),
TextList);
1039 template <
typename EnumType>
1047 template <
typename EnumType>
1056 std::string_view ParamDescription,
bool NeedsResetToApplyChange =
true, EnumType DefaultValue = EnumType())
1057 :
UnderlyingEnumParamType<EnumType>(Owner, ParamName, ParamTitle, ParamDescription, NeedsResetToApplyChange, DefaultValue),
1058 TextValueList(std::move(TextValueList)) {}
1108 Get(), GetDefaultValue(), TextValueList);
1135 using UnderlyingLinkParamType::operator=;
1149 template <
typename LinkType>
1150 class Param<LinkType, std::enable_if_t<std::is_base_of_v<ObjectLinkBase, LinkType>>> :
public LinkParamBase
1155 using LinkParamBase::operator=;
1162 std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription,
1169 GetOwner().ObjectLinkParams.emplace_back(std::ref(*
this));
1189 const LinkType&
GetLink() const noexcept {
return Link; }
1207 "A resource assigned to a param does not match the expected type.");
1218 UnderlyingLinkParamType::FromXMLNodeChild(XMLElement);
1225 auto FunctionToCallIfAccepted = std::bind_front(&Param::MakeLink,
this);
1227 Dialog.AddParam({ ParamBase::GetParamTitle(), ParamBase::GetParamDescription() }, std::ref(*
static_cast<LinkParamBase*
>(
this)),
1239 auto LinkedObj = Link.TryLockDestinyRaw();
1241 LinkedObj->EnsureReadyState(
true);
1249 auto LinkedObj = Link.TryLockDestinyRaw();
1254 return LinkedObj->IsReady();
1280 template <
typename ParamType,
typename =
void>
1287 template <
typename ParamType>
1290 !std::is_arithmetic_v<ParamType> &&
1291 !std::is_base_of_v<ObjectLinkBase, ParamType>
1301 ListParam(
ParamsBase& Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription,
bool NeedsResetToApplyChange =
true,
1315 "A general (unspecified) list parameter cannot be added to a settings dialog.");
1319 template <
typename ArithmeticType>
1327 template <
typename ArithmeticType>
1341 ListParam(
ParamsBase& Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription,
bool NeedsResetToApplyChange =
true,
1343 ArithmeticType MinValue = std::numeric_limits<ArithmeticType>::lowest(), ArithmeticType MaxValue = std::numeric_limits<ArithmeticType>::max(),
1344 ArithmeticType Increment = 1, PrecisionType Precision = 0)
1346 MinValue(MinValue), MaxValue(MaxValue), Increment(Increment), Precision(Precision) {}
1356 ArithmeticType MinValue = std::numeric_limits<ArithmeticType>::lowest(), ArithmeticType MaxValue = std::numeric_limits<ArithmeticType>::max(),
1357 ArithmeticType Increment = 1, PrecisionType Precision = 0)
1359 MinValue(MinValue), MaxValue(MaxValue), Increment(Increment), Precision(Precision) {}
1375 "An arithmetic list parameter cannot be added to a settings dialog currently.");
1380 for (
const auto value : NewValues)
1381 if (value < MinValue || value > MaxValue)
1414 using UnderlyingLinkListParamType::operator=;
1428 template <
typename LinkType>
1434 using LinkListParamBase::operator=;
1441 std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription,
1448 GetOwner().ObjectLinkParams.emplace_back(std::ref(*
this));
1469 const auto&
GetLinks() const noexcept {
return Links; }
1484 for (
auto ID : Get())
1489 "A resource assigned to a list parameter does not match the expected type.");
1501 UnderlyingLinkListParamType::FromXMLNodeChild(XMLElement);
1508 auto FunctionToCallIfAccepted = std::bind_front(&ListParam::MakeLinks,
this);
1510 Dialog.AddParam({ ParamBase::GetParamTitle(), ParamBase::GetParamDescription() }, std::ref(*
static_cast<LinkListParamBase*
>(
this)),
1520 for (
const auto value : NewValues)
1535 for (
auto& Link : Links)
1537 auto LinkedObj = Link.TryLockDestinyRaw();
1539 LinkedObj->EnsureReadyState(
true);
1548 for (
auto& Link : Links)
1550 auto LinkedObj = Link.TryLockDestinyRaw();
1556 if (!LinkedObj->IsReady())
1596 : Params(Params), CurrentParam(Params.ObjectLinkParams.cbegin()), EnsureReadyStateCalledForCurrentParam(
false) {}
1651 QDomElement ConfigToXML(QDomDocument& Document)
const;
1659 void ConfigFromXML(
const QDomElement& XMLElement)
const;
1674 bool Validate()
const;
1677 const auto&
GetCore() const noexcept {
return Core; }
1726 "Determines how this item can be used by other items",
false, UsageType::Shared };
1748 static void DisableUserEditable(ParamBase& Param) noexcept;
1755 void ConfigureParams();
1777 std::filesystem::path ToAbsolutePath(
const std::filesystem::path& Path)
const;
1791 template <
typename ParamType>
1801 template <
typename ParamType>
1817 template <
typename ConfiguratorT>
1820 auto Params = std::make_unique<typename ConfiguratorT::ParamsType>(ID, Core);
1822 Params->ObjectName = ConfiguratorT::ObjectType::Name();
1834 template <
typename T>
1840 auto DerivedParams =
dynamic_cast<typename T::ParamsType*
>(Params);
1844 return DerivedParams;
1859 template <
typename To,
typename From, std::enable_if_t<
1860 std::is_same_v<ParamsBase, std::remove_cv_t<From>>,
int> = 0
1868 std::conditional_t<std::is_const_v<From>, std::add_const_t<typename To::ParamsType>,
typename To::ParamsType>
1869 >(std::move(ParamsPtr));
1896 : Accepted(Accepted), ResetRequired(ResetRequired) {}
2004 static std::string CategoryAndNameToStr(
const std::string& Category,
const std::string& Name);
2010 static constexpr std::chrono::milliseconds GetParamsTimeoutDefault = std::chrono::milliseconds(100);
2060 void RegisterUser(
const Object& User,
const std::chrono::milliseconds
Timeout)
const;
2065 void DeregisterUser(
const Object& User,
const std::chrono::milliseconds
Timeout)
const;
2178 void SetWarning(std::string Description,
int ErrorCode)
const;
2250 void EnsureCallFromOwningThread()
const;
2300 void LogWarning()
const;
2320 bool IsBlocked =
false;
2330 template <
typename To,
typename From, std::enable_if_t<
2331 std::is_base_of_v<Object, To> && std::is_base_of_v<Object, From>,
int> = 0
2338 auto DerivedObj =
dynamic_cast<std::conditional_t<std::is_const_v<From>, std::add_const_t<To>*, To*
>>(Obj);
2375 virtual const char*
GetParamClassTag() const noexcept
override {
return "RunnableObjectParams"; }
2387 "Determines when the item is started",
false, StartupType::Automatic };
2397 void ConfigureParamsImpl(dispatch_tag<ParamsBase>)
override final;
2473 std::string GetErrorMessage()
const;
2489 static constexpr
auto ShortTimeoutDefault = std::chrono::milliseconds(50);
2494 static constexpr
auto TerminateTimeoutDefault = std::chrono::milliseconds(3000);
2514 bool Run(QWidget* ParentWidget =
nullptr);
2523 bool RunIfRunAutomatic();
2530 bool RunIfRunOnCreation();
2538 void Terminate(
bool Force =
false,
const std::chrono::milliseconds
Timeout = TerminateTimeoutDefault);
2548 void SetPaused(
bool Pause, std::string Description =
"");
2568 std::promise<void> MakeThreadExitedPromise();
2575 void StoreThread(std::thread&& Thread) noexcept;
2586 bool IsCallFromRunnableThread()
const;
2593 void EnsureCallFromRunnableThread()
const;
2613 void ResetImpl(dispatch_tag<Object>)
override final;
2656 void TerminateImpl(
bool Force,
const std::chrono::milliseconds
Timeout = TerminateTimeoutDefault);
2665 void TerminateUnsafe(
bool Force,
const std::chrono::milliseconds
Timeout = TerminateTimeoutDefault);
2674 void OnThreadHasExited() noexcept;
2683 std::future<
void> ThreadExitedSignal;
2693 std::atomic<
bool> ShouldExit;
2700 mutable std::atomic<
bool> LinkedObjStateCheckRequested = false;
2730 : OwnedLinkedObjectWrapperPtr(std::move(OwnedLinkedObjectWrapperPtr)),
2731 OwnedLinkedObjectWrapperContainer(OwnedLinkedObjectWrapperContainer) {}
2750 using ListType = std::list<OwnedLinkedObjectWrapperType>;
2777 const
Object& GetOwner() const noexcept;
2789 virtual
void Register(const std::chrono::milliseconds
Timeout) = 0;
2796 virtual
void Deregister(const std::chrono::milliseconds
Timeout) = 0;
2821 template <typename ObjectT>
2835 DestinyResource(std::move(DestinyResource)), IsRegisteredFlag(false)
2853 Util::EventLog().
Log(
"Could not deregister a linked object wrapper. Timeout occurred. Execution cannot continue.",
2860 Util::EventLog().
Log(
"Could not deregister a linked object wrapper. The error listed below occurred. Execution cannot continue.",
2866 catch (
const std::exception& e)
2868 Util::EventLog().
Log(
"Could not deregister a linked object wrapper. The error listed below occurred. Execution cannot continue.",
2876 Util::EventLog().
Log(
"Could not deregister a linked object wrapper. An unknown error occurred. Execution cannot continue.",
2883 virtual bool IsRegistered() const noexcept
override {
return IsRegisteredFlag; }
2892 std::string
GetLinkedObjectDesc()
const {
return DestinyResource->GetObjectName() +
" (" + DestinyResource->GetCategoryAndName() +
")"; }
2900 decltype(
auto) get()
const {
return &this->operator*(); }
2902 decltype(
auto) get() {
return &this->operator*(); }
2905 const auto& operator*()
const
2922 if (!IsRegisteredFlag)
2924 "This linked object wrapper instance is deregistered from the requested object.");
2926 return *DestinyResource.get();
2933 return const_cast<typename std::shared_ptr<ObjectType>::element_type&
>(
2937 const auto operator->()
const {
return &this->operator*(); }
2938 auto operator->() {
return &this->operator*(); }
2941 virtual void Register(
const std::chrono::milliseconds
Timeout)
override
2943 if (!DestinyResource)
2945 if (IsRegisteredFlag)
2949 DestinyResource->LinkedObjectWrapperOnly.RegisterUser(GetOwner(),
Timeout);
2951 IsRegisteredFlag =
true;
2954 virtual void Deregister(
const std::chrono::milliseconds
Timeout)
override
2956 if (!IsRegisteredFlag)
2959 DestinyResource->LinkedObjectWrapperOnly.DeregisterUser(GetOwner(),
Timeout);
2961 IsRegisteredFlag =
false;
2968 const std::shared_ptr<ObjectType> DestinyResource;
2974 bool IsRegisteredFlag;
2983 template <
typename ObjectT>
3007 : LinkedObjectWrapperPtr(LinkedObjectWrapperPtr) {}
3048 explicit operator bool() const noexcept {
return LinkedObjectWrapperPtr !=
nullptr; }
3110 void Reset() noexcept;
3120 auto GetState() const noexcept {
return LinkedObjectState; }
3144 virtual std::
string GetLinkedObjectDescChild() const = 0;
3145 virtual
bool CheckIfReadyChild() = 0;
3158 template <typename ObjectT>
3169 : PerformReadyCheck(PerformReadyCheck) {}
3187 const auto Destiny = GetLinkedObjWrapperPtr()->get();
3189 if (PerformReadyCheck)
3195 if (!Destiny->IsReady())
3216 bool valid() const noexcept {
return static_cast<bool>(LinkedObjWrapperPtr); }
3220 virtual void ResetChild() noexcept
override { LinkedObjWrapperPtr =
nullptr; }
3224 if (!LinkedObjWrapperPtr)
3225 return "< unknown >";
3227 return GetLinkedObjWrapperPtr()->GetLinkedObjectDesc();
3235 const auto Destiny = GetLinkedObjWrapperPtr()->get();
3237 bool IsReady = Destiny->IsReady();
3250 if (!LinkedObjWrapperPtr)
3262 return LinkedObjWrapperPtr;
3272 LinkedObjWrapperPtr = NewLinkedObjWrapperPtr;
3301 template <
typename ObjectT>
3315 const auto&
GetList() const noexcept {
return Containers; }
3316 const auto&
GetLabels() const noexcept {
return ObjectLabels; }
3326 template <
typename IndexType>
3329 auto i = Util::NumToT<size_t>(Index);
3331 if (i >= Containers.size())
3334 return *Containers[i];
3359 static constexpr std::chrono::milliseconds LockObjectTimeoutDefault = std::chrono::milliseconds(100);
3381 template <
typename ObjectT>
3399 ObjectLink(
const std::shared_ptr<ObjectType>& DestinyResource) : DestinyResource(DestinyResource) {}
3406 void Reset() { DestinyResource.reset(); }
3413 auto&
operator=(
const std::shared_ptr<ObjectType>& NewDestinyResource)
3419 DestinyResource = NewDestinyResource;
3433 return DestinyResource.lock();
3448 std::chrono::milliseconds
Timeout = LockObjectTimeoutDefault)
const
3450 std::shared_ptr<ConstObjectType> DestinyShared;
3454 DestinyShared = DestinyResource.lock();
3459 return std::make_unique<LinkedObjectWrapper<ConstObjectType>>(WrapperOwner, std::move(DestinyShared),
Timeout);
3473 auto ObjectWrapperPtr = TryLockObject(WrapperOwner,
Timeout);
3475 if (!ObjectWrapperPtr)
3478 return ObjectWrapperPtr;
3524 const auto&
GetOwner() const noexcept {
return Owner; }
3536 template <
typename ObjectT>
3541 ObjectWrapperContainer.
SetLinkedObjWrapperPtr(StoreLockedObject(LinkParam.GetLink().TryLockObject(*
this,
Timeout), ObjectWrapperContainer));
3553 template <
typename ObjectT>
3569 template <
typename ObjectT>
3577 ObjectWrapperContainer.
Reset();
3597 template <
typename ObjectT>
3603 UnlockObject(ObjectWrapperContainerList);
3605 for (
const auto& Link : LinkListParam.GetLinks())
3609 const auto& Container = ObjectWrapperContainerList.
Containers.back();
3614 Container->SetLinkedObjWrapperPtr(StoreLockedObject(Link.LockObject(*
this,
Timeout), *Container));
3616 ObjectWrapperContainerList.
ObjectLabels.emplace_back((*Container)->GetObjectName() +
" (" + (*Container)->GetCategoryAndName() +
")");
3621 UnlockObject(*Container);
3622 ObjectWrapperContainerList.
Containers.pop_back();
3628 if (!LinkListParam.IsOptional() && ObjectWrapperContainerList.
Containers.empty())
3631 ObjectWrapperContainerList.
IconPath = LinkListParam.GetIconResourcePath();
3641 template <
typename ObjectT>
3644 for (
const auto& Container : ObjectWrapperContainerList.
Containers)
3645 UnlockObject(*Container);
3647 ObjectWrapperContainerList.
Containers.clear();
3649 ObjectWrapperContainerList.
IconPath.clear();
3659 bool CareAboutWrappers();
3666 std::string GetNotReadyObjectNamesString()
const;
3677 void SetThreadExited();
3688 template <
typename ObjectT>
3692 OwnedLinkedObjectWrappers.emplace_back(std::move(ObjectWrapperPtr), ObjectWrapperContainer);
3694 auto ObjectWrapperIterator = --OwnedLinkedObjectWrappers.end();
3695 ObjectWrapperIterator->OwnedLinkedObjectWrapperPtr.get()->ListPos = ObjectWrapperIterator;
Implements a dialog with a progress bar, which shows the user that DynExp is busy.
Implements a configuration dialog which allows users to set values of parameters derived from DynExp:...
Implements DynExp's main window as a Qt-based user interface (UI).
Common base class for all derived ResourceManagerBase classes. Logical const-ness: Only const functio...
The configurator classes have the task to generate parameter objects (refer to DynExp::ParamsBase) of...
ConfiguratorBase()=default
virtual ParamsBasePtrType MakeParams(ItemIDType ID, const DynExpCore &Core) const =0
Override to make derived classes call DynExp::MakeParams with the correct configurator type derived f...
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
Resource manager for HardwareAdapterBase resources deriving from a specialized ResourceManagerBase cl...
Resource manager for InstrumentBase resources deriving from a specialized ResourceManagerBase class.
Abstract base class of link parameters (to be saved in project files) describing relations between mu...
virtual const CommonResourceManagerBase * GetCommonManagerChild() const noexcept=0
This function can be used to determine the object type the parameter is expecting by comparing the re...
std::string_view GetIconResourcePath() const noexcept
auto ShareResource(const ResourceManagerType &Manager, ItemIDType ID)
Returns a shared_ptr pointing to the resource with the given ID contained in the given resource manag...
auto MakeObjectIDsWithLabels(const ManagerTypeOfObjectType_t< ObjectType > &Manager) const
Finds all resources managed by the given resource manager matching type ObjectTpye and returns a list...
virtual bool IsReadyChild()=0
Returns whether the object where this link parameter points to is in a ready state.
virtual void EnsureReadyStateChild()=0
Makes sure that the object where this link parameter points to is in a ready state....
const bool Optional
Determines whether this parameter is optional. Optional parameters do not have to point to valid obje...
virtual std::string_view GetLinkTitleChild() const noexcept=0
Returns a reference to this link parameter's title.
std::string_view GetLinkTitle() const noexcept
Returns a reference to this link parameter's title.
const CommonResourceManagerBase * GetCommonManager() const noexcept
This function can be used to determine the object type the parameter is expecting by comparing the re...
bool IsReady()
Returns whether the object where this link parameter points to is in a ready state.
ItemIDListType GetLinkedIDs() const
Returns a list of all object IDs assigned to this parameter.
const std::string_view IconResourcePath
Qt resource path describing an icon being displayed along with this parameter in user interface dialo...
virtual ItemIDListType GetLinkedIDsChild() const =0
Returns a list of all object IDs assigned to this parameter.
LinkBase(std::string_view IconResourcePath={}, bool Optional=false)
Constructs a LinkBase object.
void EnsureReadyState()
Makes sure that the object where this link parameter points to is in a ready state....
bool IsOptional() const noexcept
Polymorphic base class to allow storing LinkedObjectWrapper of any type in a single list.
std::list< OwnedLinkedObjectWrapperType > ListType
Type of a list hold by RunnableInstance (RunnableInstance::OwnedLinkedObjectWrappers) that contains p...
std::unique_ptr< LinkedObjectWrapperBase > LinkedObjectWrapperBasePtrType
Alias for a smart pointer owning instances of this class.
virtual bool IsRegistered() const noexcept=0
Returns whether the wrapper has registered its owning Object instance (through Owner) as a user of th...
LinkedObjectWrapperBase(const RunnableInstance &Owner)
Constructs a LinkedObjectWrapperBase instance.
Polymorphic base class to allow storing LinkedObjectWrapperContainer of any type in a single list.
void Reset() noexcept
Removes any linked LinkedObjectWrapper and updates LinkedObjectState.
LinkedObjectWrapperContainerBase() noexcept
Constructs a LinkedObjectWrapperContainerBase instance which is not linked to any LinkedObjectWrapper...
bool CheckIfReady()
Returns whether the Object instance which is wrapped by the linked LinkedObjectWrapper is in a ready ...
LinkedObjectStateType
Indicates the current state of the Object referenced by the linked LinkedObjectWrapper.
virtual void ResetChild() noexcept=0
Removes any linked LinkedObjectWrapper and updates LinkedObjectState.
std::string GetLinkedObjectDesc() const
Builds and returns a human-readable string uniquely identifying the Object instance which is wrapped ...
This class defines a list of LinkedObjectWrapperContainer instances. The list owns the contained Link...
Util::TextListType ObjectLabels
Holds a human-readable identifier for each linked object.
std::string IconPath
Holds the path to the icon of the linked objects' base type (e.g. hardware adapter,...
std::vector< std::unique_ptr< ContainerType > > Containers
List of the owned LinkedObjectWrapperContainer instances. std::vector of pointers since insertion and...
LinkedObjectWrapperContainerList()=default
const auto & GetLabels() const noexcept
Returns ObjectLabels.
std::string_view GetIconPath() const
Returns IconPath.
~LinkedObjectWrapperContainerList()=default
auto & operator[](IndexType Index)
Returns a stored LinkedObjectWrapperContainer instance selected by its list index.
const auto & GetList() const noexcept
Returns Containers.
This class holds a pointer (LinkedObjectWrapperPointer) to a LinkedObjectWrapper. Intances of this cl...
LinkedObjectWrapperPointer< ObjectT > LinkedObjWrapperPtr
Pointer to a LinkedObjectWrapper instance holding a pointer to the destiny object instance of type co...
const bool PerformReadyCheck
Determines whether a call to get() checks the return value of Object::IsReady() before returning Link...
virtual std::string GetLinkedObjectDescChild() const override
Builds and returns a human-readable string uniquely identifying the Object instance which is wrapped ...
auto get() const
Returns the LinkedObjWrapperPtr and checks (depending on PerformReadyCheck) whether the Object Linked...
bool valid() const noexcept
Checks whether LinkedObjWrapperPtr points to a valid distination.
LinkedObjectWrapperContainer(bool PerformReadyCheck=true) noexcept
Constructs a LinkedObjectWrapperContainer instance.
virtual bool CheckIfReadyChild() override
Returns whether the Object instance which is wrapped by the linked LinkedObjectWrapper is in a ready ...
virtual void ResetChild() noexcept override
Removes any linked LinkedObjectWrapper and updates LinkedObjectState.
auto operator->() const
Returns the result of a call to get().
auto & operator*() const
Dereferences and returns the result of a call to get().
virtual ~LinkedObjectWrapperContainer()=default
void CheckIfNullptr() const
Checks whether LinkedObjWrapperPtr is nullptr. Does nothing if this is not the case.
void SetLinkedObjWrapperPtr(LinkedObjectWrapperPointer< ObjectT > NewLinkedObjWrapperPtr) noexcept
Sets LinkedObjWrapperPtr to a new destination and updates LinkedObjectWrapperContainerBase::LinkedObj...
auto & GetLinkedObjWrapperPtr() const
Returns LinkedObjWrapperPtr after checking whether LinkedObjWrapperPtr is nullptr.
This class describes a pointer to a LinkedObjectWrapper instance. It is a simple wrapper class which ...
bool operator!=(const LinkedObjectWrapperPtrType rhs) const noexcept
Checks whether LinkedObjectWrapperPtr does not equal another pointer to a LinkedObjectWrapper instanc...
LinkedObjectWrapperPtrType LinkedObjectWrapperPtr
LinkedObjectWrapper instance this pointer points to
LinkedObjectWrapperType & operator*() const noexcept
Always returns a const reference so that Object instances using another linked Object instance are on...
bool operator!=(const LinkedObjectWrapperPointer &rhs) const noexcept
Checks whether this LinkedObjectWrapperPointer instance does not equal another instance.
LinkedObjectWrapperPtrType get() const noexcept
Always returns a const pointer so that Object instances using another linked Object instance are only...
bool operator==(const LinkedObjectWrapperPtrType rhs) const noexcept
Checks whether LinkedObjectWrapperPtr equals another pointer to a LinkedObjectWrapper instance.
LinkedObjectWrapperPointer() noexcept
Constructs an empty pointer.
LinkedObjectWrapperPointer(LinkedObjectWrapperPtrType LinkedObjectWrapperPtr) noexcept
Constructs a pointer pointing to LinkedObjectWrapperPtr.
bool operator==(const LinkedObjectWrapperPointer &rhs) const noexcept
Checks whether this LinkedObjectWrapperPointer instance equals another instance.
LinkedObjectWrapperPtrType operator->() const noexcept
Always returns a const pointer so that Object instances using another linked Object instance are only...
Holds a shared_ptr to a resource (instance of class Object) and lets the resource keep track of its u...
virtual bool IsRegistered() const noexcept override
Returns whether the wrapper has registered its owning Object instance (through Owner) as a user of th...
std::add_const_t< ObjectT > ObjectType
Const type of the managed Object.
virtual ~LinkedObjectWrapper()
Destructor calls LinkedObjectWrapper::Deregister().
virtual void Deregister(const std::chrono::milliseconds Timeout) override
Deregisters the wrapper's owning Object instance (through Owner) as a user of the target resource (re...
std::string GetLinkedObjectDesc() const
Builds and returns a human-readable string uniquely identifying the Object instance DestinyResource....
virtual void Register(const std::chrono::milliseconds Timeout) override
Registers the wrapper's owning Object instance (through Owner) as a user of the target resource (refe...
LinkedObjectWrapper(const RunnableInstance &Owner, std::shared_ptr< ObjectType > &&DestinyResource, const std::chrono::milliseconds Timeout)
Constructs a LinkedObjectWrapper instance and calls LinkedObjectWrapper::Register().
Bundles several parameters to describe a network connection. Use in parameter classes.
Base class for object link parameter types to allow SFINAE in ParamsBase::Param for ObjectLink of any...
static constexpr std::chrono::milliseconds LockObjectTimeoutDefault
Default timeout used by classes ObjectLinkt and RunnableInstance to be passed to LinkedObjectWrapper:...
Type to define object link parameters as ParamsBase::Param< ObjectLink< ObjectT > > or to define obje...
auto TryLockDestinyRaw()
Locks the resource this object link points to by creating a shared_ptr from it. This function can onl...
ObjectLink(const std::shared_ptr< ObjectType > &DestinyResource)
Constructs an object link pointing to DestinyResource.
std::add_const_t< ObjectT > ConstObjectType
Equals const ObjectT.
ObjectLink()
Constructs an empty object link.
auto LockObject(const RunnableInstance &WrapperOwner, std::chrono::milliseconds Timeout=LockObjectTimeoutDefault) const
Locks DestinyResource and wraps the locked Object in a LinkedObjectWrapper instance....
ObjectT ObjectType
Equals ObjectT.
void Reset()
Resets this object link rendering it empty.
std::unique_ptr< LinkedObjectWrapper< ConstObjectType > > TryLockObject(const RunnableInstance &WrapperOwner, std::chrono::milliseconds Timeout=LockObjectTimeoutDefault) const
Locks DestinyResource and wraps the locked Object in a LinkedObjectWrapper instance....
std::weak_ptr< ObjectType > DestinyResource
Pointer to the (unlocked) resource this object link points to. Logical const-ness: the weak_ptr's typ...
auto & operator=(const std::shared_ptr< ObjectType > &NewDestinyResource)
Assigns a new resource to this object link.
Helper class to enable keeping track of instances of class Object making use of the owner of the resp...
std::string GetUserNamesString(std::chrono::milliseconds Timeout=std::chrono::milliseconds(0)) const
Builds a string describing which users are registered containing their object names,...
void Deregister(const Object &User, const std::chrono::milliseconds Timeout=std::chrono::milliseconds(0))
Deregisters a user in a thread-safe way.
std::string GetUserNamesStringUnsafe() const
void Register(const Object &User, const std::chrono::milliseconds Timeout=std::chrono::milliseconds(0))
Registers a user in a thread-safe way.
std::unordered_map< const Object *, size_t > UserList
Map containing pointers to all users making use of this ObjectUserList instance's owner as keys and t...
void DeregisterAllUnsafe()
Deregisters all users and notifies them that they need to check the states of their used linked objec...
virtual ~ObjectUserList()=default
size_t CountUsersUnsafe() const
size_t CountUsers(std::chrono::milliseconds Timeout=std::chrono::milliseconds(0)) const
Counts the registered useres in a thread-safe way.
ItemIDListType GetUserIDsUnsafe() const
void DeregisterUnsafe(const Object &User)
Deregisters a user.
void RegisterUnsafe(const Object &User)
Registers a user.
Util::ILockable::LockType AcquireLock(const std::chrono::milliseconds Timeout=DefaultTimeout) const
Locks the user list for thread-safe manipulation.
ItemIDListType GetUserIDs(std::chrono::milliseconds Timeout=std::chrono::milliseconds(0)) const
Returns a list of the IDs of the registered users in a thread-safe way.
Allow exclusive access to some of Object's private methods to any LinkedObjectWrapper<T>.
constexpr LinkedObjectWrapperOnlyType(Object &Parent) noexcept
Construcs an instance - one for each Object instance.
Object & Parent
Owning Object instance.
Base class for all DynExp Objects like hardware adapters (DynExp::HardwareAdapterBase),...
virtual std::string GetName() const =0
Returns the name of this Object type.
ParamsConstTypeSyncPtrType GetParams(const std::chrono::milliseconds Timeout=GetParamsTimeoutDefault) const
Locks the mutex of the parameter class instance Params assigned to this Object instance and returns a...
std::string GetCategoryAndName() const
Builds a string from an Object's category and name to allow the user to identify an Object's type.
Util::Warning Warning
Last warning which occurred within this Object instance. (Logical const-ness: see above....
virtual std::string GetCategory() const =0
Returns the category of this Object type.
auto GetUserIDs(const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const
Returns a list of the IDs of the registered users in a thread-safe way.
virtual void EnsureReadyStateChild(bool IsAutomaticStartup)=0
Ensures that this Object instance is ready by possibly starting its worker thread or by opening conne...
ItemIDType GetID() const noexcept
Returns the ID of this Object instance. Thread-safe since ID is const.
auto GetUseCount(const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const
Counts the registered useres in a thread-safe way.
LinkedObjectWrapperOnlyType LinkedObjectWrapperOnly
Allow exclusive access to some of Object's private methods to any LinkedObjectWrapper<T>.
virtual bool IsReadyChild() const =0
Returns wheter this Object instance is ready (e.g. it is running or connected to a hardware device) a...
const std::thread::id OwnerThreadID
Thread id of the thread which has constructed (and owns) this Object instance.
virtual void ResetImpl(dispatch_tag< Object >)=0
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
auto GetUserNamesString(const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const
Builds a string describing which users are registered containing their object names,...
bool IsUnusedUnsafe()
Returns whether this Object instance is used by other instances (not thread-safe).
bool IsUnused(const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const
Returns whether this Object instance is used by other instances.
void ClearWarning() const
Resets Object::Warning.
auto GetUserNamesStringUnsafe() const
virtual void CheckLinkedObjectStatesChild() const
Override to implement a check whether linked objects are in a ready state.
const ParamsBasePtrType Params
Pointer to the parameter class instance belonging to this Object instance.
ObjectUserList UserList
List of Object instances making use of this Object instance. Other Object instances making use of thi...
virtual std::exception_ptr GetExceptionChild(const std::chrono::milliseconds Timeout) const =0
Returns a pointer to the exception which has caused this Object instance to fail.
auto GetWarning() const
Returns Object::Warning in a thread-safe way by copying its internal data.
bool IsReady() const
Returns wheter this Object instance is ready (e.g. it is running or connected to a hardware device) a...
std::exception_ptr GetException(const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const
Returns a pointer to the exception which has caused this Object instance to fail.
void DeregisterAllUnsafe()
Deregisters all users and notifies them that they need to check the states of their used linked objec...
bool IsSharedUsageEnabled(const std::chrono::milliseconds Timeout=GetParamsTimeoutDefault) const
Returns whether shared usage has been enabled for this Object instance. Refer to ParamsBase::UsageTyp...
auto GetObjectName(const std::chrono::milliseconds Timeout=GetParamsTimeoutDefault) const
Returns the name of this Object instance.
auto LockUserList(const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout)
Locks the user list for thread-safe manipulation.
void CheckLinkedObjectStates() const
Checks whether Object instances this instance uses are in a ready state. Override CheckLinkedObjectSt...
Refer to ParamsBase::dispatch_tag.
Dummy parameter which is to be owned once by parameter classes that do not contain any other paramete...
DummyParam(ParamsBase &Owner)
virtual void ResetChild() override
Resets this parameter to its default value.
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override
Appends this parameter to a settings dialog making it configurable by the user.
virtual void ToXMLNodeChild(QDomDocument &Document, QDomElement &XMLElement) const override
Converts this parameter to a Qt dom element (describing an XML node containing this parameter's name ...
virtual void FromXMLNodeChild(const QDomElement &XMLElement) override
Restores this parameter's value from the given Qt dom element (describing an XML node)
Base class for link list parameters to multiple Object of any (but all the same) type specifying the ...
LinkListParamBase(ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, std::string_view IconResourcePath={}, bool Optional=false)
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
virtual ItemIDListType GetLinkedIDsChild() const override
Returns a list of all object IDs assigned to this parameter.
virtual std::string_view GetLinkTitleChild() const noexcept override
Returns a reference to this link parameter's title.
Base class for link parameters to a single Object of any type specifying the underlying parameter typ...
LinkParamBase(ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, std::string_view IconResourcePath={}, bool Optional=false)
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
virtual std::string_view GetLinkTitleChild() const noexcept override
Returns a reference to this link parameter's title.
virtual ItemIDListType GetLinkedIDsChild() const override
Returns a list of all object IDs assigned to this parameter.
Makes sure the object link parameters of the associated ParamsBase instance are in a ready state by p...
bool EnsureReadyStateCalledForCurrentParam
Waiting for the current parameter to become ready or moving on to the next parameter?
ParamsBase::ObjectLinkParamsType::const_iterator CurrentParam
Iterator to the parameter which is currently being made ready.
LinkParamStarter(const ParamsBase &Params) noexcept
Constructs a LinkParamStarter instance for single use.
const ParamsBase & Params
Reference to a parameter class whose object link parameters have to be ready.
PrecisionType GetPrecision() const noexcept
Returns the value precision of the list items.
ArithmeticType GetIncrement() const noexcept
Returns the value increment of the list items.
ArithmeticType GetMinValue() const noexcept
Returns the minimal allowed value of the list items.
const ArithmeticType Increment
List item value increment (used in the settings dialog for manual parameter adjustment)
ArithmeticType GetMaxValue() const noexcept
Returns the maximal allowed value of the list items.
const ArithmeticType MinValue
Minimal allowed list item value.
const PrecisionType Precision
List item value precision (used in the settings dialog for manual parameter adjustment)
ListParam(ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, typename TypedListParamBase< ArithmeticType >::UnderlyingType DefaultValues={}, ArithmeticType MinValue=std::numeric_limits< ArithmeticType >::lowest(), ArithmeticType MaxValue=std::numeric_limits< ArithmeticType >::max(), ArithmeticType Increment=1, PrecisionType Precision=0)
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
const ArithmeticType MaxValue
Maximal allowed list item value.
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override final
Appends this parameter to a settings dialog making it configurable by the user.
bool ValidateValues(const typename TypedListParamBase< ArithmeticType >::UnderlyingType &NewValues) const override
unsigned short PrecisionType
ListParam(ParamsBase &Owner, std::string ParamName, typename TypedListParamBase< ArithmeticType >::UnderlyingType DefaultValues={}, ArithmeticType MinValue=std::numeric_limits< ArithmeticType >::lowest(), ArithmeticType MaxValue=std::numeric_limits< ArithmeticType >::max(), ArithmeticType Increment=1, PrecisionType Precision=0)
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dia...
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override final
Appends this parameter to a settings dialog making it configurable by the user.
virtual const CommonResourceManagerBase * GetCommonManagerChild() const noexcept override
This function can be used to determine the object type the parameter is expecting by comparing the re...
bool IsReadyChild() override final
Returns whether the object where this link parameter points to is in a ready state.
void EnsureReadyStateChild() override final
Thread-safe since only main thread is allowed to change parameters and to call this funtion.
virtual void FromXMLNodeChild(const QDomElement &XMLElement) override
Restores this parameter's value from the given Qt dom element (describing an XML node)
ListParam(ParamsBase &Owner, const ManagerType &Manager, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, std::string_view IconResourcePath={}, bool Optional=false, bool NeedsResetToApplyChange=true)
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
void MakeLinks()
Retrives the linked resource using its ID stored in the parameter and establishes a link to the resou...
ManagerTypeOfObjectType_t< ObjectType > ManagerType
Type of the manager managing the linked Object.
typename LinkType::ObjectType ObjectType
Type of the linked Object.
bool ValidateValues(const typename LinkListParamBase::UnderlyingType &NewValues) const override
Ensures that list entries do not have the ItemIDNotSet value.
std::vector< LinkType > Links
List of links of type LinkType derived from ObjectLinkBase referring to the linked Object....
const auto & GetLinks() const noexcept
Returns a list of links of type LinkType derived from ObjectLinkBase to the Object this parameter ref...
const auto & GetManager() const noexcept
Returns the manager instance containing the Object the link refers to.
bool ContainsID() const noexcept
Checks whether at least one item has been assigned to this parameter. Assigned items are not allowed ...
const ManagerType & Manager
Reference to the manager instance containing the Object the link refers to. Managers live longer than...
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override final
Appends this parameter to a settings dialog making it configurable by the user.
ListParam(ParamsBase &Owner, std::string ParamName, typename TypedListParamBase< ParamType >::UnderlyingType DefaultValues={})
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dia...
ListParam(ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, typename TypedListParamBase< ParamType >::UnderlyingType DefaultValues={})
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
Provides the class ParamsBase access to some private members of class ParamBase.
constexpr ParamsBaseOnlyType(ParamBase &Parent) noexcept
Construcs an instance - one for each ParamBase instance.
void AddToDialog(ParamsConfigDialog &Dialog)
Appends this parameter to a settings dialog making it configurable by the user.
ParamBase & Parent
Owning ParamBase instance.
void DisableUserEditable() noexcept
Sets the UserEditable property to false.
Abstract base class for a single object parameter. Parameters derived from this class are automatical...
auto & GetOwner() noexcept
Returns the ParamsBase instance owning this ParamBase instance.
const auto & GetOwner() const noexcept
Returns the ParamsBase instance owning this ParamBase instance.
bool IsUserEditable() const noexcept
Returns ParamBase::UserEditable.
ParamsBaseOnlyType ParamsBaseOnly
Provides the class ParamsBase access to some private members of class ParamBase.
const bool NeedsResetToApplyChange
Indicates whether the object owning this parameter needs to be reset to apply changes to this paramet...
const std::string_view ParamTitle
String which is displayed as a label when editing the parameter using ParamsConfigDialog.
bool GetNeedsResetToApplyChange() const noexcept
Returns ParamBase::NeedsResetToApplyChange.
std::string_view GetParamTitle() const noexcept
Returns ParamBase::ParamTitle.
std::string_view GetParamName() const noexcept
Returns ParamBase::ParamName.
const std::string_view ParamDescription
String which describes the parameter as a tooltip when using ParamsConfigDialog.
virtual void ResetChild()=0
Resets this parameter to its default value.
void DisableUserEditable() noexcept
Sets the UserEditable property to false.
virtual void AddToDialogChild(ParamsConfigDialog &Dialog)=0
Appends this parameter to a settings dialog making it configurable by the user.
virtual void FromXMLNodeChild(const QDomElement &XMLElement)=0
Restores this parameter's value from the given Qt dom element (describing an XML node)
ParamBase(const ParamBase &)=delete
ParamBase & operator=(const ParamBase &)=delete
ParamsBase & Owner
Owner of this parameter. Owner always lives longer than this object.
bool UserEditable
Is this parameter displayed in a settings dialog und thus editable by the user directly?...
void Reset()
Resets this parameter to its default value.
virtual bool ValidateChild() const
Checks whether a valid value is assigned to this parameter. This function is not const since it is al...
std::string_view GetParamDescription() const noexcept
Returns ParamBase::ParamDescription.
virtual void ToXMLNodeChild(QDomDocument &Document, QDomElement &XMLElement) const =0
Converts this parameter to a Qt dom element (describing an XML node containing this parameter's name ...
void AddToDialog(ParamsConfigDialog &Dialog)
Appends this parameter to a settings dialog making it configurable by the user.
const std::string ParamName
Identifier which is stored in project file.
Param(ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, ArithmeticType DefaultValue=ArithmeticType(), ArithmeticType MinValue=std::numeric_limits< ArithmeticType >::lowest(), ArithmeticType MaxValue=std::numeric_limits< ArithmeticType >::max(), ArithmeticType Increment=1, PrecisionType Precision=0)
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
const PrecisionType Precision
Value precision (used in the settings dialog for manual parameter adjustment)
unsigned short PrecisionType
const ArithmeticType MaxValue
Maximal allowed value.
PrecisionType GetPrecision() const noexcept
Returns the value precision.
virtual bool ValidateValue(const ArithmeticType &Value) const override
ArithmeticType GetIncrement() const noexcept
Returns the value increment.
Param(ParamsBase &Owner, std::string ParamName, ArithmeticType DefaultValue=ArithmeticType(), ArithmeticType MinValue=std::numeric_limits< ArithmeticType >::lowest(), ArithmeticType MaxValue=std::numeric_limits< ArithmeticType >::max(), ArithmeticType Increment=1, PrecisionType Precision=0)
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dia...
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override final
Appends this parameter to a settings dialog making it configurable by the user.
ArithmeticType GetMinValue() const noexcept
Returns the minimal allowed value.
const ArithmeticType MinValue
Minimal allowed value.
ArithmeticType GetMaxValue() const noexcept
Returns the maximal allowed value.
const ArithmeticType Increment
Value increment (used in the settings dialog for manual parameter adjustment)
const EnumType operator=(const EnumType &NewValue)
Assigns a new value to this parameter. Attention: operator= can change the parameter to a value which...
EnumType GetDefaultValue() const noexcept
Returns the default value of this parameter.
Param(ParamsBase &Owner, Util::TextValueListType< EnumType > &&TextValueList, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, EnumType DefaultValue=EnumType())
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
const Util::TextValueListType< EnumType > TextValueList
Predefined selection options.
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override final
Appends this parameter to a settings dialog making it configurable by the user.
const EnumType Get() const noexcept
Returns the selected EnumType's item of this parameter.
const auto & GetTextValueList() const noexcept
Returns the selection options as a mapping between strings and corresponding EnumType's items.
Param(ParamsBase &Owner, std::string ParamName, EnumType DefaultValue=EnumType())
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dia...
LinkType Link
Link of type LinkType derived from ObjectLinkBase referring to the linked Object. The link can be loc...
const ManagerType & Manager
Reference to the manager instance containing the Object the link refers to. Managers live longer than...
void EnsureReadyStateChild() override final
Thread-safe since only main thread is allowed to change parameters and to call this funtion.
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override final
Appends this parameter to a settings dialog making it configurable by the user.
const auto & GetManager() const noexcept
Returns the manager instance containing the Object the link refers to.
Param(ParamsBase &Owner, const ManagerType &Manager, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, std::string_view IconResourcePath={}, bool Optional=false, bool NeedsResetToApplyChange=true)
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
bool IsReadyChild() override final
Returns whether the object where this link parameter points to is in a ready state.
typename LinkType::ObjectType ObjectType
Type of the linked Object.
ManagerTypeOfObjectType_t< ObjectType > ManagerType
Type of the manager managing the linked Object.
const LinkType & GetLink() const noexcept
Returns the link of type LinkType derived from ObjectLinkBase to the Object the parameter refers to.
virtual void FromXMLNodeChild(const QDomElement &XMLElement) override
Restores this parameter's value from the given Qt dom element (describing an XML node)
bool ContainsID() const noexcept
Checks whether an item has been assigned to this parameter.
virtual const CommonResourceManagerBase * GetCommonManagerChild() const noexcept override
This function can be used to determine the object type the parameter is expecting by comparing the re...
void MakeLink()
Retrives the linked resource using its ID stored in the parameter and establishes a link to the resou...
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override final
Appends this parameter to a settings dialog making it configurable by the user.
Param(ParamsBase &Owner, std::string ParamName, ParamType DefaultValue=ParamType())
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dia...
Param(ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, ParamType DefaultValue=ParamType())
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
TextUsageType TextUsage
Purpose of this parameter's text.
Param(ParamsBase &Owner, std::string ParamName, UnderlyingTextParamType::UnderlyingType DefaultValue="")
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dia...
std::filesystem::path GetPath() const
Returns the parameter's value as a path. Relative paths are resolved using ParamsBase::ToAbsolutePath...
auto GetTextUsage() const noexcept
Returns the purpose of this parameter's text.
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override final
Appends this parameter to a settings dialog making it configurable by the user.
Param(ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, UnderlyingTextParamType::UnderlyingType DefaultValue="", TextUsageType TextUsage=TextUsageType::Standard)
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override final
Appends this parameter to a settings dialog making it configurable by the user.
Param(ParamsBase &Owner, Util::TextListType &&TextList, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, UnderlyingTextListParamType::UnderlyingType DefaultValue="")
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
Util::TextListType TextList
Predefined selection options. Not constant because this should be changeable dynamically (e....
const auto & GetTextList() const noexcept
Returns the predefined selection options as a list of strings.
void SetTextList(Util::TextListType &&NewTextList)
Resets the predefined list of strings to select a string from.
Param(ParamsBase &Owner, Util::TextListType &&TextList, std::string ParamName, UnderlyingTextListParamType::UnderlyingType DefaultValue="")
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dia...
const auto & GetTextList() const noexcept
Returns the predefined selection options as a list of strings.
const Util::TextListType TextList
Predefined selection options.
Param(ParamsBase &Owner, Util::TextListType &&TextList, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, UnderlyingIndexedTextListParamType::UnderlyingType DefaultValue=0)
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
virtual bool ValidateValue(const ParamType &Value) const override
Called by ValidateChild(). Validates a single value. Override to validate the value which is about to...
virtual void AddToDialogChild(ParamsConfigDialog &Dialog) override final
Appends this parameter to a settings dialog making it configurable by the user.
Param(ParamsBase &Owner, Util::TextListType &&TextList, std::string ParamName, UnderlyingIndexedTextListParamType::UnderlyingType DefaultValue=0)
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dia...
Base class of parameters containing lists of values.
const UnderlyingType DefaultValues
Values to assign to the parameter upon construction and reset.
UnderlyingType Values
Current parameter values.
auto & operator=(const UnderlyingType &NewValues)
Assigns new values to this parameter. The operator cannot be accessed by Object because this function...
std::vector< ParamType > UnderlyingType
List type to be used for the parameter.
const auto & GetDefaultValue() const noexcept
Returns this parameter's default value list. Thread-safe since a reference to a const member variable...
const auto & Get() const noexcept
Returns the parameter's values.
TypedListParamBase(ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, UnderlyingType DefaultValues={})
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
virtual void ResetChild() override
Resets this parameter to its default value.
TypedListParamBase(ParamsBase &Owner, std::string ParamName, UnderlyingType DefaultValues={})
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dia...
virtual void ToXMLNodeChild(QDomDocument &Document, QDomElement &XMLElement) const override
Converts this parameter to a Qt dom element (describing an XML node containing this parameter's name ...
virtual bool ValidateValues(const UnderlyingType &NewValues) const
Called by ValidateChild(). Validates a list of values. Override to validate the vector which is about...
virtual void FromXMLNodeChild(const QDomElement &XMLElement) override
Restores this parameter's value from the given Qt dom element (describing an XML node)
virtual bool ValidateChild() const override final
Checks whether a valid value is assigned to this parameter. This function is not const since it is al...
Base class of parameters containing a single value.
const ParamType DefaultValue
Value to assign to the parameter upon construction and reset.
ParamType Value
Current parameter value.
TypedParamBase(ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, ParamType DefaultValue=ParamType())
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog ...
virtual void FromXMLNodeChild(const QDomElement &XMLElement) override
Restores this parameter's value from the given Qt dom element (describing an XML node)
virtual void ResetChild() override
Resets this parameter to its default value.
virtual bool ValidateValue(const ParamType &NewValue) const
Called by ValidateChild(). Validates a single value. Override to validate the value which is about to...
const ParamType & operator=(const ParamType &NewValue)
Assigns a new value to this parameter. The operator cannot be accessed by Object because this functio...
virtual bool ValidateChild() const override final
Checks whether a valid value is assigned to this parameter. This function is not const since it is al...
ParamType GetDefaultValue() const noexcept
Returns this parameter's default value. Thread-safe since a const member variable is returned.
virtual void ToXMLNodeChild(QDomDocument &Document, QDomElement &XMLElement) const override
Converts this parameter to a Qt dom element (describing an XML node containing this parameter's name ...
TypedParamBase(ParamsBase &Owner, std::string ParamName, ParamType DefaultValue=ParamType())
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dia...
const ParamType & Get() const noexcept
Returns the parameter's value.
Abstract base class for object parameter classes. Each class derived from class Object must be accomp...
virtual const char * GetParamClassTag() const noexcept
This function is intended to be overridden once in each derived class returning the name of the respe...
const char *const ClassTag
Denotes the result of GetParamClassTag() of the class where the respective OwnedParam was declared in...
std::conditional_t< std::is_signed_v< std::underlying_type_t< EnumType > >, EnumParamSignedIntegerType, EnumParamUnsignedIntegerType > LargestEnumUnderlyingType
Type trait providing an integer type for enumeration types which allows to store the value of enumera...
const auto & GetObjectLinkParams() const noexcept
Returns a list of all object link parameters owned by this parameter class instance.
std::vector< std::reference_wrapper< LinkBase > > ObjectLinkParamsType
Type of a list of all owned object link parameters.
bool ConfigureUsageType() const noexcept
Determines whether the Usage parameter should be configurable in the settings dialog....
virtual void ConfigureParamsImpl(dispatch_tag< ParamsBase >)
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
ItemIDType GetID() const noexcept
Returns the ID of the Object this parameter class instance belongs to.
OwnedParamsType OwnedParams
List of all parameters owned by this parameter class instance.
std::vector< OwnedParamInfo > OwnedParamsType
List type of information on parameters owned by this ParamsBase instance (and its derived classes)
uintmax_t EnumParamUnsignedIntegerType
Parameter type to convert unsigned eumeration parameters to.
intmax_t EnumParamSignedIntegerType
Parameter type to convert signed eumeration parameters to.
const NetworkParamsExtension * GetNetworkAddressParams() const noexcept
Returns the network address parameters of a derived gRPC instrument. Override GetNetworkAddressParams...
virtual const NetworkParamsExtension * GetNetworkAddressParamsChild() const noexcept
Returns the network address parameters of a derived gRPC instrument. Override GetNetworkAddressParams...
ParamsBase(ItemIDType ID, const DynExpCore &Core)
Constructs the base class of an object parameter class.
UsageType
Determines whether an Object can be linked to only one (unique) or multiple (shared) other objects.
ObjectLinkParamsType ObjectLinkParams
List of all object link parameters owned by this parameter class instance.
const ItemIDType ID
ID of the Object this parameter class instance belongs to.
virtual bool ConfigureUsageTypeChild() const noexcept
Determines whether the Usage parameter should be configurable in the settings dialog....
const auto & GetCore() const noexcept
Returns a reference to DynExp's core.
Util::TextType Text
String type of text-type parameters (DynExp::ParamsBase::Param)
const DynExpCore & Core
Reference to DynExp's core.
const std::reference_wrapper< ParamBase > OwnedParam
Reference to the parameter.
Type to identify an indexed text list parameter (one number selected from a list of numbers associate...
Type to identify a text list parameter (one string selected from a list of strings)
Helper type owning a reference to a parameter and its class tag.
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...
LinkedObjectWrapperBase::ListType OwnedLinkedObjectWrappers
List of all LinkedObjectWrapper instances owned by this RunnableInstance instance (thus belonging to ...
const Object::ParamsGetterType ParamsGetter
Invoke to obtain the parameters (derived from ParamsBase) of Owner.
void UnlockObject(LinkedObjectWrapperContainer< ObjectT > &ObjectWrapperContainer)
Unlocks an Object instance stored in the LinkedObjectWrapperContainer ObjectWrapperContainer....
void TryLockObject(const ParamsBase::Param< ObjectLink< ObjectT >> &LinkParam, LinkedObjectWrapperContainer< ObjectT > &ObjectWrapperContainer, std::chrono::milliseconds Timeout=ObjectLinkBase::LockObjectTimeoutDefault)
Locks an Object instance referenced by a parameter LinkParam of type ParamsBase::Param< ObjectLink< O...
void UnlockObject(LinkedObjectWrapperContainerList< ObjectT > &ObjectWrapperContainerList)
Unlocks Object instances stored in the LinkedObjectWrapperContainerList ObjectWrapperContainerList.
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....
void LockObject(const ParamsBase::ListParam< ObjectLink< ObjectT >> &LinkListParam, LinkedObjectWrapperContainerList< ObjectT > &ObjectWrapperContainerList, std::chrono::milliseconds Timeout=ObjectLinkBase::LockObjectTimeoutDefault)
Locks Object instances referenced by a list parameter LinkListParam of type ParamsBase::ListParam< Ob...
void LockObject(const ParamsBase::Param< ObjectLink< ObjectT >> &LinkParam, LinkedObjectWrapperContainer< ObjectT > &ObjectWrapperContainer, std::chrono::milliseconds Timeout=ObjectLinkBase::LockObjectTimeoutDefault)
Locks an Object instance referenced by a parameter LinkParam of type ParamsBase::Param< ObjectLink< O...
const auto & GetOwner() const noexcept
Returns Owner.
Configurator class for RunnableObject.
RunnableObjectConfigurator()=default
Parameter class for RunnableObject.
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...
virtual void ConfigureParamsImpl(dispatch_tag< RunnableObjectParams >)
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
bool ConfigureStartupType() const noexcept
Determines whether the Startup parameter should be user-configurable in settings dialogs....
StartupType
Determines when a RunnableObject instance is started.
virtual bool ConfigureStartupTypeChild() const noexcept
Determines whether the Startup parameter should be user-configurable in settings dialogs....
RunnableObjectParams(ItemIDType ID, const DynExpCore &Core)
Constructs the base class of an object parameter class.
Exception type thrown by TerminateImpl() if the RunnableObject cannot be terminated for being used by...
NotUnusedException(const RunnableObject &Parent)
Constructs an exception instance. Initializes UserNames with the content of ObjectUserList::GetUserNa...
std::string_view GetUserNames() const
Getter for UserNames.
std::string UserNames
String with identifiers of the Object instances making use of the throwing RunnableObject instance.
Allow exclusive access to some of RunnableObject's private methods to class RunnableInstance.
void OnThreadHasExited() const noexcept
This function is called when the RunnableObject instance's thread terminates. The thread receives a R...
bool IsLinkedObjStateCheckRequested() const noexcept
Indicates whether the RunnableInstance instance belonging to this RunnableObject instance's thread sh...
RunnableObject & Parent
Owning RunnableObject instance.
constexpr RunnableInstanceOnlyType(RunnableObject &Parent) noexcept
Construcs an instance - one for each RunnableObject instance.
void ResetLinkedObjStateCheckRequested() const noexcept
Sets RunnableObject::LinkedObjStateCheckRequested to false.
Defines an Object which possesses a thread it runs in. The RunnableObject can be started and stopped ...
auto GetStartupType() const noexcept
Returns Startup.
virtual void NotifyChild()
Notify derived classes that some state has changed (e.g. the termination of Thread is requested) and ...
virtual void RunChild()=0
Refer to Run().
void SetReasonWhyPaused(const Util::Exception &e)
Sets the reason why this RunnableObject instance has been paused.
void CheckLinkedObjectStatesChild() const override final
Override to implement a check whether linked objects are in a ready state.
virtual std::unique_ptr< BusyDialog > MakeStartupBusyDialogChild(QWidget *ParentWidget) const
Override to make this function return a pointer to a BusyDialog instance. Refer to Run().
bool IsExiting() const noexcept
Returns ShouldExit.
bool IsPaused() const noexcept
Returns Paused.
virtual void ResetImpl(dispatch_tag< RunnableObject >)=0
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
RunnableInstanceOnlyType RunnableInstanceOnly
Allow exclusive access to some of RunnableObject's private methods to class RunnableInstance.
auto GetReasonWhyPaused() const
Returns ReasonWhyPaused.
void ClearReasonWhyPaused()
Removes the reason why this RunnableObject instance has been paused (since it is resumed).
void SetReasonWhyPaused(std::string Description)
Sets the reason why this RunnableObject instance has been paused.
bool IsRunning() const noexcept
Returns Running.
virtual void TerminateChild(const std::chrono::milliseconds Timeout)
Signals derived classes that terminating the RunnableObject instance's thread is about to be requeste...
Defines the configuration dialog. The dialog must be displayed by calling ParamsConfigDialog::Display...
Wraps a member function of some object and stores its default arguments. Moving from CallableMemberWr...
Thrown when a list is expected to contain entries and when a query results in an empty answer or an e...
void Log(const std::string &Message, const ErrorType Type=ErrorType::Info, const size_t Line=0, const std::string &Function="", const std::string &File="", const int ErrorCode=0, const std::stacktrace &Trace={}) noexcept
Logs an event from information specified manually.
DynExp exceptions are derived from this class. It contains basic information about the cause of the e...
Class to forward an Exception instance from one DynExp::Object instance to another DynExp::Object ins...
Interface to allow synchronizing the access to derived classes between different threads by providing...
std::unique_lock< MutexType > LockType
static constexpr std::chrono::milliseconds DefaultTimeout
Duration which is used as a default timeout within all methods of this class if no different duration...
Interface to delete copy constructor and copy assignment operator and thus make derived classes non-c...
An invalid argument like a null pointer has been passed to a function.
Thrown when RunnableInstance cannot lock an object to be used by another object due to an invalid lin...
An operation cannot be performed currently since the related object is in an invalid state like an er...
Thrown when RunnableInstance::LockObject() has not been called on an object link parameter to establi...
Thrown when a requested ressource does not exist.
Thrown when a requested feature is either under development and thus not implemented yet or when a sp...
Thrown when an argument passed to a function exceeds the valid range.
Pointer to lock a class derived from ISynchronizedPointerLockable for synchronizing between threads....
Thrown when an operation timed out before it could be completed, especially used for locking shared d...
Thrown when an attempt was made to convert two incompatible types into each other.
Class to store information about warnings in a thread-safe manner (deriving from ILockable)....
DynExp's main namespace contains the implementation of DynExp including classes to manage resources (...
std::conditional_t< std::is_base_of_v< HardwareAdapterBase, ObjectType >, HardwareAdapterManager, InstrumentManager > type
Resource manager type managing instances of type ObjectType.
TextUsageType
Specifies the usage of a text-type parameter. Setting the right usage allows the ParamsConfigDialog t...
ParamsBasePtrType MakeParams(ItemIDType ID, const DynExpCore &Core)
Factory function to generate an Object's parameters.
auto operator<=>(const ParamsBase::TypedParamBase< ParamType > &lhs, const ParamType &rhs)
Provides three-way comparison for two parameters.
std::vector< ItemIDType > ItemIDListType
Type of a list of IDs belonging to objects managed by DynExp.
T::ParamsType * dynamic_Params_cast(ParamsBasePtrType::element_type *Params)
Casts the parameter base class to a derived Object's parameter class.
auto operator==(const ParamsBase::TypedParamBase< ParamType > &lhs, const ParamType &rhs)
Provides (in)equality comparison operators for two parameters. Since C++20, inequality operators (ope...
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.
typename ManagerTypeOfObjectType< ObjectType >::type ManagerTypeOfObjectType_t
Alias for a resource manager type (derived from DynExp::CommonResourceManagerBase) managing resources...
auto dynamic_Object_cast(From *Obj)
Casts an Object to a derived type.
std::shared_ptr< ConfiguratorBase > ConfiguratorBasePtrType
Alias for a pointer to the configurator base class ConfiguratorBase.
Type trait relating a type ObjectType derived from either class HardwareAdapterBase or class Instrume...
DynExp's Util namespace contains commonly used functions and templates as well as extensions to Qt an...
std::string ToStr(const T &Value, int Precision=-1)
Converts a (numeric) value of type T to a std::string using operator<< of std::stringstream.
std::vector< TextType > TextListType
List type of text-type parameters.
QDomElement GetSingleChildDOMElement(const QDomElement &Parent, const QString &ChildTagName)
Behaves like GetSingleChildDOMNode() but returns the node converted to a DOM element.
EventLogger & EventLog()
This function holds a static EventLogger instance and returns a reference to it. DynExp uses only one...
std::vector< QDomNode > GetChildDOMNodes(const QDomElement &Parent, const QString &ChildTagName)
Finds child nodes with a certain tag name.
std::string TextType
String type of text-type parameters (DynExp::ParamsBase::Param)
std::vector< std::pair< TextType, ValueType > > TextValueListType
Type of a list containing key-value pairs where key is a text of type Util::TextType.
Accumulates include statements to provide a precompiled header.
Return type of ConfiguratorBase::UpdateConfigFromDialog() indicating the result of the configurator d...
constexpr bool IsResetRequired() const noexcept
Checks whether the corresponding Object has to be reset to apply changed parameters.
constexpr UpdateConfigFromDialogResult(bool Accepted, bool ResetRequired) noexcept
Constructs an UpdateConfigFromDialogResult instance.
const bool Accepted
Has the dialog been accepted clicking 'OK'?
constexpr bool IsAccepted() const noexcept
Returns UpdateConfigFromDialogResult::Accepted.
const bool ResetRequired
Has the user changed settings which require resetting the corresponding Object?
Helper type linking a LinkedObjectWrapperBasePtrType to the corresponding LinkedObjectWrapperContaine...
LinkedObjectWrapperBasePtrType OwnedLinkedObjectWrapperPtr
Pointer owning an instance of LinkedObjectWrapperBase.
LinkedObjectWrapperContainerBase & OwnedLinkedObjectWrapperContainer
Reference to a LinkedObjectWrapperContainerBase instance holding a non-owning pointer to the instance...
OwnedLinkedObjectWrapperType(LinkedObjectWrapperBasePtrType &&OwnedLinkedObjectWrapperPtr, LinkedObjectWrapperContainerBase &OwnedLinkedObjectWrapperContainer)
Constructs a OwnedLinkedObjectWrapperType instance.
Defines a DynExp resource, which mainly owns a DynExp::Object instance wrapping a pointer to it.