Skip to main content

opendaq/generated/
component.rs

1// Generated by tools/generate_bindings.py -- do not edit by hand.
2
3// Mechanical output: lint findings here are the generator's business.
4#![allow(clippy::all, unused_imports, rustdoc::bare_urls)]
5
6use crate::error::{check, Error, Result};
7use crate::object::{BaseObject, Interface, Ref};
8use crate::sys;
9use crate::value::{Complex, Ratio, Value};
10use crate::generated::*;
11use std::ffi::c_char;
12
13/// Acts as a base interface for components, such as device, function block, channel and signal.
14/// The IComponent provides a set of methods that are common to all components:
15/// LocalID, GlobalID and Active properties.
16/// Wrapper over the openDAQ `daqComponent` interface.
17#[repr(transparent)]
18#[derive(Clone, Debug)]
19pub struct Component(pub(crate) PropertyObject);
20
21impl std::ops::Deref for Component {
22    type Target = PropertyObject;
23    fn deref(&self) -> &PropertyObject { &self.0 }
24}
25impl crate::sealed::Sealed for Component {}
26unsafe impl Interface for Component {
27    const NAME: &'static str = "daqComponent";
28    fn interface_id() -> Option<crate::IntfID> {
29        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
30        unsafe { (crate::sys::api().daqComponent_getInterfaceId)(&mut id) };
31        Some(id)
32    }
33    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
34        Ref::from_owned(ptr).map(Self::__from_ref)
35    }
36    fn as_base_object(&self) -> &BaseObject { &self.0 }
37}
38impl Component {
39    #[doc(hidden)]
40    pub(crate) fn __from_ref(r: Ref) -> Self { Component(PropertyObject::__from_ref(r)) }
41}
42impl std::fmt::Display for Component {
43    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
44        std::fmt::Display::fmt(self.as_base_object(), f)
45    }
46}
47impl From<&Component> for Value {
48    fn from(value: &Component) -> Value { Value::Object(value.to_base_object()) }
49}
50impl From<Component> for Value {
51    fn from(value: Component) -> Value { Value::Object(value.to_base_object()) }
52}
53impl crate::value::FromDaqOwned for Component {
54    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
55        crate::value::cast_owned(ptr, op)
56    }
57}
58
59/// Wrapper over the openDAQ `daqComponentDeserializeContext` interface.
60#[repr(transparent)]
61#[derive(Clone, Debug)]
62pub struct ComponentDeserializeContext(pub(crate) BaseObject);
63
64impl std::ops::Deref for ComponentDeserializeContext {
65    type Target = BaseObject;
66    fn deref(&self) -> &BaseObject { &self.0 }
67}
68impl crate::sealed::Sealed for ComponentDeserializeContext {}
69unsafe impl Interface for ComponentDeserializeContext {
70    const NAME: &'static str = "daqComponentDeserializeContext";
71    fn interface_id() -> Option<crate::IntfID> {
72        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
73        unsafe { (crate::sys::api().daqComponentDeserializeContext_getInterfaceId)(&mut id) };
74        Some(id)
75    }
76    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
77        Ref::from_owned(ptr).map(Self::__from_ref)
78    }
79    fn as_base_object(&self) -> &BaseObject { &self.0 }
80}
81impl ComponentDeserializeContext {
82    #[doc(hidden)]
83    pub(crate) fn __from_ref(r: Ref) -> Self { ComponentDeserializeContext(BaseObject(r)) }
84}
85impl std::fmt::Display for ComponentDeserializeContext {
86    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
87        std::fmt::Display::fmt(self.as_base_object(), f)
88    }
89}
90impl From<&ComponentDeserializeContext> for Value {
91    fn from(value: &ComponentDeserializeContext) -> Value { Value::Object(value.to_base_object()) }
92}
93impl From<ComponentDeserializeContext> for Value {
94    fn from(value: ComponentDeserializeContext) -> Value { Value::Object(value.to_base_object()) }
95}
96impl crate::value::FromDaqOwned for ComponentDeserializeContext {
97    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
98        crate::value::cast_owned(ptr, op)
99    }
100}
101
102/// Wrapper over the openDAQ `daqComponentHolder` interface.
103#[repr(transparent)]
104#[derive(Clone, Debug)]
105pub struct ComponentHolder(pub(crate) BaseObject);
106
107impl std::ops::Deref for ComponentHolder {
108    type Target = BaseObject;
109    fn deref(&self) -> &BaseObject { &self.0 }
110}
111impl crate::sealed::Sealed for ComponentHolder {}
112unsafe impl Interface for ComponentHolder {
113    const NAME: &'static str = "daqComponentHolder";
114    fn interface_id() -> Option<crate::IntfID> {
115        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
116        unsafe { (crate::sys::api().daqComponentHolder_getInterfaceId)(&mut id) };
117        Some(id)
118    }
119    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
120        Ref::from_owned(ptr).map(Self::__from_ref)
121    }
122    fn as_base_object(&self) -> &BaseObject { &self.0 }
123}
124impl ComponentHolder {
125    #[doc(hidden)]
126    pub(crate) fn __from_ref(r: Ref) -> Self { ComponentHolder(BaseObject(r)) }
127}
128impl std::fmt::Display for ComponentHolder {
129    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
130        std::fmt::Display::fmt(self.as_base_object(), f)
131    }
132}
133impl From<&ComponentHolder> for Value {
134    fn from(value: &ComponentHolder) -> Value { Value::Object(value.to_base_object()) }
135}
136impl From<ComponentHolder> for Value {
137    fn from(value: ComponentHolder) -> Value { Value::Object(value.to_base_object()) }
138}
139impl crate::value::FromDaqOwned for ComponentHolder {
140    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
141        crate::value::cast_owned(ptr, op)
142    }
143}
144
145/// Provides access to private methods of the component.
146/// Said methods allow for triggering a Core event of the component, and locking/unlocking attributes of
147/// the component.
148/// Wrapper over the openDAQ `daqComponentPrivate` interface.
149#[repr(transparent)]
150#[derive(Clone, Debug)]
151pub struct ComponentPrivate(pub(crate) BaseObject);
152
153impl std::ops::Deref for ComponentPrivate {
154    type Target = BaseObject;
155    fn deref(&self) -> &BaseObject { &self.0 }
156}
157impl crate::sealed::Sealed for ComponentPrivate {}
158unsafe impl Interface for ComponentPrivate {
159    const NAME: &'static str = "daqComponentPrivate";
160    fn interface_id() -> Option<crate::IntfID> {
161        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
162        unsafe { (crate::sys::api().daqComponentPrivate_getInterfaceId)(&mut id) };
163        Some(id)
164    }
165    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
166        Ref::from_owned(ptr).map(Self::__from_ref)
167    }
168    fn as_base_object(&self) -> &BaseObject { &self.0 }
169}
170impl ComponentPrivate {
171    #[doc(hidden)]
172    pub(crate) fn __from_ref(r: Ref) -> Self { ComponentPrivate(BaseObject(r)) }
173}
174impl std::fmt::Display for ComponentPrivate {
175    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
176        std::fmt::Display::fmt(self.as_base_object(), f)
177    }
178}
179impl From<&ComponentPrivate> for Value {
180    fn from(value: &ComponentPrivate) -> Value { Value::Object(value.to_base_object()) }
181}
182impl From<ComponentPrivate> for Value {
183    fn from(value: ComponentPrivate) -> Value { Value::Object(value.to_base_object()) }
184}
185impl crate::value::FromDaqOwned for ComponentPrivate {
186    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
187        crate::value::cast_owned(ptr, op)
188    }
189}
190
191/// A container of Component Statuses and their corresponding values.
192/// Each status has a unique name and represents an actual status related to the openDAQ Component,
193/// such as connection status, synchronization status, etc. The statuses' values are represented
194/// by Enumeration objects.
195/// Wrapper over the openDAQ `daqComponentStatusContainer` interface.
196#[repr(transparent)]
197#[derive(Clone, Debug)]
198pub struct ComponentStatusContainer(pub(crate) BaseObject);
199
200impl std::ops::Deref for ComponentStatusContainer {
201    type Target = BaseObject;
202    fn deref(&self) -> &BaseObject { &self.0 }
203}
204impl crate::sealed::Sealed for ComponentStatusContainer {}
205unsafe impl Interface for ComponentStatusContainer {
206    const NAME: &'static str = "daqComponentStatusContainer";
207    fn interface_id() -> Option<crate::IntfID> {
208        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
209        unsafe { (crate::sys::api().daqComponentStatusContainer_getInterfaceId)(&mut id) };
210        Some(id)
211    }
212    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
213        Ref::from_owned(ptr).map(Self::__from_ref)
214    }
215    fn as_base_object(&self) -> &BaseObject { &self.0 }
216}
217impl ComponentStatusContainer {
218    #[doc(hidden)]
219    pub(crate) fn __from_ref(r: Ref) -> Self { ComponentStatusContainer(BaseObject(r)) }
220}
221impl std::fmt::Display for ComponentStatusContainer {
222    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
223        std::fmt::Display::fmt(self.as_base_object(), f)
224    }
225}
226impl From<&ComponentStatusContainer> for Value {
227    fn from(value: &ComponentStatusContainer) -> Value { Value::Object(value.to_base_object()) }
228}
229impl From<ComponentStatusContainer> for Value {
230    fn from(value: ComponentStatusContainer) -> Value { Value::Object(value.to_base_object()) }
231}
232impl crate::value::FromDaqOwned for ComponentStatusContainer {
233    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
234        crate::value::cast_owned(ptr, op)
235    }
236}
237
238/// Provides access to private methods of the Component status container.
239/// Said methods allow for adding new statuses and setting a value for existing statuses stored in
240/// the component status container. Device connection statuses, however, are managed independently
241/// via IConnectionStatusContainerPrivate.
242/// "StatusChanged" Core events are triggered whenever there is a change in the status of the openDAQ Component.
243/// Wrapper over the openDAQ `daqComponentStatusContainerPrivate` interface.
244#[repr(transparent)]
245#[derive(Clone, Debug)]
246pub struct ComponentStatusContainerPrivate(pub(crate) BaseObject);
247
248impl std::ops::Deref for ComponentStatusContainerPrivate {
249    type Target = BaseObject;
250    fn deref(&self) -> &BaseObject { &self.0 }
251}
252impl crate::sealed::Sealed for ComponentStatusContainerPrivate {}
253unsafe impl Interface for ComponentStatusContainerPrivate {
254    const NAME: &'static str = "daqComponentStatusContainerPrivate";
255    fn interface_id() -> Option<crate::IntfID> {
256        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
257        unsafe { (crate::sys::api().daqComponentStatusContainerPrivate_getInterfaceId)(&mut id) };
258        Some(id)
259    }
260    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
261        Ref::from_owned(ptr).map(Self::__from_ref)
262    }
263    fn as_base_object(&self) -> &BaseObject { &self.0 }
264}
265impl ComponentStatusContainerPrivate {
266    #[doc(hidden)]
267    pub(crate) fn __from_ref(r: Ref) -> Self { ComponentStatusContainerPrivate(BaseObject(r)) }
268}
269impl std::fmt::Display for ComponentStatusContainerPrivate {
270    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
271        std::fmt::Display::fmt(self.as_base_object(), f)
272    }
273}
274impl From<&ComponentStatusContainerPrivate> for Value {
275    fn from(value: &ComponentStatusContainerPrivate) -> Value { Value::Object(value.to_base_object()) }
276}
277impl From<ComponentStatusContainerPrivate> for Value {
278    fn from(value: ComponentStatusContainerPrivate) -> Value { Value::Object(value.to_base_object()) }
279}
280impl crate::value::FromDaqOwned for ComponentStatusContainerPrivate {
281    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
282        crate::value::cast_owned(ptr, op)
283    }
284}
285
286/// Provides information about the component types.
287/// Is a Struct core type, and has access to Struct methods internally. Note that the Default config is not part of
288/// the Struct fields.
289/// Wrapper over the openDAQ `daqComponentType` interface.
290#[repr(transparent)]
291#[derive(Clone, Debug)]
292pub struct ComponentType(pub(crate) BaseObject);
293
294impl std::ops::Deref for ComponentType {
295    type Target = BaseObject;
296    fn deref(&self) -> &BaseObject { &self.0 }
297}
298impl crate::sealed::Sealed for ComponentType {}
299unsafe impl Interface for ComponentType {
300    const NAME: &'static str = "daqComponentType";
301    fn interface_id() -> Option<crate::IntfID> {
302        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
303        unsafe { (crate::sys::api().daqComponentType_getInterfaceId)(&mut id) };
304        Some(id)
305    }
306    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
307        Ref::from_owned(ptr).map(Self::__from_ref)
308    }
309    fn as_base_object(&self) -> &BaseObject { &self.0 }
310}
311impl ComponentType {
312    #[doc(hidden)]
313    pub(crate) fn __from_ref(r: Ref) -> Self { ComponentType(BaseObject(r)) }
314}
315impl std::fmt::Display for ComponentType {
316    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
317        std::fmt::Display::fmt(self.as_base_object(), f)
318    }
319}
320impl From<&ComponentType> for Value {
321    fn from(value: &ComponentType) -> Value { Value::Object(value.to_base_object()) }
322}
323impl From<ComponentType> for Value {
324    fn from(value: ComponentType) -> Value { Value::Object(value.to_base_object()) }
325}
326impl crate::value::FromDaqOwned for ComponentType {
327    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
328        crate::value::cast_owned(ptr, op)
329    }
330}
331
332/// Builder component of Component type objects. Contains setter methods to configure the Component type parameters, and a `build` method that builds the object.
333/// Depending on the set "Type" builder parameter, a different Component type is created - eg. Streaming type,
334/// Device type, Function block type, or Server type
335/// Wrapper over the openDAQ `daqComponentTypeBuilder` interface.
336#[repr(transparent)]
337#[derive(Clone, Debug)]
338pub struct ComponentTypeBuilder(pub(crate) BaseObject);
339
340impl std::ops::Deref for ComponentTypeBuilder {
341    type Target = BaseObject;
342    fn deref(&self) -> &BaseObject { &self.0 }
343}
344impl crate::sealed::Sealed for ComponentTypeBuilder {}
345unsafe impl Interface for ComponentTypeBuilder {
346    const NAME: &'static str = "daqComponentTypeBuilder";
347    fn interface_id() -> Option<crate::IntfID> {
348        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
349        unsafe { (crate::sys::api().daqComponentTypeBuilder_getInterfaceId)(&mut id) };
350        Some(id)
351    }
352    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
353        Ref::from_owned(ptr).map(Self::__from_ref)
354    }
355    fn as_base_object(&self) -> &BaseObject { &self.0 }
356}
357impl ComponentTypeBuilder {
358    #[doc(hidden)]
359    pub(crate) fn __from_ref(r: Ref) -> Self { ComponentTypeBuilder(BaseObject(r)) }
360}
361impl std::fmt::Display for ComponentTypeBuilder {
362    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
363        std::fmt::Display::fmt(self.as_base_object(), f)
364    }
365}
366impl From<&ComponentTypeBuilder> for Value {
367    fn from(value: &ComponentTypeBuilder) -> Value { Value::Object(value.to_base_object()) }
368}
369impl From<ComponentTypeBuilder> for Value {
370    fn from(value: ComponentTypeBuilder) -> Value { Value::Object(value.to_base_object()) }
371}
372impl crate::value::FromDaqOwned for ComponentTypeBuilder {
373    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
374        crate::value::cast_owned(ptr, op)
375    }
376}
377
378/// Private interface to component type. Allows for setting the module information.
379/// Wrapper over the openDAQ `daqComponentTypePrivate` interface.
380#[repr(transparent)]
381#[derive(Clone, Debug)]
382pub struct ComponentTypePrivate(pub(crate) BaseObject);
383
384impl std::ops::Deref for ComponentTypePrivate {
385    type Target = BaseObject;
386    fn deref(&self) -> &BaseObject { &self.0 }
387}
388impl crate::sealed::Sealed for ComponentTypePrivate {}
389unsafe impl Interface for ComponentTypePrivate {
390    const NAME: &'static str = "daqComponentTypePrivate";
391    fn interface_id() -> Option<crate::IntfID> {
392        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
393        unsafe { (crate::sys::api().daqComponentTypePrivate_getInterfaceId)(&mut id) };
394        Some(id)
395    }
396    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
397        Ref::from_owned(ptr).map(Self::__from_ref)
398    }
399    fn as_base_object(&self) -> &BaseObject { &self.0 }
400}
401impl ComponentTypePrivate {
402    #[doc(hidden)]
403    pub(crate) fn __from_ref(r: Ref) -> Self { ComponentTypePrivate(BaseObject(r)) }
404}
405impl std::fmt::Display for ComponentTypePrivate {
406    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
407        std::fmt::Display::fmt(self.as_base_object(), f)
408    }
409}
410impl From<&ComponentTypePrivate> for Value {
411    fn from(value: &ComponentTypePrivate) -> Value { Value::Object(value.to_base_object()) }
412}
413impl From<ComponentTypePrivate> for Value {
414    fn from(value: ComponentTypePrivate) -> Value { Value::Object(value.to_base_object()) }
415}
416impl crate::value::FromDaqOwned for ComponentTypePrivate {
417    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
418        crate::value::cast_owned(ptr, op)
419    }
420}
421
422/// @ingroup types_utility
423/// @defgroup types_updatable Updatable
424/// Wrapper over the openDAQ `daqComponentUpdateContext` interface.
425#[repr(transparent)]
426#[derive(Clone, Debug)]
427pub struct ComponentUpdateContext(pub(crate) BaseObject);
428
429impl std::ops::Deref for ComponentUpdateContext {
430    type Target = BaseObject;
431    fn deref(&self) -> &BaseObject { &self.0 }
432}
433impl crate::sealed::Sealed for ComponentUpdateContext {}
434unsafe impl Interface for ComponentUpdateContext {
435    const NAME: &'static str = "daqComponentUpdateContext";
436    fn interface_id() -> Option<crate::IntfID> {
437        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
438        unsafe { (crate::sys::api().daqComponentUpdateContext_getInterfaceId)(&mut id) };
439        Some(id)
440    }
441    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
442        Ref::from_owned(ptr).map(Self::__from_ref)
443    }
444    fn as_base_object(&self) -> &BaseObject { &self.0 }
445}
446impl ComponentUpdateContext {
447    #[doc(hidden)]
448    pub(crate) fn __from_ref(r: Ref) -> Self { ComponentUpdateContext(BaseObject(r)) }
449}
450impl std::fmt::Display for ComponentUpdateContext {
451    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
452        std::fmt::Display::fmt(self.as_base_object(), f)
453    }
454}
455impl From<&ComponentUpdateContext> for Value {
456    fn from(value: &ComponentUpdateContext) -> Value { Value::Object(value.to_base_object()) }
457}
458impl From<ComponentUpdateContext> for Value {
459    fn from(value: ComponentUpdateContext) -> Value { Value::Object(value.to_base_object()) }
460}
461impl crate::value::FromDaqOwned for ComponentUpdateContext {
462    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
463        crate::value::cast_owned(ptr, op)
464    }
465}
466
467/// The Context serves as a container for the Scheduler and Logger. It originates at the instance, and is passed to the root device, which forwards it to components such as function blocks and signals.
468/// Note: The context holds a strong reference to the Module Manager until  the reference is moved via the
469/// ContextInternal move function. The strong reference moved to an external owner to avoid memory leaks
470/// due to circular references. This is done automatically when the Context is used in the openDAQ Instance
471/// constructor.
472/// Wrapper over the openDAQ `daqContext` interface.
473#[repr(transparent)]
474#[derive(Clone, Debug)]
475pub struct Context(pub(crate) BaseObject);
476
477impl std::ops::Deref for Context {
478    type Target = BaseObject;
479    fn deref(&self) -> &BaseObject { &self.0 }
480}
481impl crate::sealed::Sealed for Context {}
482unsafe impl Interface for Context {
483    const NAME: &'static str = "daqContext";
484    fn interface_id() -> Option<crate::IntfID> {
485        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
486        unsafe { (crate::sys::api().daqContext_getInterfaceId)(&mut id) };
487        Some(id)
488    }
489    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
490        Ref::from_owned(ptr).map(Self::__from_ref)
491    }
492    fn as_base_object(&self) -> &BaseObject { &self.0 }
493}
494impl Context {
495    #[doc(hidden)]
496    pub(crate) fn __from_ref(r: Ref) -> Self { Context(BaseObject(r)) }
497}
498impl std::fmt::Display for Context {
499    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
500        std::fmt::Display::fmt(self.as_base_object(), f)
501    }
502}
503impl From<&Context> for Value {
504    fn from(value: &Context) -> Value { Value::Object(value.to_base_object()) }
505}
506impl From<Context> for Value {
507    fn from(value: Context) -> Value { Value::Object(value.to_base_object()) }
508}
509impl crate::value::FromDaqOwned for Context {
510    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
511        crate::value::cast_owned(ptr, op)
512    }
513}
514
515/// Wrapper over the openDAQ `daqDeserializeComponent` interface.
516#[repr(transparent)]
517#[derive(Clone, Debug)]
518pub struct DeserializeComponent(pub(crate) BaseObject);
519
520impl std::ops::Deref for DeserializeComponent {
521    type Target = BaseObject;
522    fn deref(&self) -> &BaseObject { &self.0 }
523}
524impl crate::sealed::Sealed for DeserializeComponent {}
525unsafe impl Interface for DeserializeComponent {
526    const NAME: &'static str = "daqDeserializeComponent";
527    fn interface_id() -> Option<crate::IntfID> {
528        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
529        unsafe { (crate::sys::api().daqDeserializeComponent_getInterfaceId)(&mut id) };
530        Some(id)
531    }
532    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
533        Ref::from_owned(ptr).map(Self::__from_ref)
534    }
535    fn as_base_object(&self) -> &BaseObject { &self.0 }
536}
537impl DeserializeComponent {
538    #[doc(hidden)]
539    pub(crate) fn __from_ref(r: Ref) -> Self { DeserializeComponent(BaseObject(r)) }
540}
541impl std::fmt::Display for DeserializeComponent {
542    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
543        std::fmt::Display::fmt(self.as_base_object(), f)
544    }
545}
546impl From<&DeserializeComponent> for Value {
547    fn from(value: &DeserializeComponent) -> Value { Value::Object(value.to_base_object()) }
548}
549impl From<DeserializeComponent> for Value {
550    fn from(value: DeserializeComponent) -> Value { Value::Object(value.to_base_object()) }
551}
552impl crate::value::FromDaqOwned for DeserializeComponent {
553    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
554        crate::value::cast_owned(ptr, op)
555    }
556}
557
558/// Allows for specifying how a device and its subdevices are to be updated when loading a configuration.
559/// The device options object can be created using a serialized openDAQ JSON setup. The options are structured
560/// hierarchically, so that options for subdevices are stored in the parent device options. The following metadata
561/// is read from the setup: local ID, manufacturer, serial number, and connection string.
562/// For each individual device in the setup, the update mode can be specified. The update mode defines how the device is updated when loading:
563/// - Load: Updates the device. Adds the device if missing.
564/// - UpdateOnly: The device is updated, but not added if missing.
565/// - Skip: The device is not updated. Does neither add nor remove the device.
566/// - Remove: Removes the device from the tree, if present.
567/// - Remap: Same as load, but removes old device (if present) and uses the new manufacturer, serial number, and connection string to add a new one and update.
568/// @subsection opendaq_device_options_remapping Remapping
569/// When the update mode is set to Remap, the device is removed and added again with the new manufacturer, serial number, and connection
570/// string. This can be used when swapping out a device with a different one of the same make/model. This option will try and load the same
571/// settings used to configure the original device to the new one.
572/// When loading, the new manufacturer + serial number combination will have priority over the new connection string. In case a device with
573/// the new manufacturer + serial number combination is not found, the new connection string will be used as fallback.
574/// If the remapping fails (e.g. due to missing device with the new manufacturer + serial number combination and invalid connection string),
575/// the original device will be removed (if present) and no new device will be added.
576/// Signal-\>Input port connections will be preserved when remapping, assuming the new device has the same signal and input port structure and IDs.
577/// Wrapper over the openDAQ `daqDeviceUpdateOptions` interface.
578#[repr(transparent)]
579#[derive(Clone, Debug)]
580pub struct DeviceUpdateOptions(pub(crate) BaseObject);
581
582impl std::ops::Deref for DeviceUpdateOptions {
583    type Target = BaseObject;
584    fn deref(&self) -> &BaseObject { &self.0 }
585}
586impl crate::sealed::Sealed for DeviceUpdateOptions {}
587unsafe impl Interface for DeviceUpdateOptions {
588    const NAME: &'static str = "daqDeviceUpdateOptions";
589    fn interface_id() -> Option<crate::IntfID> {
590        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
591        unsafe { (crate::sys::api().daqDeviceUpdateOptions_getInterfaceId)(&mut id) };
592        Some(id)
593    }
594    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
595        Ref::from_owned(ptr).map(Self::__from_ref)
596    }
597    fn as_base_object(&self) -> &BaseObject { &self.0 }
598}
599impl DeviceUpdateOptions {
600    #[doc(hidden)]
601    pub(crate) fn __from_ref(r: Ref) -> Self { DeviceUpdateOptions(BaseObject(r)) }
602}
603impl std::fmt::Display for DeviceUpdateOptions {
604    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
605        std::fmt::Display::fmt(self.as_base_object(), f)
606    }
607}
608impl From<&DeviceUpdateOptions> for Value {
609    fn from(value: &DeviceUpdateOptions) -> Value { Value::Object(value.to_base_object()) }
610}
611impl From<DeviceUpdateOptions> for Value {
612    fn from(value: DeviceUpdateOptions) -> Value { Value::Object(value.to_base_object()) }
613}
614impl crate::value::FromDaqOwned for DeviceUpdateOptions {
615    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
616        crate::value::cast_owned(ptr, op)
617    }
618}
619
620/// Acts as a container for other components
621/// Other components use the folder component to organize the children components,
622/// such as channels, signals, function blocks, etc.
623/// Wrapper over the openDAQ `daqFolder` interface.
624#[repr(transparent)]
625#[derive(Clone, Debug)]
626pub struct Folder(pub(crate) Component);
627
628impl std::ops::Deref for Folder {
629    type Target = Component;
630    fn deref(&self) -> &Component { &self.0 }
631}
632impl crate::sealed::Sealed for Folder {}
633unsafe impl Interface for Folder {
634    const NAME: &'static str = "daqFolder";
635    fn interface_id() -> Option<crate::IntfID> {
636        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
637        unsafe { (crate::sys::api().daqFolder_getInterfaceId)(&mut id) };
638        Some(id)
639    }
640    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
641        Ref::from_owned(ptr).map(Self::__from_ref)
642    }
643    fn as_base_object(&self) -> &BaseObject { &self.0 }
644}
645impl Folder {
646    #[doc(hidden)]
647    pub(crate) fn __from_ref(r: Ref) -> Self { Folder(Component::__from_ref(r)) }
648}
649impl std::fmt::Display for Folder {
650    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
651        std::fmt::Display::fmt(self.as_base_object(), f)
652    }
653}
654impl From<&Folder> for Value {
655    fn from(value: &Folder) -> Value { Value::Object(value.to_base_object()) }
656}
657impl From<Folder> for Value {
658    fn from(value: Folder) -> Value { Value::Object(value.to_base_object()) }
659}
660impl crate::value::FromDaqOwned for Folder {
661    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
662        crate::value::cast_owned(ptr, op)
663    }
664}
665
666/// Allows write access to folder.
667/// Provides methods to add and remove items to the folder.
668/// Wrapper over the openDAQ `daqFolderConfig` interface.
669#[repr(transparent)]
670#[derive(Clone, Debug)]
671pub struct FolderConfig(pub(crate) Folder);
672
673impl std::ops::Deref for FolderConfig {
674    type Target = Folder;
675    fn deref(&self) -> &Folder { &self.0 }
676}
677impl crate::sealed::Sealed for FolderConfig {}
678unsafe impl Interface for FolderConfig {
679    const NAME: &'static str = "daqFolderConfig";
680    fn interface_id() -> Option<crate::IntfID> {
681        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
682        unsafe { (crate::sys::api().daqFolderConfig_getInterfaceId)(&mut id) };
683        Some(id)
684    }
685    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
686        Ref::from_owned(ptr).map(Self::__from_ref)
687    }
688    fn as_base_object(&self) -> &BaseObject { &self.0 }
689}
690impl FolderConfig {
691    #[doc(hidden)]
692    pub(crate) fn __from_ref(r: Ref) -> Self { FolderConfig(Folder::__from_ref(r)) }
693}
694impl std::fmt::Display for FolderConfig {
695    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
696        std::fmt::Display::fmt(self.as_base_object(), f)
697    }
698}
699impl From<&FolderConfig> for Value {
700    fn from(value: &FolderConfig) -> Value { Value::Object(value.to_base_object()) }
701}
702impl From<FolderConfig> for Value {
703    fn from(value: FolderConfig) -> Value { Value::Object(value.to_base_object()) }
704}
705impl crate::value::FromDaqOwned for FolderConfig {
706    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
707        crate::value::cast_owned(ptr, op)
708    }
709}
710
711/// Give module information composing of: - version info (major, minor, patch) - name - id.
712/// Wrapper over the openDAQ `daqModuleInfo` interface.
713#[repr(transparent)]
714#[derive(Clone, Debug)]
715pub struct ModuleInfo(pub(crate) BaseObject);
716
717impl std::ops::Deref for ModuleInfo {
718    type Target = BaseObject;
719    fn deref(&self) -> &BaseObject { &self.0 }
720}
721impl crate::sealed::Sealed for ModuleInfo {}
722unsafe impl Interface for ModuleInfo {
723    const NAME: &'static str = "daqModuleInfo";
724    fn interface_id() -> Option<crate::IntfID> {
725        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
726        unsafe { (crate::sys::api().daqModuleInfo_getInterfaceId)(&mut id) };
727        Some(id)
728    }
729    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
730        Ref::from_owned(ptr).map(Self::__from_ref)
731    }
732    fn as_base_object(&self) -> &BaseObject { &self.0 }
733}
734impl ModuleInfo {
735    #[doc(hidden)]
736    pub(crate) fn __from_ref(r: Ref) -> Self { ModuleInfo(BaseObject(r)) }
737}
738impl std::fmt::Display for ModuleInfo {
739    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
740        std::fmt::Display::fmt(self.as_base_object(), f)
741    }
742}
743impl From<&ModuleInfo> for Value {
744    fn from(value: &ModuleInfo) -> Value { Value::Object(value.to_base_object()) }
745}
746impl From<ModuleInfo> for Value {
747    fn from(value: ModuleInfo) -> Value { Value::Object(value.to_base_object()) }
748}
749impl crate::value::FromDaqOwned for ModuleInfo {
750    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
751        crate::value::cast_owned(ptr, op)
752    }
753}
754
755/// Allows the component to be notified when it is removed.
756/// Wrapper over the openDAQ `daqRemovable` interface.
757#[repr(transparent)]
758#[derive(Clone, Debug)]
759pub struct Removable(pub(crate) BaseObject);
760
761impl std::ops::Deref for Removable {
762    type Target = BaseObject;
763    fn deref(&self) -> &BaseObject { &self.0 }
764}
765impl crate::sealed::Sealed for Removable {}
766unsafe impl Interface for Removable {
767    const NAME: &'static str = "daqRemovable";
768    fn interface_id() -> Option<crate::IntfID> {
769        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
770        unsafe { (crate::sys::api().daqRemovable_getInterfaceId)(&mut id) };
771        Some(id)
772    }
773    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
774        Ref::from_owned(ptr).map(Self::__from_ref)
775    }
776    fn as_base_object(&self) -> &BaseObject { &self.0 }
777}
778impl Removable {
779    #[doc(hidden)]
780    pub(crate) fn __from_ref(r: Ref) -> Self { Removable(BaseObject(r)) }
781}
782impl std::fmt::Display for Removable {
783    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
784        std::fmt::Display::fmt(self.as_base_object(), f)
785    }
786}
787impl From<&Removable> for Value {
788    fn from(value: &Removable) -> Value { Value::Object(value.to_base_object()) }
789}
790impl From<Removable> for Value {
791    fn from(value: Removable) -> Value { Value::Object(value.to_base_object()) }
792}
793impl crate::value::FromDaqOwned for Removable {
794    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
795        crate::value::cast_owned(ptr, op)
796    }
797}
798
799/// A signal with an unique ID that sends event/data packets through connections to input ports the signal is connected to.
800/// A signal features an unique ID within a given device. It sends data along its signal path to all
801/// connected input ports, if its set to be active via its active property.
802/// A signal is visible, and its data is streamed to all clients connected to a device only if its public
803/// property is set to `True`.
804/// Each signal has a domain descriptor, which is set by the owner of the signal - most often a function
805/// block or device. The descriptor defines all properties of the signal, such as its name, description
806/// and data structure.
807/// Signals can have a reference to another signal, which is used for determining the domain data. The domain
808/// signal outputs data at the same rate as the signal itself, providing domain (most often time - timestamps)
809/// information for each sample sent along the signal path. Each value packet sent by a signal thus contains
810/// a reference to another data packet containing domain data (if the signal is associated with another domain signal).
811/// Additionally, a list of related signals can be defined, containing any signals relevant to interpreting the
812/// signal data.
813/// To get the list of connections to input ports of the signal, `getConnections` can be used.
814/// Wrapper over the openDAQ `daqSignal` interface.
815#[repr(transparent)]
816#[derive(Clone, Debug)]
817pub struct Signal(pub(crate) Component);
818
819impl std::ops::Deref for Signal {
820    type Target = Component;
821    fn deref(&self) -> &Component { &self.0 }
822}
823impl crate::sealed::Sealed for Signal {}
824unsafe impl Interface for Signal {
825    const NAME: &'static str = "daqSignal";
826    fn interface_id() -> Option<crate::IntfID> {
827        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
828        unsafe { (crate::sys::api().daqSignal_getInterfaceId)(&mut id) };
829        Some(id)
830    }
831    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
832        Ref::from_owned(ptr).map(Self::__from_ref)
833    }
834    fn as_base_object(&self) -> &BaseObject { &self.0 }
835}
836impl Signal {
837    #[doc(hidden)]
838    pub(crate) fn __from_ref(r: Ref) -> Self { Signal(Component::__from_ref(r)) }
839}
840impl std::fmt::Display for Signal {
841    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
842        std::fmt::Display::fmt(self.as_base_object(), f)
843    }
844}
845impl From<&Signal> for Value {
846    fn from(value: &Signal) -> Value { Value::Object(value.to_base_object()) }
847}
848impl From<Signal> for Value {
849    fn from(value: Signal) -> Value { Value::Object(value.to_base_object()) }
850}
851impl crate::value::FromDaqOwned for Signal {
852    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
853        crate::value::cast_owned(ptr, op)
854    }
855}
856
857/// List of string tags. Provides helpers to get and search the list of tags.
858/// Tags provide a view into an underlying list of tags. The list can be retrieved via
859/// `getList`, and inspected through `contains` and `query`.
860/// To manipulate the list of tags, the add/remove tag functions can be used. The Tags
861/// object can only be modified if the object is not locked by the owning Component.
862/// Wrapper over the openDAQ `daqTags` interface.
863#[repr(transparent)]
864#[derive(Clone, Debug)]
865pub struct Tags(pub(crate) BaseObject);
866
867impl std::ops::Deref for Tags {
868    type Target = BaseObject;
869    fn deref(&self) -> &BaseObject { &self.0 }
870}
871impl crate::sealed::Sealed for Tags {}
872unsafe impl Interface for Tags {
873    const NAME: &'static str = "daqTags";
874    fn interface_id() -> Option<crate::IntfID> {
875        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
876        unsafe { (crate::sys::api().daqTags_getInterfaceId)(&mut id) };
877        Some(id)
878    }
879    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
880        Ref::from_owned(ptr).map(Self::__from_ref)
881    }
882    fn as_base_object(&self) -> &BaseObject { &self.0 }
883}
884impl Tags {
885    #[doc(hidden)]
886    pub(crate) fn __from_ref(r: Ref) -> Self { Tags(BaseObject(r)) }
887}
888impl std::fmt::Display for Tags {
889    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
890        std::fmt::Display::fmt(self.as_base_object(), f)
891    }
892}
893impl From<&Tags> for Value {
894    fn from(value: &Tags) -> Value { Value::Object(value.to_base_object()) }
895}
896impl From<Tags> for Value {
897    fn from(value: Tags) -> Value { Value::Object(value.to_base_object()) }
898}
899impl crate::value::FromDaqOwned for Tags {
900    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
901        crate::value::cast_owned(ptr, op)
902    }
903}
904
905/// Private interface to component tags. Allows for adding/removing tags.
906/// Modifying the tags of a component might have unintended sideffects and should in most cases only be done
907/// by the component owner module.
908/// Wrapper over the openDAQ `daqTagsPrivate` interface.
909#[repr(transparent)]
910#[derive(Clone, Debug)]
911pub struct TagsPrivate(pub(crate) BaseObject);
912
913impl std::ops::Deref for TagsPrivate {
914    type Target = BaseObject;
915    fn deref(&self) -> &BaseObject { &self.0 }
916}
917impl crate::sealed::Sealed for TagsPrivate {}
918unsafe impl Interface for TagsPrivate {
919    const NAME: &'static str = "daqTagsPrivate";
920    fn interface_id() -> Option<crate::IntfID> {
921        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
922        unsafe { (crate::sys::api().daqTagsPrivate_getInterfaceId)(&mut id) };
923        Some(id)
924    }
925    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
926        Ref::from_owned(ptr).map(Self::__from_ref)
927    }
928    fn as_base_object(&self) -> &BaseObject { &self.0 }
929}
930impl TagsPrivate {
931    #[doc(hidden)]
932    pub(crate) fn __from_ref(r: Ref) -> Self { TagsPrivate(BaseObject(r)) }
933}
934impl std::fmt::Display for TagsPrivate {
935    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
936        std::fmt::Display::fmt(self.as_base_object(), f)
937    }
938}
939impl From<&TagsPrivate> for Value {
940    fn from(value: &TagsPrivate) -> Value { Value::Object(value.to_base_object()) }
941}
942impl From<TagsPrivate> for Value {
943    fn from(value: TagsPrivate) -> Value { Value::Object(value.to_base_object()) }
944}
945impl crate::value::FromDaqOwned for TagsPrivate {
946    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
947        crate::value::cast_owned(ptr, op)
948    }
949}
950
951/// IUpdateParameters interface provides a set of methods to give user flexibility to load instance configuration.
952/// Wrapper over the openDAQ `daqUpdateParameters` interface.
953#[repr(transparent)]
954#[derive(Clone, Debug)]
955pub struct UpdateParameters(pub(crate) PropertyObject);
956
957impl std::ops::Deref for UpdateParameters {
958    type Target = PropertyObject;
959    fn deref(&self) -> &PropertyObject { &self.0 }
960}
961impl crate::sealed::Sealed for UpdateParameters {}
962unsafe impl Interface for UpdateParameters {
963    const NAME: &'static str = "daqUpdateParameters";
964    fn interface_id() -> Option<crate::IntfID> {
965        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
966        unsafe { (crate::sys::api().daqUpdateParameters_getInterfaceId)(&mut id) };
967        Some(id)
968    }
969    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
970        Ref::from_owned(ptr).map(Self::__from_ref)
971    }
972    fn as_base_object(&self) -> &BaseObject { &self.0 }
973}
974impl UpdateParameters {
975    #[doc(hidden)]
976    pub(crate) fn __from_ref(r: Ref) -> Self { UpdateParameters(PropertyObject::__from_ref(r)) }
977}
978impl std::fmt::Display for UpdateParameters {
979    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
980        std::fmt::Display::fmt(self.as_base_object(), f)
981    }
982}
983impl From<&UpdateParameters> for Value {
984    fn from(value: &UpdateParameters) -> Value { Value::Object(value.to_base_object()) }
985}
986impl From<UpdateParameters> for Value {
987    fn from(value: UpdateParameters) -> Value { Value::Object(value.to_base_object()) }
988}
989impl crate::value::FromDaqOwned for UpdateParameters {
990    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
991        crate::value::cast_owned(ptr, op)
992    }
993}
994
995impl ComponentDeserializeContext {
996    /// Calls the openDAQ C function `daqComponentDeserializeContext_clone()`.
997    pub fn clone_object(&self, new_parent: &Component, new_local_id: &str) -> Result<(Option<ComponentDeserializeContext>, crate::IntfID)> {
998        let __new_local_id = crate::marshal::make_string(new_local_id)?;
999        let mut __new_component_deserialize_context: *mut sys::daqComponentDeserializeContext = std::ptr::null_mut();
1000        let mut __new_intf_id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
1001        let __code = unsafe { (crate::sys::api().daqComponentDeserializeContext_clone)(self.as_raw() as *mut _, new_parent.as_raw() as *mut _, __new_local_id.as_ptr() as *mut _, &mut __new_component_deserialize_context, &mut __new_intf_id, std::ptr::null_mut()) };
1002        check(__code, "daqComponentDeserializeContext_clone")?;
1003        Ok((unsafe { crate::marshal::take_object::<ComponentDeserializeContext>(__new_component_deserialize_context as *mut _) }, __new_intf_id))
1004    }
1005
1006    /// Calls the openDAQ C function `daqComponentDeserializeContext_clone()`.
1007    pub fn clone_object_with(&self, new_parent: &Component, new_local_id: &str, new_trigger_core_event: Option<&Procedure>) -> Result<(Option<ComponentDeserializeContext>, crate::IntfID)> {
1008        let __new_local_id = crate::marshal::make_string(new_local_id)?;
1009        let mut __new_component_deserialize_context: *mut sys::daqComponentDeserializeContext = std::ptr::null_mut();
1010        let mut __new_intf_id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
1011        let __code = unsafe { (crate::sys::api().daqComponentDeserializeContext_clone)(self.as_raw() as *mut _, new_parent.as_raw() as *mut _, __new_local_id.as_ptr() as *mut _, &mut __new_component_deserialize_context, &mut __new_intf_id, new_trigger_core_event.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
1012        check(__code, "daqComponentDeserializeContext_clone")?;
1013        Ok((unsafe { crate::marshal::take_object::<ComponentDeserializeContext>(__new_component_deserialize_context as *mut _) }, __new_intf_id))
1014    }
1015
1016    /// Calls the openDAQ C function `daqComponentDeserializeContext_getContext()`.
1017    pub fn context(&self) -> Result<Option<Context>> {
1018        let mut __context: *mut sys::daqContext = std::ptr::null_mut();
1019        let __code = unsafe { (crate::sys::api().daqComponentDeserializeContext_getContext)(self.as_raw() as *mut _, &mut __context) };
1020        check(__code, "daqComponentDeserializeContext_getContext")?;
1021        Ok(unsafe { crate::marshal::take_object::<Context>(__context as *mut _) })
1022    }
1023
1024    /// Calls the openDAQ C function `daqComponentDeserializeContext_getIntfID()`.
1025    pub fn intf_id(&self) -> Result<crate::IntfID> {
1026        let mut __intf_id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
1027        let __code = unsafe { (crate::sys::api().daqComponentDeserializeContext_getIntfID)(self.as_raw() as *mut _, &mut __intf_id) };
1028        check(__code, "daqComponentDeserializeContext_getIntfID")?;
1029        Ok(__intf_id)
1030    }
1031
1032    /// Calls the openDAQ C function `daqComponentDeserializeContext_getLocalId()`.
1033    pub fn local_id(&self) -> Result<String> {
1034        let mut __local_id: *mut sys::daqString = std::ptr::null_mut();
1035        let __code = unsafe { (crate::sys::api().daqComponentDeserializeContext_getLocalId)(self.as_raw() as *mut _, &mut __local_id) };
1036        check(__code, "daqComponentDeserializeContext_getLocalId")?;
1037        Ok(unsafe { crate::marshal::take_string(__local_id) })
1038    }
1039
1040    /// Calls the openDAQ C function `daqComponentDeserializeContext_getParent()`.
1041    pub fn parent(&self) -> Result<Option<Component>> {
1042        let mut __parent: *mut sys::daqComponent = std::ptr::null_mut();
1043        let __code = unsafe { (crate::sys::api().daqComponentDeserializeContext_getParent)(self.as_raw() as *mut _, &mut __parent) };
1044        check(__code, "daqComponentDeserializeContext_getParent")?;
1045        Ok(unsafe { crate::marshal::take_object::<Component>(__parent as *mut _) })
1046    }
1047
1048    /// Calls the openDAQ C function `daqComponentDeserializeContext_getRoot()`.
1049    pub fn root(&self) -> Result<Option<Component>> {
1050        let mut __root: *mut sys::daqComponent = std::ptr::null_mut();
1051        let __code = unsafe { (crate::sys::api().daqComponentDeserializeContext_getRoot)(self.as_raw() as *mut _, &mut __root) };
1052        check(__code, "daqComponentDeserializeContext_getRoot")?;
1053        Ok(unsafe { crate::marshal::take_object::<Component>(__root as *mut _) })
1054    }
1055
1056    /// Calls the openDAQ C function `daqComponentDeserializeContext_getTriggerCoreEvent()`.
1057    pub fn trigger_core_event(&self) -> Result<Option<Procedure>> {
1058        let mut __trigger_core_event: *mut sys::daqProcedure = std::ptr::null_mut();
1059        let __code = unsafe { (crate::sys::api().daqComponentDeserializeContext_getTriggerCoreEvent)(self.as_raw() as *mut _, &mut __trigger_core_event) };
1060        check(__code, "daqComponentDeserializeContext_getTriggerCoreEvent")?;
1061        Ok(unsafe { crate::marshal::take_object::<Procedure>(__trigger_core_event as *mut _) })
1062    }
1063
1064}
1065
1066impl ComponentHolder {
1067    /// Calls the openDAQ C function `daqComponentHolder_createComponentHolder()`.
1068    pub fn new(component: &Component) -> Result<ComponentHolder> {
1069        let mut __obj: *mut sys::daqComponentHolder = std::ptr::null_mut();
1070        let __code = unsafe { (crate::sys::api().daqComponentHolder_createComponentHolder)(&mut __obj, component.as_raw() as *mut _) };
1071        check(__code, "daqComponentHolder_createComponentHolder")?;
1072        Ok(unsafe { crate::marshal::require_object::<ComponentHolder>(__obj as *mut _, "daqComponentHolder_createComponentHolder") }?)
1073    }
1074
1075    /// Calls the openDAQ C function `daqComponentHolder_createComponentHolderWithIds()`.
1076    pub fn with_ids(id: &str, parent_global_id: &str, component: &Component) -> Result<ComponentHolder> {
1077        let __id = crate::marshal::make_string(id)?;
1078        let __parent_global_id = crate::marshal::make_string(parent_global_id)?;
1079        let mut __obj: *mut sys::daqComponentHolder = std::ptr::null_mut();
1080        let __code = unsafe { (crate::sys::api().daqComponentHolder_createComponentHolderWithIds)(&mut __obj, __id.as_ptr() as *mut _, __parent_global_id.as_ptr() as *mut _, component.as_raw() as *mut _) };
1081        check(__code, "daqComponentHolder_createComponentHolderWithIds")?;
1082        Ok(unsafe { crate::marshal::require_object::<ComponentHolder>(__obj as *mut _, "daqComponentHolder_createComponentHolderWithIds") }?)
1083    }
1084
1085    /// Calls the openDAQ C function `daqComponentHolder_getComponent()`.
1086    pub fn component(&self) -> Result<Option<Component>> {
1087        let mut __component: *mut sys::daqComponent = std::ptr::null_mut();
1088        let __code = unsafe { (crate::sys::api().daqComponentHolder_getComponent)(self.as_raw() as *mut _, &mut __component) };
1089        check(__code, "daqComponentHolder_getComponent")?;
1090        Ok(unsafe { crate::marshal::take_object::<Component>(__component as *mut _) })
1091    }
1092
1093    /// Calls the openDAQ C function `daqComponentHolder_getLocalId()`.
1094    pub fn local_id(&self) -> Result<String> {
1095        let mut __local_id: *mut sys::daqString = std::ptr::null_mut();
1096        let __code = unsafe { (crate::sys::api().daqComponentHolder_getLocalId)(self.as_raw() as *mut _, &mut __local_id) };
1097        check(__code, "daqComponentHolder_getLocalId")?;
1098        Ok(unsafe { crate::marshal::take_string(__local_id) })
1099    }
1100
1101    /// Calls the openDAQ C function `daqComponentHolder_getParentGlobalId()`.
1102    pub fn parent_global_id(&self) -> Result<String> {
1103        let mut __parent_id: *mut sys::daqString = std::ptr::null_mut();
1104        let __code = unsafe { (crate::sys::api().daqComponentHolder_getParentGlobalId)(self.as_raw() as *mut _, &mut __parent_id) };
1105        check(__code, "daqComponentHolder_getParentGlobalId")?;
1106        Ok(unsafe { crate::marshal::take_string(__parent_id) })
1107    }
1108
1109}
1110
1111impl ComponentPrivate {
1112    /// Retrieves the configuration which was used to create the component.
1113    ///
1114    /// # Parameters
1115    /// - `config`: The configuration of the component.
1116    ///
1117    /// Calls the openDAQ C function `daqComponentPrivate_getComponentConfig()`.
1118    pub fn component_config(&self) -> Result<Option<PropertyObject>> {
1119        let mut __config: *mut sys::daqPropertyObject = std::ptr::null_mut();
1120        let __code = unsafe { (crate::sys::api().daqComponentPrivate_getComponentConfig)(self.as_raw() as *mut _, &mut __config) };
1121        check(__code, "daqComponentPrivate_getComponentConfig")?;
1122        Ok(unsafe { crate::marshal::take_object::<PropertyObject>(__config as *mut _) })
1123    }
1124
1125    /// Locks all attributes of the component.
1126    ///
1127    /// Calls the openDAQ C function `daqComponentPrivate_lockAllAttributes()`.
1128    pub fn lock_all_attributes(&self) -> Result<()> {
1129        let __code = unsafe { (crate::sys::api().daqComponentPrivate_lockAllAttributes)(self.as_raw() as *mut _) };
1130        check(__code, "daqComponentPrivate_lockAllAttributes")?;
1131        Ok(())
1132    }
1133
1134    /// Locks the attributes contained in the provided list.
1135    ///
1136    /// # Parameters
1137    /// - `attributes`: The list of attributes that should be locked. Is not case sensitive.
1138    ///
1139    /// Calls the openDAQ C function `daqComponentPrivate_lockAttributes()`.
1140    pub fn lock_attributes(&self, attributes: &[&str]) -> Result<()> {
1141        let __attributes = crate::marshal::list_from_strs(attributes)?;
1142        let __code = unsafe { (crate::sys::api().daqComponentPrivate_lockAttributes)(self.as_raw() as *mut _, __attributes.as_ptr() as *mut _) };
1143        check(__code, "daqComponentPrivate_lockAttributes")?;
1144        Ok(())
1145    }
1146
1147    /// Sets the configuration which was used to create the component.
1148    ///
1149    /// # Parameters
1150    /// - `config`: The configuration of the component.
1151    ///
1152    /// Calls the openDAQ C function `daqComponentPrivate_setComponentConfig()`.
1153    pub fn set_component_config(&self, config: &PropertyObject) -> Result<()> {
1154        let __code = unsafe { (crate::sys::api().daqComponentPrivate_setComponentConfig)(self.as_raw() as *mut _, config.as_raw() as *mut _) };
1155        check(__code, "daqComponentPrivate_setComponentConfig")?;
1156        Ok(())
1157    }
1158
1159    /// Called by parent component to notify this component about parent's active state change.
1160    ///
1161    /// # Parameters
1162    /// - `parent_active`: True if parent is active. The component updates its internal parentActive flag and recomputes its effective active state. If the effective active state changes, triggers an AttributeChanged event. Container components (folders, devices) propagate this call to their children.
1163    ///
1164    /// Calls the openDAQ C function `daqComponentPrivate_setParentActive()`.
1165    pub fn set_parent_active(&self, parent_active: bool) -> Result<()> {
1166        let __code = unsafe { (crate::sys::api().daqComponentPrivate_setParentActive)(self.as_raw() as *mut _, u8::from(parent_active)) };
1167        check(__code, "daqComponentPrivate_setParentActive")?;
1168        Ok(())
1169    }
1170
1171    /// Triggers the component-specific core event with the provided arguments.
1172    ///
1173    /// # Parameters
1174    /// - `args`: The arguments of the core event.
1175    ///
1176    /// Calls the openDAQ C function `daqComponentPrivate_triggerComponentCoreEvent()`.
1177    pub fn trigger_component_core_event(&self, args: &CoreEventArgs) -> Result<()> {
1178        let __code = unsafe { (crate::sys::api().daqComponentPrivate_triggerComponentCoreEvent)(self.as_raw() as *mut _, args.as_raw() as *mut _) };
1179        check(__code, "daqComponentPrivate_triggerComponentCoreEvent")?;
1180        Ok(())
1181    }
1182
1183    /// Unlocks all attributes of the component.
1184    ///
1185    /// Calls the openDAQ C function `daqComponentPrivate_unlockAllAttributes()`.
1186    pub fn unlock_all_attributes(&self) -> Result<()> {
1187        let __code = unsafe { (crate::sys::api().daqComponentPrivate_unlockAllAttributes)(self.as_raw() as *mut _) };
1188        check(__code, "daqComponentPrivate_unlockAllAttributes")?;
1189        Ok(())
1190    }
1191
1192    /// Unlocks the attributes contained in the provided list.
1193    ///
1194    /// # Parameters
1195    /// - `attributes`: The list of attributes that should be unlocked. Is not case sensitive.
1196    ///
1197    /// Calls the openDAQ C function `daqComponentPrivate_unlockAttributes()`.
1198    pub fn unlock_attributes(&self, attributes: &[&str]) -> Result<()> {
1199        let __attributes = crate::marshal::list_from_strs(attributes)?;
1200        let __code = unsafe { (crate::sys::api().daqComponentPrivate_unlockAttributes)(self.as_raw() as *mut _, __attributes.as_ptr() as *mut _) };
1201        check(__code, "daqComponentPrivate_unlockAttributes")?;
1202        Ok(())
1203    }
1204
1205    /// Notifies component about the change of the operation mode.
1206    ///
1207    /// # Parameters
1208    /// - `mode_type`: The new operation mode.
1209    ///
1210    /// Calls the openDAQ C function `daqComponentPrivate_updateOperationMode()`.
1211    pub fn update_operation_mode(&self, mode_type: OperationModeType) -> Result<()> {
1212        let __code = unsafe { (crate::sys::api().daqComponentPrivate_updateOperationMode)(self.as_raw() as *mut _, mode_type as u32) };
1213        check(__code, "daqComponentPrivate_updateOperationMode")?;
1214        Ok(())
1215    }
1216
1217}
1218
1219impl ComponentStatusContainerPrivate {
1220    /// Adds the new status with given name and initial value.
1221    ///
1222    /// # Parameters
1223    /// - `name`: The name of the component status.
1224    /// - `initial_value`: The initial value of the component status.
1225    ///
1226    /// Calls the openDAQ C function `daqComponentStatusContainerPrivate_addStatus()`.
1227    pub fn add_status(&self, name: &str, initial_value: &Enumeration) -> Result<()> {
1228        let __name = crate::marshal::make_string(name)?;
1229        let __code = unsafe { (crate::sys::api().daqComponentStatusContainerPrivate_addStatus)(self.as_raw() as *mut _, __name.as_ptr() as *mut _, initial_value.as_raw() as *mut _) };
1230        check(__code, "daqComponentStatusContainerPrivate_addStatus")?;
1231        Ok(())
1232    }
1233
1234    /// Adds the new status with given name, initial value, and message.
1235    ///
1236    /// # Parameters
1237    /// - `name`: The name of the component status.
1238    /// - `initial_value`: The initial value of the component status.
1239    /// - `message`: The message of the component status.
1240    ///
1241    /// Calls the openDAQ C function `daqComponentStatusContainerPrivate_addStatusWithMessage()`.
1242    pub fn add_status_with_message(&self, name: &str, initial_value: &Enumeration, message: &str) -> Result<()> {
1243        let __name = crate::marshal::make_string(name)?;
1244        let __message = crate::marshal::make_string(message)?;
1245        let __code = unsafe { (crate::sys::api().daqComponentStatusContainerPrivate_addStatusWithMessage)(self.as_raw() as *mut _, __name.as_ptr() as *mut _, initial_value.as_raw() as *mut _, __message.as_ptr() as *mut _) };
1246        check(__code, "daqComponentStatusContainerPrivate_addStatusWithMessage")?;
1247        Ok(())
1248    }
1249
1250    /// Sets the value for the existing component status.
1251    ///
1252    /// # Parameters
1253    /// - `name`: The name of the component status.
1254    /// - `value`: The new value of the component status.
1255    ///
1256    /// Calls the openDAQ C function `daqComponentStatusContainerPrivate_setStatus()`.
1257    pub fn set_status(&self, name: &str, value: &Enumeration) -> Result<()> {
1258        let __name = crate::marshal::make_string(name)?;
1259        let __code = unsafe { (crate::sys::api().daqComponentStatusContainerPrivate_setStatus)(self.as_raw() as *mut _, __name.as_ptr() as *mut _, value.as_raw() as *mut _) };
1260        check(__code, "daqComponentStatusContainerPrivate_setStatus")?;
1261        Ok(())
1262    }
1263
1264    /// Sets the value for the existing component status with a message.
1265    ///
1266    /// # Parameters
1267    /// - `name`: The name of the component status.
1268    /// - `value`: The new value of the component status.
1269    /// - `message`: The new message of the component status.
1270    ///
1271    /// Calls the openDAQ C function `daqComponentStatusContainerPrivate_setStatusWithMessage()`.
1272    pub fn set_status_with_message(&self, name: &str, value: &Enumeration, message: &str) -> Result<()> {
1273        let __name = crate::marshal::make_string(name)?;
1274        let __message = crate::marshal::make_string(message)?;
1275        let __code = unsafe { (crate::sys::api().daqComponentStatusContainerPrivate_setStatusWithMessage)(self.as_raw() as *mut _, __name.as_ptr() as *mut _, value.as_raw() as *mut _, __message.as_ptr() as *mut _) };
1276        check(__code, "daqComponentStatusContainerPrivate_setStatusWithMessage")?;
1277        Ok(())
1278    }
1279
1280}
1281
1282impl ComponentStatusContainer {
1283    /// Calls the openDAQ C function `daqComponentStatusContainer_createComponentStatusContainer()`.
1284    pub fn new() -> Result<ComponentStatusContainer> {
1285        let mut __obj: *mut sys::daqComponentStatusContainer = std::ptr::null_mut();
1286        let __code = unsafe { (crate::sys::api().daqComponentStatusContainer_createComponentStatusContainer)(&mut __obj) };
1287        check(__code, "daqComponentStatusContainer_createComponentStatusContainer")?;
1288        Ok(unsafe { crate::marshal::require_object::<ComponentStatusContainer>(__obj as *mut _, "daqComponentStatusContainer_createComponentStatusContainer") }?)
1289    }
1290
1291    /// Gets the current value of Component status with a given name.
1292    ///
1293    /// # Parameters
1294    /// - `name`: The name of Component status.
1295    ///
1296    /// # Returns
1297    /// - `value`: The current value of Component status.
1298    ///
1299    /// Calls the openDAQ C function `daqComponentStatusContainer_getStatus()`.
1300    pub fn status(&self, name: &str) -> Result<Option<Enumeration>> {
1301        let __name = crate::marshal::make_string(name)?;
1302        let mut __value: *mut sys::daqEnumeration = std::ptr::null_mut();
1303        let __code = unsafe { (crate::sys::api().daqComponentStatusContainer_getStatus)(self.as_raw() as *mut _, __name.as_ptr() as *mut _, &mut __value) };
1304        check(__code, "daqComponentStatusContainer_getStatus")?;
1305        Ok(unsafe { crate::marshal::take_object::<Enumeration>(__value as *mut _) })
1306    }
1307
1308    /// Gets the status message of Component status with a given name.
1309    ///
1310    /// # Parameters
1311    /// - `name`: The name of Component status.
1312    ///
1313    /// # Returns
1314    /// - `message`: The current message of Component status.
1315    ///
1316    /// Calls the openDAQ C function `daqComponentStatusContainer_getStatusMessage()`.
1317    pub fn status_message(&self, name: &str) -> Result<String> {
1318        let __name = crate::marshal::make_string(name)?;
1319        let mut __message: *mut sys::daqString = std::ptr::null_mut();
1320        let __code = unsafe { (crate::sys::api().daqComponentStatusContainer_getStatusMessage)(self.as_raw() as *mut _, __name.as_ptr() as *mut _, &mut __message) };
1321        check(__code, "daqComponentStatusContainer_getStatusMessage")?;
1322        Ok(unsafe { crate::marshal::take_string(__message) })
1323    }
1324
1325    /// Gets the current values of all Component statuses.
1326    ///
1327    /// # Returns
1328    /// - `statuses`: The Component statuses as a dictionary. All objects in the statuses dictionary are key value pairs of \<IString, IEnumeration\>.
1329    ///
1330    /// Calls the openDAQ C function `daqComponentStatusContainer_getStatuses()`.
1331    pub fn statuses(&self) -> Result<std::collections::HashMap<String, Enumeration>> {
1332        let mut __statuses: *mut sys::daqDict = std::ptr::null_mut();
1333        let __code = unsafe { (crate::sys::api().daqComponentStatusContainer_getStatuses)(self.as_raw() as *mut _, &mut __statuses) };
1334        check(__code, "daqComponentStatusContainer_getStatuses")?;
1335        Ok(unsafe { crate::marshal::take_dict::<String, Enumeration>(__statuses as *mut _, "daqComponentStatusContainer_getStatuses") }?)
1336    }
1337
1338}
1339
1340impl ComponentTypeBuilder {
1341    /// Builds and returns a Component type object using the currently set values of the Builder.
1342    ///
1343    /// # Returns
1344    /// - `component_type`: The built Component type. Depending on the set "sort" builder parameter, a different Component type is created - eg. Streaming type, Device type, Function block type, or Server type
1345    ///
1346    /// Calls the openDAQ C function `daqComponentTypeBuilder_build()`.
1347    pub fn build(&self) -> Result<Option<ComponentType>> {
1348        let mut __component_type: *mut sys::daqComponentType = std::ptr::null_mut();
1349        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_build)(self.as_raw() as *mut _, &mut __component_type) };
1350        check(__code, "daqComponentTypeBuilder_build")?;
1351        Ok(unsafe { crate::marshal::take_object::<ComponentType>(__component_type as *mut _) })
1352    }
1353
1354    /// Creates a ComponentTypeBuilder with default parameters.
1355    ///
1356    /// Calls the openDAQ C function `daqComponentTypeBuilder_createComponentTypeBuilder()`.
1357    pub fn new() -> Result<ComponentTypeBuilder> {
1358        let mut __obj: *mut sys::daqComponentTypeBuilder = std::ptr::null_mut();
1359        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_createComponentTypeBuilder)(&mut __obj) };
1360        check(__code, "daqComponentTypeBuilder_createComponentTypeBuilder")?;
1361        Ok(unsafe { crate::marshal::require_object::<ComponentTypeBuilder>(__obj as *mut _, "daqComponentTypeBuilder_createComponentTypeBuilder") }?)
1362    }
1363
1364    /// Creates a ComponentTypeBuilder with the type sort set to "Device".
1365    ///
1366    /// Calls the openDAQ C function `daqComponentTypeBuilder_createDeviceTypeBuilder()`.
1367    pub fn device() -> Result<ComponentTypeBuilder> {
1368        let mut __obj: *mut sys::daqComponentTypeBuilder = std::ptr::null_mut();
1369        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_createDeviceTypeBuilder)(&mut __obj) };
1370        check(__code, "daqComponentTypeBuilder_createDeviceTypeBuilder")?;
1371        Ok(unsafe { crate::marshal::require_object::<ComponentTypeBuilder>(__obj as *mut _, "daqComponentTypeBuilder_createDeviceTypeBuilder") }?)
1372    }
1373
1374    /// Creates a ComponentTypeBuilder with the type sort set to "FunctionBlock".
1375    ///
1376    /// Calls the openDAQ C function `daqComponentTypeBuilder_createFunctionBlockTypeBuilder()`.
1377    pub fn function_block() -> Result<ComponentTypeBuilder> {
1378        let mut __obj: *mut sys::daqComponentTypeBuilder = std::ptr::null_mut();
1379        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_createFunctionBlockTypeBuilder)(&mut __obj) };
1380        check(__code, "daqComponentTypeBuilder_createFunctionBlockTypeBuilder")?;
1381        Ok(unsafe { crate::marshal::require_object::<ComponentTypeBuilder>(__obj as *mut _, "daqComponentTypeBuilder_createFunctionBlockTypeBuilder") }?)
1382    }
1383
1384    /// Creates a ComponentTypeBuilder with the type sort set to "Server".
1385    ///
1386    /// Calls the openDAQ C function `daqComponentTypeBuilder_createServerTypeBuilder()`.
1387    pub fn server() -> Result<ComponentTypeBuilder> {
1388        let mut __obj: *mut sys::daqComponentTypeBuilder = std::ptr::null_mut();
1389        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_createServerTypeBuilder)(&mut __obj) };
1390        check(__code, "daqComponentTypeBuilder_createServerTypeBuilder")?;
1391        Ok(unsafe { crate::marshal::require_object::<ComponentTypeBuilder>(__obj as *mut _, "daqComponentTypeBuilder_createServerTypeBuilder") }?)
1392    }
1393
1394    /// Creates a ComponentTypeBuilder with the type sort set to "Streaming".
1395    ///
1396    /// Calls the openDAQ C function `daqComponentTypeBuilder_createStreamingTypeBuilder()`.
1397    pub fn streaming() -> Result<ComponentTypeBuilder> {
1398        let mut __obj: *mut sys::daqComponentTypeBuilder = std::ptr::null_mut();
1399        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_createStreamingTypeBuilder)(&mut __obj) };
1400        check(__code, "daqComponentTypeBuilder_createStreamingTypeBuilder")?;
1401        Ok(unsafe { crate::marshal::require_object::<ComponentTypeBuilder>(__obj as *mut _, "daqComponentTypeBuilder_createStreamingTypeBuilder") }?)
1402    }
1403
1404    /// Calls the openDAQ C function `daqComponentTypeBuilder_getConnectionStringPrefix()`.
1405    pub fn connection_string_prefix(&self) -> Result<String> {
1406        let mut __prefix: *mut sys::daqString = std::ptr::null_mut();
1407        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_getConnectionStringPrefix)(self.as_raw() as *mut _, &mut __prefix) };
1408        check(__code, "daqComponentTypeBuilder_getConnectionStringPrefix")?;
1409        Ok(unsafe { crate::marshal::take_string(__prefix) })
1410    }
1411
1412    /// Gets the default configuration object that will be cloned and passed to users by the built Component type when requested.
1413    ///
1414    /// # Returns
1415    /// - `default_config`: The default configuration object. Configuration objects are property object with user-defined key-value pairs. For example: Port=1000, OutputRate=5000, ...
1416    ///
1417    /// Calls the openDAQ C function `daqComponentTypeBuilder_getDefaultConfig()`.
1418    pub fn default_config(&self) -> Result<Option<PropertyObject>> {
1419        let mut __default_config: *mut sys::daqPropertyObject = std::ptr::null_mut();
1420        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_getDefaultConfig)(self.as_raw() as *mut _, &mut __default_config) };
1421        check(__code, "daqComponentTypeBuilder_getDefaultConfig")?;
1422        Ok(unsafe { crate::marshal::take_object::<PropertyObject>(__default_config as *mut _) })
1423    }
1424
1425    /// Gets the description of a component type.
1426    ///
1427    /// # Returns
1428    /// - `description`: The description of a component type. A short description of a component type and the associated configuration parameters it offers.
1429    ///
1430    /// Calls the openDAQ C function `daqComponentTypeBuilder_getDescription()`.
1431    pub fn description(&self) -> Result<String> {
1432        let mut __description: *mut sys::daqString = std::ptr::null_mut();
1433        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_getDescription)(self.as_raw() as *mut _, &mut __description) };
1434        check(__code, "daqComponentTypeBuilder_getDescription")?;
1435        Ok(unsafe { crate::marshal::take_string(__description) })
1436    }
1437
1438    /// Gets the unique component type id.
1439    ///
1440    /// # Returns
1441    /// - `id`: The unique id of a component type. Unique id should not be presented on the UI.
1442    ///
1443    /// Calls the openDAQ C function `daqComponentTypeBuilder_getId()`.
1444    pub fn id(&self) -> Result<String> {
1445        let mut __id: *mut sys::daqString = std::ptr::null_mut();
1446        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_getId)(self.as_raw() as *mut _, &mut __id) };
1447        check(__code, "daqComponentTypeBuilder_getId")?;
1448        Ok(unsafe { crate::marshal::take_string(__id) })
1449    }
1450
1451    /// Gets the user-friendly name of a component type.
1452    ///
1453    /// # Returns
1454    /// - `name`: The user-friendly name of a component type. Name is usually presented on the UI. Does not have to be unique.
1455    ///
1456    /// Calls the openDAQ C function `daqComponentTypeBuilder_getName()`.
1457    pub fn name(&self) -> Result<String> {
1458        let mut __name: *mut sys::daqString = std::ptr::null_mut();
1459        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_getName)(self.as_raw() as *mut _, &mut __name) };
1460        check(__code, "daqComponentTypeBuilder_getName")?;
1461        Ok(unsafe { crate::marshal::take_string(__name) })
1462    }
1463
1464    /// Gets the component type sort. Can be either Streaming, Function block, Device, or Server. Depending on the setting, the corresponding Component type object will be built.
1465    ///
1466    /// # Parameters
1467    /// - `sort`: The sort of the component type.
1468    ///
1469    /// Calls the openDAQ C function `daqComponentTypeBuilder_getTypeSort()`.
1470    pub fn type_sort(&self) -> Result<ComponentTypeSort> {
1471        let mut __sort: u32 = 0;
1472        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_getTypeSort)(self.as_raw() as *mut _, &mut __sort) };
1473        check(__code, "daqComponentTypeBuilder_getTypeSort")?;
1474        Ok(crate::marshal::enum_out(ComponentTypeSort::from_raw(__sort), "daqComponentTypeBuilder_getTypeSort")?)
1475    }
1476
1477    /// Calls the openDAQ C function `daqComponentTypeBuilder_setConnectionStringPrefix()`.
1478    pub fn set_connection_string_prefix(&self, prefix: &str) -> Result<()> {
1479        let __prefix = crate::marshal::make_string(prefix)?;
1480        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_setConnectionStringPrefix)(self.as_raw() as *mut _, __prefix.as_ptr() as *mut _) };
1481        check(__code, "daqComponentTypeBuilder_setConnectionStringPrefix")?;
1482        Ok(())
1483    }
1484
1485    /// Sets the default configuration object that will be cloned and passed to users by the built Component type when requested.
1486    ///
1487    /// # Parameters
1488    /// - `default_config`: The default configuration object. Configuration objects are property object with user-defined key-value pairs. For example: Port=1000, OutputRate=5000, ...
1489    ///
1490    /// Calls the openDAQ C function `daqComponentTypeBuilder_setDefaultConfig()`.
1491    pub fn set_default_config(&self, default_config: &PropertyObject) -> Result<()> {
1492        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_setDefaultConfig)(self.as_raw() as *mut _, default_config.as_raw() as *mut _) };
1493        check(__code, "daqComponentTypeBuilder_setDefaultConfig")?;
1494        Ok(())
1495    }
1496
1497    /// Sets the description of a component type.
1498    ///
1499    /// # Parameters
1500    /// - `description`: The description of a component type. A short description of a component type and the associated configuration parameters it offers.
1501    ///
1502    /// Calls the openDAQ C function `daqComponentTypeBuilder_setDescription()`.
1503    pub fn set_description(&self, description: &str) -> Result<()> {
1504        let __description = crate::marshal::make_string(description)?;
1505        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_setDescription)(self.as_raw() as *mut _, __description.as_ptr() as *mut _) };
1506        check(__code, "daqComponentTypeBuilder_setDescription")?;
1507        Ok(())
1508    }
1509
1510    /// Sets the unique component type id.
1511    ///
1512    /// # Parameters
1513    /// - `id`: The unique id of a component type. Unique id should not be presented on the UI.
1514    ///
1515    /// Calls the openDAQ C function `daqComponentTypeBuilder_setId()`.
1516    pub fn set_id(&self, id: &str) -> Result<()> {
1517        let __id = crate::marshal::make_string(id)?;
1518        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_setId)(self.as_raw() as *mut _, __id.as_ptr() as *mut _) };
1519        check(__code, "daqComponentTypeBuilder_setId")?;
1520        Ok(())
1521    }
1522
1523    /// Sets the user-friendly name of a component type.
1524    ///
1525    /// # Parameters
1526    /// - `name`: The user-friendly name of a component type. Name is usually presented on the UI. Does not have to be unique.
1527    ///
1528    /// Calls the openDAQ C function `daqComponentTypeBuilder_setName()`.
1529    pub fn set_name(&self, name: &str) -> Result<()> {
1530        let __name = crate::marshal::make_string(name)?;
1531        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_setName)(self.as_raw() as *mut _, __name.as_ptr() as *mut _) };
1532        check(__code, "daqComponentTypeBuilder_setName")?;
1533        Ok(())
1534    }
1535
1536    /// Sets the component type sort. Can be either Streaming, Function block, Device, or Server. Depending on the setting, the corresponding Component type object will be built.
1537    ///
1538    /// # Parameters
1539    /// - `sort`: The sort of the component type.
1540    ///
1541    /// Calls the openDAQ C function `daqComponentTypeBuilder_setTypeSort()`.
1542    pub fn set_type_sort(&self, sort: ComponentTypeSort) -> Result<()> {
1543        let __code = unsafe { (crate::sys::api().daqComponentTypeBuilder_setTypeSort)(self.as_raw() as *mut _, sort as u32) };
1544        check(__code, "daqComponentTypeBuilder_setTypeSort")?;
1545        Ok(())
1546    }
1547
1548}
1549
1550impl ComponentTypePrivate {
1551    /// Sets the module information.
1552    ///
1553    /// # Parameters
1554    /// - `info`: The module information.
1555    ///
1556    /// Calls the openDAQ C function `daqComponentTypePrivate_setModuleInfo()`.
1557    pub fn set_module_info(&self, info: &ModuleInfo) -> Result<()> {
1558        let __code = unsafe { (crate::sys::api().daqComponentTypePrivate_setModuleInfo)(self.as_raw() as *mut _, info.as_raw() as *mut _) };
1559        check(__code, "daqComponentTypePrivate_setModuleInfo")?;
1560        Ok(())
1561    }
1562
1563}
1564
1565impl ComponentType {
1566    /// The function clones and returns default configuration. On each call, we need to create new object, because we want that each instance of the component has its own configuration object.
1567    ///
1568    /// # Returns
1569    /// - `default_config`: Newly created configuration object. Configuration objects are property object with user-defined key-value pairs. For example: Port=1000, OutputRate=5000, ...
1570    ///
1571    /// Calls the openDAQ C function `daqComponentType_createDefaultConfig()`.
1572    pub fn create_default_config(&self) -> Result<Option<PropertyObject>> {
1573        let mut __default_config: *mut sys::daqPropertyObject = std::ptr::null_mut();
1574        let __code = unsafe { (crate::sys::api().daqComponentType_createDefaultConfig)(self.as_raw() as *mut _, &mut __default_config) };
1575        check(__code, "daqComponentType_createDefaultConfig")?;
1576        Ok(unsafe { crate::marshal::take_object::<PropertyObject>(__default_config as *mut _) })
1577    }
1578
1579    /// Gets the description of a component type.
1580    ///
1581    /// # Returns
1582    /// - `description`: The description of a component type. A short description of a component type and the associated configuration parameters it offers.
1583    ///
1584    /// Calls the openDAQ C function `daqComponentType_getDescription()`.
1585    pub fn description(&self) -> Result<String> {
1586        let mut __description: *mut sys::daqString = std::ptr::null_mut();
1587        let __code = unsafe { (crate::sys::api().daqComponentType_getDescription)(self.as_raw() as *mut _, &mut __description) };
1588        check(__code, "daqComponentType_getDescription")?;
1589        Ok(unsafe { crate::marshal::take_string(__description) })
1590    }
1591
1592    /// Gets the unique component type id.
1593    ///
1594    /// # Returns
1595    /// - `id`: The unique id of a component type. Unique id should not be presented on the UI.
1596    ///
1597    /// Calls the openDAQ C function `daqComponentType_getId()`.
1598    pub fn id(&self) -> Result<String> {
1599        let mut __id: *mut sys::daqString = std::ptr::null_mut();
1600        let __code = unsafe { (crate::sys::api().daqComponentType_getId)(self.as_raw() as *mut _, &mut __id) };
1601        check(__code, "daqComponentType_getId")?;
1602        Ok(unsafe { crate::marshal::take_string(__id) })
1603    }
1604
1605    /// Retrieves the module information.
1606    ///
1607    /// # Returns
1608    /// - `info`: The module information.
1609    ///
1610    /// Calls the openDAQ C function `daqComponentType_getModuleInfo()`.
1611    pub fn module_info(&self) -> Result<Option<ModuleInfo>> {
1612        let mut __info: *mut sys::daqModuleInfo = std::ptr::null_mut();
1613        let __code = unsafe { (crate::sys::api().daqComponentType_getModuleInfo)(self.as_raw() as *mut _, &mut __info) };
1614        check(__code, "daqComponentType_getModuleInfo")?;
1615        Ok(unsafe { crate::marshal::take_object::<ModuleInfo>(__info as *mut _) })
1616    }
1617
1618    /// Gets the user-friendly name of a component type.
1619    ///
1620    /// # Returns
1621    /// - `name`: The user-friendly name of a component type. Name is usually presented on the UI. Does not have to be unique.
1622    ///
1623    /// Calls the openDAQ C function `daqComponentType_getName()`.
1624    pub fn name(&self) -> Result<String> {
1625        let mut __name: *mut sys::daqString = std::ptr::null_mut();
1626        let __code = unsafe { (crate::sys::api().daqComponentType_getName)(self.as_raw() as *mut _, &mut __name) };
1627        check(__code, "daqComponentType_getName")?;
1628        Ok(unsafe { crate::marshal::take_string(__name) })
1629    }
1630
1631}
1632
1633impl ComponentUpdateContext {
1634    /// Adds a device remapping from the original device's local ID to the new device local ID.
1635    ///
1636    /// # Parameters
1637    /// - `original_device_id`: The local ID of the original device to be remapped.
1638    /// - `new_device_id`: The local ID of the new device to be used for remapping. Used to remap signal -\> input port connections to the remapped device when loading.
1639    ///
1640    /// Calls the openDAQ C function `daqComponentUpdateContext_addDeviceRemapping()`.
1641    pub fn add_device_remapping(&self, original_device_id: &str, new_device_id: &str) -> Result<()> {
1642        let __original_device_id = crate::marshal::make_string(original_device_id)?;
1643        let __new_device_id = crate::marshal::make_string(new_device_id)?;
1644        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_addDeviceRemapping)(self.as_raw() as *mut _, __original_device_id.as_ptr() as *mut _, __new_device_id.as_ptr() as *mut _) };
1645        check(__code, "daqComponentUpdateContext_addDeviceRemapping")?;
1646        Ok(())
1647    }
1648
1649    /// Gets the DeviceUpdateOptions object for the device with the specified local ID. Returns null if no options are found for the device.
1650    ///
1651    /// # Parameters
1652    /// - `local_id`: The local ID of the device to get the options for.
1653    /// - `options`: The DeviceUpdateOptions object for the device with the specified local ID; null if no options are found for the device.
1654    ///
1655    /// Calls the openDAQ C function `daqComponentUpdateContext_getDeviceUpdateOptionsWithLocalIdOrNull()`.
1656    pub fn device_update_options_with_local_id_or_null(&self, local_id: &str) -> Result<Option<DeviceUpdateOptions>> {
1657        let __local_id = crate::marshal::make_string(local_id)?;
1658        let mut __options: *mut sys::daqDeviceUpdateOptions = std::ptr::null_mut();
1659        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_getDeviceUpdateOptionsWithLocalIdOrNull)(self.as_raw() as *mut _, __local_id.as_ptr() as *mut _, &mut __options) };
1660        check(__code, "daqComponentUpdateContext_getDeviceUpdateOptionsWithLocalIdOrNull")?;
1661        Ok(unsafe { crate::marshal::take_object::<DeviceUpdateOptions>(__options as *mut _) })
1662    }
1663
1664    /// Gets the dictionary with key-value pairs of input port local IDs and signal IDs for the specified parent component.
1665    ///
1666    /// # Parameters
1667    /// - `parent_id`: The ID of the parent component.
1668    ///
1669    /// # Returns
1670    /// - `connections`: The connections to the input ports.
1671    ///
1672    /// Calls the openDAQ C function `daqComponentUpdateContext_getInputPortConnections()`.
1673    pub fn input_port_connections(&self, parent_id: &str) -> Result<std::collections::HashMap<String, String>> {
1674        let __parent_id = crate::marshal::make_string(parent_id)?;
1675        let mut __connections: *mut sys::daqDict = std::ptr::null_mut();
1676        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_getInputPortConnections)(self.as_raw() as *mut _, __parent_id.as_ptr() as *mut _, &mut __connections) };
1677        check(__code, "daqComponentUpdateContext_getInputPortConnections")?;
1678        Ok(unsafe { crate::marshal::take_dict::<String, String>(__connections as *mut _, "daqComponentUpdateContext_getInputPortConnections") }?)
1679    }
1680
1681    /// Calls the openDAQ C function `daqComponentUpdateContext_getInternalState()`.
1682    pub fn internal_state(&self) -> Result<std::collections::HashMap<String, Value>> {
1683        let mut __state: *mut sys::daqDict = std::ptr::null_mut();
1684        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_getInternalState)(self.as_raw() as *mut _, &mut __state) };
1685        check(__code, "daqComponentUpdateContext_getInternalState")?;
1686        Ok(unsafe { crate::marshal::take_dict::<String, Value>(__state as *mut _, "daqComponentUpdateContext_getInternalState") }?)
1687    }
1688
1689    /// Gets the root component of the current component.
1690    ///
1691    /// # Returns
1692    /// - `root_component`: The root component.
1693    ///
1694    /// Calls the openDAQ C function `daqComponentUpdateContext_getRootComponent()`.
1695    pub fn root_component(&self) -> Result<Option<Component>> {
1696        let mut __root_component: *mut sys::daqComponent = std::ptr::null_mut();
1697        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_getRootComponent)(self.as_raw() as *mut _, &mut __root_component) };
1698        check(__code, "daqComponentUpdateContext_getRootComponent")?;
1699        Ok(unsafe { crate::marshal::take_object::<Component>(__root_component as *mut _) })
1700    }
1701
1702    /// Gets the signal by the specified parent and port ID.
1703    ///
1704    /// # Parameters
1705    /// - `parent_id`: The ID of the parent component.
1706    /// - `port_id`: The ID of the input port.
1707    ///
1708    /// # Returns
1709    /// - `signal`: The found signal. If signal is not found signal is set to nullptr.
1710    ///
1711    /// Calls the openDAQ C function `daqComponentUpdateContext_getSignal()`.
1712    pub fn signal(&self, parent_id: &str, port_id: &str) -> Result<Option<Signal>> {
1713        let __parent_id = crate::marshal::make_string(parent_id)?;
1714        let __port_id = crate::marshal::make_string(port_id)?;
1715        let mut __signal: *mut sys::daqSignal = std::ptr::null_mut();
1716        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_getSignal)(self.as_raw() as *mut _, __parent_id.as_ptr() as *mut _, __port_id.as_ptr() as *mut _, &mut __signal) };
1717        check(__code, "daqComponentUpdateContext_getSignal")?;
1718        Ok(unsafe { crate::marshal::take_object::<Signal>(__signal as *mut _) })
1719    }
1720
1721    /// Gets the update parameters provided by the user through the `update` call.
1722    ///
1723    /// # Parameters
1724    /// - `update_parameters`: The update parameters.
1725    ///
1726    /// Calls the openDAQ C function `daqComponentUpdateContext_getUpdateParameters()`.
1727    pub fn update_parameters(&self) -> Result<Option<UpdateParameters>> {
1728        let mut __update_parameters: *mut sys::daqUpdateParameters = std::ptr::null_mut();
1729        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_getUpdateParameters)(self.as_raw() as *mut _, &mut __update_parameters) };
1730        check(__code, "daqComponentUpdateContext_getUpdateParameters")?;
1731        Ok(unsafe { crate::marshal::take_object::<UpdateParameters>(__update_parameters as *mut _) })
1732    }
1733
1734    /// Overrides the internal context state with that of another.
1735    ///
1736    /// # Parameters
1737    /// - `update_context`: The context with which the object is to be overridden.
1738    ///
1739    /// Calls the openDAQ C function `daqComponentUpdateContext_overrideState()`.
1740    pub fn override_state(&self, update_context: &ComponentUpdateContext) -> Result<()> {
1741        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_overrideState)(self.as_raw() as *mut _, update_context.as_raw() as *mut _) };
1742        check(__code, "daqComponentUpdateContext_overrideState")?;
1743        Ok(())
1744    }
1745
1746    /// Internal method that uses the device mapping to remap the input port connections.
1747    /// Should be called after the initial update, but before `onUpdatableUpdateEnd`.
1748    ///
1749    /// Calls the openDAQ C function `daqComponentUpdateContext_remapInputPortConnections()`.
1750    pub fn remap_input_port_connections(&self) -> Result<()> {
1751        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_remapInputPortConnections)(self.as_raw() as *mut _) };
1752        check(__code, "daqComponentUpdateContext_remapInputPortConnections")?;
1753        Ok(())
1754    }
1755
1756    /// Removes the connection to the input port for the specified parent component.
1757    ///
1758    /// # Parameters
1759    /// - `parent_id`: The ID of the parent component.
1760    ///
1761    /// Calls the openDAQ C function `daqComponentUpdateContext_removeInputPortConnection()`.
1762    pub fn remove_input_port_connection(&self, parent_id: &str) -> Result<()> {
1763        let __parent_id = crate::marshal::make_string(parent_id)?;
1764        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_removeInputPortConnection)(self.as_raw() as *mut _, __parent_id.as_ptr() as *mut _) };
1765        check(__code, "daqComponentUpdateContext_removeInputPortConnection")?;
1766        Ok(())
1767    }
1768
1769    /// Sets signal connection to the input port for the specified parent component which is usualy a function block.
1770    ///
1771    /// # Parameters
1772    /// - `parent_id`: The ID of the parent component.
1773    /// - `port_id`: The ID of the input port.
1774    /// - `signal_id`: The ID of the signal.
1775    ///
1776    /// Calls the openDAQ C function `daqComponentUpdateContext_setInputPortConnection()`.
1777    pub fn set_input_port_connection(&self, parent_id: &str, port_id: &str, signal_id: &str) -> Result<()> {
1778        let __parent_id = crate::marshal::make_string(parent_id)?;
1779        let __port_id = crate::marshal::make_string(port_id)?;
1780        let __signal_id = crate::marshal::make_string(signal_id)?;
1781        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_setInputPortConnection)(self.as_raw() as *mut _, __parent_id.as_ptr() as *mut _, __port_id.as_ptr() as *mut _, __signal_id.as_ptr() as *mut _) };
1782        check(__code, "daqComponentUpdateContext_setInputPortConnection")?;
1783        Ok(())
1784    }
1785
1786    /// Sets the root component of the current component. Iterates through the parent components until the root is found and sets it as the root component for the context.
1787    ///
1788    /// # Parameters
1789    /// - `base_component`: The base component from which we iterate to the openDAQ root. This method shortcuts the need for callers to provide the openDAQ root device as the component, by automatically iterating to the root component from any component in the hierarchy.
1790    ///
1791    /// Calls the openDAQ C function `daqComponentUpdateContext_setRootComponent()`.
1792    pub fn set_root_component(&self, root_component: &Component) -> Result<()> {
1793        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_setRootComponent)(self.as_raw() as *mut _, root_component.as_raw() as *mut _) };
1794        check(__code, "daqComponentUpdateContext_setRootComponent")?;
1795        Ok(())
1796    }
1797
1798    /// Sets the signal dependency to the function block.
1799    ///
1800    /// # Parameters
1801    /// - `signal_id`: The ID of the signal.
1802    /// - `parent_id`: The ID of the parent component.
1803    ///
1804    /// Calls the openDAQ C function `daqComponentUpdateContext_setSignalDependency()`.
1805    pub fn set_signal_dependency(&self, signal_id: &str, parent_id: &str) -> Result<()> {
1806        let __signal_id = crate::marshal::make_string(signal_id)?;
1807        let __parent_id = crate::marshal::make_string(parent_id)?;
1808        let __code = unsafe { (crate::sys::api().daqComponentUpdateContext_setSignalDependency)(self.as_raw() as *mut _, __signal_id.as_ptr() as *mut _, __parent_id.as_ptr() as *mut _) };
1809        check(__code, "daqComponentUpdateContext_setSignalDependency")?;
1810        Ok(())
1811    }
1812
1813}
1814
1815impl Component {
1816    /// Creates a component.
1817    ///
1818    /// # Parameters
1819    /// - `context`: The Context. Most often the creating function-block/device passes its own Context to the Folder.
1820    /// - `parent`: The parent component.
1821    /// - `local_id`: The local ID of the component.
1822    ///
1823    /// Calls the openDAQ C function `daqComponent_createComponent()`.
1824    pub fn new(context: &Context, parent: Option<&Component>, local_id: &str, class_name: Option<&str>) -> Result<Component> {
1825        let __local_id = crate::marshal::make_string(local_id)?;
1826        let __class_name = match class_name { Some(s) => Some(crate::marshal::make_string(s)?), None => None };
1827        let mut __obj: *mut sys::daqComponent = std::ptr::null_mut();
1828        let __code = unsafe { (crate::sys::api().daqComponent_createComponent)(&mut __obj, context.as_raw() as *mut _, parent.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _), __local_id.as_ptr() as *mut _, __class_name.as_ref().map_or(std::ptr::null_mut(), |r| r.as_ptr()) as *mut _) };
1829        check(__code, "daqComponent_createComponent")?;
1830        Ok(unsafe { crate::marshal::require_object::<Component>(__obj as *mut _, "daqComponent_createComponent") }?)
1831    }
1832
1833    /// Finds the component (signal/device/function block) with the specified (global) id.
1834    ///
1835    /// # Parameters
1836    /// - `id`: The id of the component to search for.
1837    ///
1838    /// # Returns
1839    /// - `out_component`: The resulting component. If the component parameter is true, the starting component is the root device. The id provided should be in relative form from the starting component. E.g., to find a signal in the starting component, the id should be in the form of "Dev/dev_id/Ch/ch_id/Sig/sig_id.
1840    ///
1841    /// Calls the openDAQ C function `daqComponent_findComponent()`.
1842    pub fn find_component(&self, id: &str) -> Result<Option<Component>> {
1843        let __id = crate::marshal::make_string(id)?;
1844        let mut __out_component: *mut sys::daqComponent = std::ptr::null_mut();
1845        let __code = unsafe { (crate::sys::api().daqComponent_findComponent)(self.as_raw() as *mut _, __id.as_ptr() as *mut _, &mut __out_component) };
1846        check(__code, "daqComponent_findComponent")?;
1847        Ok(unsafe { crate::marshal::take_object::<Component>(__out_component as *mut _) })
1848    }
1849
1850    /// Returns true if the component is active; false otherwise.
1851    ///
1852    /// # Returns
1853    /// - `active`: True if the component is active; false otherwise. A component is active if its local active state is true and its parent is active. An active component acquires data, performs calculations and send packets on the signal path.
1854    ///
1855    /// Calls the openDAQ C function `daqComponent_getActive()`.
1856    pub fn active(&self) -> Result<bool> {
1857        let mut __active: u8 = 0;
1858        let __code = unsafe { (crate::sys::api().daqComponent_getActive)(self.as_raw() as *mut _, &mut __active) };
1859        check(__code, "daqComponent_getActive")?;
1860        Ok(__active != 0)
1861    }
1862
1863    /// Gets the context object.
1864    ///
1865    /// # Returns
1866    /// - `context`: The context object.
1867    ///
1868    /// Calls the openDAQ C function `daqComponent_getContext()`.
1869    pub fn context(&self) -> Result<Option<Context>> {
1870        let mut __context: *mut sys::daqContext = std::ptr::null_mut();
1871        let __code = unsafe { (crate::sys::api().daqComponent_getContext)(self.as_raw() as *mut _, &mut __context) };
1872        check(__code, "daqComponent_getContext")?;
1873        Ok(unsafe { crate::marshal::take_object::<Context>(__context as *mut _) })
1874    }
1875
1876    /// Gets the description of the component.
1877    ///
1878    /// # Returns
1879    /// - `description`: The description of the component. Empty if not configured. The object that implements this interface defines how the description is specified.
1880    ///
1881    /// Calls the openDAQ C function `daqComponent_getDescription()`.
1882    pub fn description(&self) -> Result<String> {
1883        let mut __description: *mut sys::daqString = std::ptr::null_mut();
1884        let __code = unsafe { (crate::sys::api().daqComponent_getDescription)(self.as_raw() as *mut _, &mut __description) };
1885        check(__code, "daqComponent_getDescription")?;
1886        Ok(unsafe { crate::marshal::take_string(__description) })
1887    }
1888
1889    /// Gets the global ID of the component.
1890    ///
1891    /// # Returns
1892    /// - `global_id`: The global ID of the component. Represents the identifier that is globally unique. Globally unique identifier is composed from local identifiers from the parent components separated by '/' character. Device component must make sure that its ID is globally unique.
1893    ///
1894    /// Calls the openDAQ C function `daqComponent_getGlobalId()`.
1895    pub fn global_id(&self) -> Result<String> {
1896        let mut __global_id: *mut sys::daqString = std::ptr::null_mut();
1897        let __code = unsafe { (crate::sys::api().daqComponent_getGlobalId)(self.as_raw() as *mut _, &mut __global_id) };
1898        check(__code, "daqComponent_getGlobalId")?;
1899        Ok(unsafe { crate::marshal::take_string(__global_id) })
1900    }
1901
1902    /// Returns true if the component is local active; false otherwise.
1903    ///
1904    /// # Returns
1905    /// - `local_active`: True if the component is local active; false otherwise. An active component acquires data, performs calculations and send packets on the signal path. Note that is local active is True, the component may still be inactive if its parents are inactive.
1906    ///
1907    /// Calls the openDAQ C function `daqComponent_getLocalActive()`.
1908    pub fn local_active(&self) -> Result<bool> {
1909        let mut __local_active: u8 = 0;
1910        let __code = unsafe { (crate::sys::api().daqComponent_getLocalActive)(self.as_raw() as *mut _, &mut __local_active) };
1911        check(__code, "daqComponent_getLocalActive")?;
1912        Ok(__local_active != 0)
1913    }
1914
1915    /// Gets the local ID of the component.
1916    ///
1917    /// # Returns
1918    /// - `local_id`: The local ID of the component. Represents the identifier that is unique in a relation to the parent component. There is no predefined format for local ID. It is a string defined by its parent component.
1919    ///
1920    /// Calls the openDAQ C function `daqComponent_getLocalId()`.
1921    pub fn local_id(&self) -> Result<String> {
1922        let mut __local_id: *mut sys::daqString = std::ptr::null_mut();
1923        let __code = unsafe { (crate::sys::api().daqComponent_getLocalId)(self.as_raw() as *mut _, &mut __local_id) };
1924        check(__code, "daqComponent_getLocalId")?;
1925        Ok(unsafe { crate::marshal::take_string(__local_id) })
1926    }
1927
1928    /// Gets a list of the component's locked attributes. The locked attributes cannot be modified via their respective setters.
1929    ///
1930    /// # Returns
1931    /// - `attributes`: A list of strings containing the names of locked attributes in capital case (eg. "Name", "Description").
1932    ///
1933    /// Calls the openDAQ C function `daqComponent_getLockedAttributes()`.
1934    pub fn locked_attributes(&self) -> Result<Vec<String>> {
1935        let mut __attributes: *mut sys::daqList = std::ptr::null_mut();
1936        let __code = unsafe { (crate::sys::api().daqComponent_getLockedAttributes)(self.as_raw() as *mut _, &mut __attributes) };
1937        check(__code, "daqComponent_getLockedAttributes")?;
1938        Ok(unsafe { crate::marshal::take_list::<String>(__attributes as *mut _, "daqComponent_getLockedAttributes") }?)
1939    }
1940
1941    /// Gets the name of the component.
1942    ///
1943    /// # Returns
1944    /// - `name`: The name of the component. Local ID if name is not configured. The object that implements this interface defines how the name is specified.
1945    ///
1946    /// Calls the openDAQ C function `daqComponent_getName()`.
1947    pub fn name(&self) -> Result<String> {
1948        let mut __name: *mut sys::daqString = std::ptr::null_mut();
1949        let __code = unsafe { (crate::sys::api().daqComponent_getName)(self.as_raw() as *mut _, &mut __name) };
1950        check(__code, "daqComponent_getName")?;
1951        Ok(unsafe { crate::marshal::take_string(__name) })
1952    }
1953
1954    /// Gets the Core Event object that triggers whenever a change to this component happens within the openDAQ core structure.
1955    ///
1956    /// # Returns
1957    /// - `event`: The Core Event object. The event triggers with a Component reference and a CoreEventArgs object as arguments. The Core Event is triggered on various changes to the openDAQ Components. This includes changes to property values, addition/removal of child components, connecting signals to input ports and others. The event type can be identified via the event ID available within the CoreEventArgs object. Each event type has a set of predetermined parameters available in the `parameters` field of the arguments. These can be used by any openDAQ server, or other listener to react to changes within the core structure.
1958    ///
1959    /// Calls the openDAQ C function `daqComponent_getOnComponentCoreEvent()`.
1960    pub fn on_component_core_event(&self) -> Result<Option<Event>> {
1961        let mut __event: *mut sys::daqEvent = std::ptr::null_mut();
1962        let __code = unsafe { (crate::sys::api().daqComponent_getOnComponentCoreEvent)(self.as_raw() as *mut _, &mut __event) };
1963        check(__code, "daqComponent_getOnComponentCoreEvent")?;
1964        Ok(unsafe { crate::marshal::take_object::<Event>(__event as *mut _) })
1965    }
1966
1967    /// Gets the operation mode of the device.
1968    ///
1969    /// # Returns
1970    /// - `mode_type`: The current operation mode.
1971    ///
1972    /// Calls the openDAQ C function `daqComponent_getOperationMode()`.
1973    pub fn operation_mode(&self) -> Result<OperationModeType> {
1974        let mut __mode_type: u32 = 0;
1975        let __code = unsafe { (crate::sys::api().daqComponent_getOperationMode)(self.as_raw() as *mut _, &mut __mode_type) };
1976        check(__code, "daqComponent_getOperationMode")?;
1977        Ok(crate::marshal::enum_out(OperationModeType::from_raw(__mode_type), "daqComponent_getOperationMode")?)
1978    }
1979
1980    /// Gets the parent of the component.
1981    ///
1982    /// # Returns
1983    /// - `parent`: The parent of the component. Every openDAQ component has a parent, except for instance. Parent should be passed as a parameter to the constructor/factory. Once the component is created, the parent cannot be changed.
1984    ///
1985    /// Calls the openDAQ C function `daqComponent_getParent()`.
1986    pub fn parent(&self) -> Result<Option<Component>> {
1987        let mut __parent: *mut sys::daqComponent = std::ptr::null_mut();
1988        let __code = unsafe { (crate::sys::api().daqComponent_getParent)(self.as_raw() as *mut _, &mut __parent) };
1989        check(__code, "daqComponent_getParent")?;
1990        Ok(unsafe { crate::marshal::take_object::<Component>(__parent as *mut _) })
1991    }
1992
1993    /// Returns true if the component's parent is active; false otherwise.
1994    ///
1995    /// # Returns
1996    /// - `parent_active`: True if the component's parent is active; false otherwise.
1997    ///
1998    /// Calls the openDAQ C function `daqComponent_getParentActive()`.
1999    pub fn parent_active(&self) -> Result<bool> {
2000        let mut __parent_active: u8 = 0;
2001        let __code = unsafe { (crate::sys::api().daqComponent_getParentActive)(self.as_raw() as *mut _, &mut __parent_active) };
2002        check(__code, "daqComponent_getParentActive")?;
2003        Ok(__parent_active != 0)
2004    }
2005
2006    /// Gets the container of Component statuses.
2007    ///
2008    /// # Returns
2009    /// - `status_container`: The container of Component statuses.
2010    ///
2011    /// Calls the openDAQ C function `daqComponent_getStatusContainer()`.
2012    pub fn status_container(&self) -> Result<Option<ComponentStatusContainer>> {
2013        let mut __status_container: *mut sys::daqComponentStatusContainer = std::ptr::null_mut();
2014        let __code = unsafe { (crate::sys::api().daqComponent_getStatusContainer)(self.as_raw() as *mut _, &mut __status_container) };
2015        check(__code, "daqComponent_getStatusContainer")?;
2016        Ok(unsafe { crate::marshal::take_object::<ComponentStatusContainer>(__status_container as *mut _) })
2017    }
2018
2019    /// Gets the tags of the component.
2020    ///
2021    /// # Returns
2022    /// - `tags`: The tags of the component. Tags are user definable labels that can be attached to the component.
2023    ///
2024    /// Calls the openDAQ C function `daqComponent_getTags()`.
2025    pub fn tags(&self) -> Result<Option<Tags>> {
2026        let mut __tags: *mut sys::daqTags = std::ptr::null_mut();
2027        let __code = unsafe { (crate::sys::api().daqComponent_getTags)(self.as_raw() as *mut _, &mut __tags) };
2028        check(__code, "daqComponent_getTags")?;
2029        Ok(unsafe { crate::marshal::take_object::<Tags>(__tags as *mut _) })
2030    }
2031
2032    /// Gets `visible` metadata state of the component
2033    ///
2034    /// # Returns
2035    /// - `visible`: True if the component is visible; False otherwise. Visible determines whether search/getter methods return find the component by default.
2036    ///
2037    /// Calls the openDAQ C function `daqComponent_getVisible()`.
2038    pub fn visible(&self) -> Result<bool> {
2039        let mut __visible: u8 = 0;
2040        let __code = unsafe { (crate::sys::api().daqComponent_getVisible)(self.as_raw() as *mut _, &mut __visible) };
2041        check(__code, "daqComponent_getVisible")?;
2042        Ok(__visible != 0)
2043    }
2044
2045    /// Sets the component to be either active or inactive. Sets the local active state and notifies children about the parent active state change.
2046    ///
2047    /// # Parameters
2048    /// - `active`: The new local active state of the component.
2049    ///
2050    /// # Errors
2051    /// - `OPENDAQ_IGNORED`: if "Active" is part of the component's list of locked attributes, or if the new active value is equal to the previous. An active component acquires data, performs calculations and send packets on the signal path.
2052    ///
2053    /// Calls the openDAQ C function `daqComponent_setActive()`.
2054    pub fn set_active(&self, active: bool) -> Result<()> {
2055        let __code = unsafe { (crate::sys::api().daqComponent_setActive)(self.as_raw() as *mut _, u8::from(active)) };
2056        check(__code, "daqComponent_setActive")?;
2057        Ok(())
2058    }
2059
2060    /// Sets the description of the component.
2061    ///
2062    /// # Parameters
2063    /// - `description`: The description of the component.
2064    ///
2065    /// # Errors
2066    /// - `OPENDAQ_IGNORED`: if "Description" is part of the component's list of locked attributes, or if the new description value is equal to the previous. The object that implements this interface defines how the description is specified.
2067    ///
2068    /// Calls the openDAQ C function `daqComponent_setDescription()`.
2069    pub fn set_description(&self, description: &str) -> Result<()> {
2070        let __description = crate::marshal::make_string(description)?;
2071        let __code = unsafe { (crate::sys::api().daqComponent_setDescription)(self.as_raw() as *mut _, __description.as_ptr() as *mut _) };
2072        check(__code, "daqComponent_setDescription")?;
2073        Ok(())
2074    }
2075
2076    /// Sets the name of the component.
2077    ///
2078    /// # Parameters
2079    /// - `name`: The name of the component.
2080    ///
2081    /// # Errors
2082    /// - `OPENDAQ_IGNORED`: if "Name" is part of the component's list of locked attributes, or if the new name value is equal to the previous. The object that implements this interface defines how the name is specified.
2083    ///
2084    /// Calls the openDAQ C function `daqComponent_setName()`.
2085    pub fn set_name(&self, name: &str) -> Result<()> {
2086        let __name = crate::marshal::make_string(name)?;
2087        let __code = unsafe { (crate::sys::api().daqComponent_setName)(self.as_raw() as *mut _, __name.as_ptr() as *mut _) };
2088        check(__code, "daqComponent_setName")?;
2089        Ok(())
2090    }
2091
2092    /// Sets `visible` attribute state of the component
2093    ///
2094    /// # Parameters
2095    /// - `visible`: True if the component is visible; False otherwise.
2096    ///
2097    /// # Errors
2098    /// - `OPENDAQ_IGNORED`: if "Visible" is part of the component's list of locked attributes. Visible determines whether search/getter methods return find the component by default.
2099    ///
2100    /// Calls the openDAQ C function `daqComponent_setVisible()`.
2101    pub fn set_visible(&self, visible: bool) -> Result<()> {
2102        let __code = unsafe { (crate::sys::api().daqComponent_setVisible)(self.as_raw() as *mut _, u8::from(visible)) };
2103        check(__code, "daqComponent_setVisible")?;
2104        Ok(())
2105    }
2106
2107}
2108
2109impl Context {
2110    /// @ingroup opendaq_context
2111    /// @addtogroup opendaq_context_factories Factories
2112    ///
2113    /// Calls the openDAQ C function `daqContext_createContext()`.
2114    pub fn new(scheduler: Option<&Scheduler>, logger: &Logger, type_manager: &TypeManager, module_manager: Option<&ModuleManager>, authentication_provider: Option<&AuthenticationProvider>, options: impl Into<Value>, discovery_servers: impl Into<Value>) -> Result<Context> {
2115        let __options = crate::value::to_daq(&options.into())?;
2116        let __discovery_servers = crate::value::to_daq(&discovery_servers.into())?;
2117        let mut __obj: *mut sys::daqContext = std::ptr::null_mut();
2118        let __code = unsafe { (crate::sys::api().daqContext_createContext)(&mut __obj, scheduler.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _), logger.as_raw() as *mut _, type_manager.as_raw() as *mut _, module_manager.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _), authentication_provider.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _), crate::value::opt_ref_ptr(&__options) as *mut _, crate::value::opt_ref_ptr(&__discovery_servers) as *mut _) };
2119        check(__code, "daqContext_createContext")?;
2120        Ok(unsafe { crate::marshal::require_object::<Context>(__obj as *mut _, "daqContext_createContext") }?)
2121    }
2122
2123    /// Gets the Authentication provider.
2124    ///
2125    /// # Returns
2126    /// - `authentication_provider`: The authentication provider.
2127    ///
2128    /// Calls the openDAQ C function `daqContext_getAuthenticationProvider()`.
2129    pub fn authentication_provider(&self) -> Result<Option<AuthenticationProvider>> {
2130        let mut __authentication_provider: *mut sys::daqAuthenticationProvider = std::ptr::null_mut();
2131        let __code = unsafe { (crate::sys::api().daqContext_getAuthenticationProvider)(self.as_raw() as *mut _, &mut __authentication_provider) };
2132        check(__code, "daqContext_getAuthenticationProvider")?;
2133        Ok(unsafe { crate::marshal::take_object::<AuthenticationProvider>(__authentication_provider as *mut _) })
2134    }
2135
2136    /// Gets the dictionary of available discovery servers.
2137    ///
2138    /// # Returns
2139    /// - `servers`: The dictionary of available discovery servers.
2140    ///
2141    /// Calls the openDAQ C function `daqContext_getDiscoveryServers()`.
2142    pub fn discovery_servers(&self) -> Result<std::collections::HashMap<String, Value>> {
2143        let mut __servers: *mut sys::daqDict = std::ptr::null_mut();
2144        let __code = unsafe { (crate::sys::api().daqContext_getDiscoveryServers)(self.as_raw() as *mut _, &mut __servers) };
2145        check(__code, "daqContext_getDiscoveryServers")?;
2146        Ok(unsafe { crate::marshal::take_dict::<String, Value>(__servers as *mut _, "daqContext_getDiscoveryServers") }?)
2147    }
2148
2149    /// Gets the logger.
2150    ///
2151    /// # Returns
2152    /// - `logger`: The logger.
2153    ///
2154    /// Calls the openDAQ C function `daqContext_getLogger()`.
2155    pub fn logger(&self) -> Result<Option<Logger>> {
2156        let mut __logger: *mut sys::daqLogger = std::ptr::null_mut();
2157        let __code = unsafe { (crate::sys::api().daqContext_getLogger)(self.as_raw() as *mut _, &mut __logger) };
2158        check(__code, "daqContext_getLogger")?;
2159        Ok(unsafe { crate::marshal::take_object::<Logger>(__logger as *mut _) })
2160    }
2161
2162    /// Gets the Module Manager as a Base Object.
2163    ///
2164    /// # Returns
2165    /// - `manager`: The module manager.
2166    ///
2167    /// Calls the openDAQ C function `daqContext_getModuleManager()`.
2168    pub fn module_manager(&self) -> Result<Value> {
2169        let mut __manager: *mut sys::daqBaseObject = std::ptr::null_mut();
2170        let __code = unsafe { (crate::sys::api().daqContext_getModuleManager)(self.as_raw() as *mut _, &mut __manager) };
2171        check(__code, "daqContext_getModuleManager")?;
2172        Ok(unsafe { crate::value::take_value(__manager, "daqContext_getModuleManager") }?)
2173    }
2174
2175    /// Retrieves the options associated with the specified module ID.
2176    ///
2177    /// # Parameters
2178    /// - `module_id`: The identifier of the module for which options are requested.
2179    ///
2180    /// # Returns
2181    /// - `options`: A dictionary containing the options associated with the specified module ID.
2182    ///
2183    /// Calls the openDAQ C function `daqContext_getModuleOptions()`.
2184    pub fn module_options(&self, module_id: &str) -> Result<std::collections::HashMap<String, Value>> {
2185        let __module_id = crate::marshal::make_string(module_id)?;
2186        let mut __options: *mut sys::daqDict = std::ptr::null_mut();
2187        let __code = unsafe { (crate::sys::api().daqContext_getModuleOptions)(self.as_raw() as *mut _, __module_id.as_ptr() as *mut _, &mut __options) };
2188        check(__code, "daqContext_getModuleOptions")?;
2189        Ok(unsafe { crate::marshal::take_dict::<String, Value>(__options as *mut _, "daqContext_getModuleOptions") }?)
2190    }
2191
2192    /// Gets the Core Event object that triggers whenever a change happens within the openDAQ core structure.
2193    ///
2194    /// # Returns
2195    /// - `event`: The Core Event object. The event triggers with a Component reference and a CoreEventArgs object as arguments. The Core Event is triggered on various changes to the openDAQ Components. This includes changes to property values, addition/removal of child components, connecting signals to input ports and others. The event type can be identified via the event ID available within the CoreEventArgs object. Each event type has a set of predetermined parameters available in the `parameters` field of the arguments. These can be used by any openDAQ server, or other listener to react to changes within the core structure.
2196    ///
2197    /// Calls the openDAQ C function `daqContext_getOnCoreEvent()`.
2198    pub fn on_core_event(&self) -> Result<Option<Event>> {
2199        let mut __event: *mut sys::daqEvent = std::ptr::null_mut();
2200        let __code = unsafe { (crate::sys::api().daqContext_getOnCoreEvent)(self.as_raw() as *mut _, &mut __event) };
2201        check(__code, "daqContext_getOnCoreEvent")?;
2202        Ok(unsafe { crate::marshal::take_object::<Event>(__event as *mut _) })
2203    }
2204
2205    /// Gets the dictionary of options
2206    ///
2207    /// # Returns
2208    /// - `options`: The dictionary of options
2209    ///
2210    /// Calls the openDAQ C function `daqContext_getOptions()`.
2211    pub fn options(&self) -> Result<std::collections::HashMap<String, Value>> {
2212        let mut __options: *mut sys::daqDict = std::ptr::null_mut();
2213        let __code = unsafe { (crate::sys::api().daqContext_getOptions)(self.as_raw() as *mut _, &mut __options) };
2214        check(__code, "daqContext_getOptions")?;
2215        Ok(unsafe { crate::marshal::take_dict::<String, Value>(__options as *mut _, "daqContext_getOptions") }?)
2216    }
2217
2218    /// Gets the scheduler.
2219    ///
2220    /// # Returns
2221    /// - `scheduler`: The scheduler.
2222    ///
2223    /// Calls the openDAQ C function `daqContext_getScheduler()`.
2224    pub fn scheduler(&self) -> Result<Option<Scheduler>> {
2225        let mut __scheduler: *mut sys::daqScheduler = std::ptr::null_mut();
2226        let __code = unsafe { (crate::sys::api().daqContext_getScheduler)(self.as_raw() as *mut _, &mut __scheduler) };
2227        check(__code, "daqContext_getScheduler")?;
2228        Ok(unsafe { crate::marshal::take_object::<Scheduler>(__scheduler as *mut _) })
2229    }
2230
2231    /// Gets the Type Manager.
2232    ///
2233    /// # Returns
2234    /// - `manager`: The type manager.
2235    ///
2236    /// Calls the openDAQ C function `daqContext_getTypeManager()`.
2237    pub fn type_manager(&self) -> Result<Option<TypeManager>> {
2238        let mut __manager: *mut sys::daqTypeManager = std::ptr::null_mut();
2239        let __code = unsafe { (crate::sys::api().daqContext_getTypeManager)(self.as_raw() as *mut _, &mut __manager) };
2240        check(__code, "daqContext_getTypeManager")?;
2241        Ok(unsafe { crate::marshal::take_object::<TypeManager>(__manager as *mut _) })
2242    }
2243
2244}
2245
2246impl DeserializeComponent {
2247    /// Calls the openDAQ C function `daqDeserializeComponent_complete()`.
2248    pub fn complete(&self) -> Result<()> {
2249        let __code = unsafe { (crate::sys::api().daqDeserializeComponent_complete)(self.as_raw() as *mut _) };
2250        check(__code, "daqDeserializeComponent_complete")?;
2251        Ok(())
2252    }
2253
2254    /// Calls the openDAQ C function `daqDeserializeComponent_deserializeValues()`.
2255    pub fn deserialize_values(&self, serialized_object: &SerializedObject, context: impl Into<Value>, callback_factory: &FunctionObject) -> Result<()> {
2256        let __context = crate::value::to_daq(&context.into())?;
2257        let __code = unsafe { (crate::sys::api().daqDeserializeComponent_deserializeValues)(self.as_raw() as *mut _, serialized_object.as_raw() as *mut _, crate::value::opt_ref_ptr(&__context) as *mut _, callback_factory.as_raw() as *mut _) };
2258        check(__code, "daqDeserializeComponent_deserializeValues")?;
2259        Ok(())
2260    }
2261
2262    /// Calls the openDAQ C function `daqDeserializeComponent_getDeserializedParameter()`.
2263    pub fn deserialized_parameter(&self, parameter: &str) -> Result<Value> {
2264        let __parameter = crate::marshal::make_string(parameter)?;
2265        let mut __value: *mut sys::daqBaseObject = std::ptr::null_mut();
2266        let __code = unsafe { (crate::sys::api().daqDeserializeComponent_getDeserializedParameter)(self.as_raw() as *mut _, __parameter.as_ptr() as *mut _, &mut __value) };
2267        check(__code, "daqDeserializeComponent_getDeserializedParameter")?;
2268        Ok(unsafe { crate::value::take_value(__value, "daqDeserializeComponent_getDeserializedParameter") }?)
2269    }
2270
2271}
2272
2273impl DeviceUpdateOptions {
2274    /// Calls the openDAQ C function `daqDeviceUpdateOptions_createDeviceUpdateOptions()`.
2275    pub fn new(setup_string: &str) -> Result<DeviceUpdateOptions> {
2276        let __setup_string = crate::marshal::make_string(setup_string)?;
2277        let mut __obj: *mut sys::daqDeviceUpdateOptions = std::ptr::null_mut();
2278        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_createDeviceUpdateOptions)(&mut __obj, __setup_string.as_ptr() as *mut _) };
2279        check(__code, "daqDeviceUpdateOptions_createDeviceUpdateOptions")?;
2280        Ok(unsafe { crate::marshal::require_object::<DeviceUpdateOptions>(__obj as *mut _, "daqDeviceUpdateOptions_createDeviceUpdateOptions") }?)
2281    }
2282
2283    /// Gets the list of child device options for the device. These are used to configure subdevices of the current device.
2284    ///
2285    /// # Parameters
2286    /// - `child_device_options`: The list of child device options for the device.
2287    ///
2288    /// Calls the openDAQ C function `daqDeviceUpdateOptions_getChildDeviceOptions()`.
2289    pub fn child_device_options(&self) -> Result<Vec<DeviceUpdateOptions>> {
2290        let mut __child_device_options: *mut sys::daqList = std::ptr::null_mut();
2291        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_getChildDeviceOptions)(self.as_raw() as *mut _, &mut __child_device_options) };
2292        check(__code, "daqDeviceUpdateOptions_getChildDeviceOptions")?;
2293        Ok(unsafe { crate::marshal::take_list::<DeviceUpdateOptions>(__child_device_options as *mut _, "daqDeviceUpdateOptions_getChildDeviceOptions") }?)
2294    }
2295
2296    /// Gets the connection string of the device, as written in the setup string.
2297    ///
2298    /// # Parameters
2299    /// - `connection_string`: The connection string of the device.
2300    ///
2301    /// Calls the openDAQ C function `daqDeviceUpdateOptions_getConnectionString()`.
2302    pub fn connection_string(&self) -> Result<String> {
2303        let mut __connection_string: *mut sys::daqString = std::ptr::null_mut();
2304        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_getConnectionString)(self.as_raw() as *mut _, &mut __connection_string) };
2305        check(__code, "daqDeviceUpdateOptions_getConnectionString")?;
2306        Ok(unsafe { crate::marshal::take_string(__connection_string) })
2307    }
2308
2309    /// Gets the local ID of the device. The local ID is obtained from the JSON key for the device entry.
2310    ///
2311    /// # Parameters
2312    /// - `local_id`: The local ID of the device. The root device might not have the local ID configured. In this case the local ID will be set to "Root".
2313    ///
2314    /// Calls the openDAQ C function `daqDeviceUpdateOptions_getLocalId()`.
2315    pub fn local_id(&self) -> Result<String> {
2316        let mut __local_id: *mut sys::daqString = std::ptr::null_mut();
2317        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_getLocalId)(self.as_raw() as *mut _, &mut __local_id) };
2318        check(__code, "daqDeviceUpdateOptions_getLocalId")?;
2319        Ok(unsafe { crate::marshal::take_string(__local_id) })
2320    }
2321
2322    /// Gets the manufacturer of the device, as written in the setup string.
2323    ///
2324    /// # Parameters
2325    /// - `manufacturer`: The manufacturer of the device.
2326    ///
2327    /// Calls the openDAQ C function `daqDeviceUpdateOptions_getManufacturer()`.
2328    pub fn manufacturer(&self) -> Result<String> {
2329        let mut __manufacturer: *mut sys::daqString = std::ptr::null_mut();
2330        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_getManufacturer)(self.as_raw() as *mut _, &mut __manufacturer) };
2331        check(__code, "daqDeviceUpdateOptions_getManufacturer")?;
2332        Ok(unsafe { crate::marshal::take_string(__manufacturer) })
2333    }
2334
2335    /// Gets the new connection string of the device to be used for remapping.
2336    ///
2337    /// # Parameters
2338    /// - `connection_string`: The new connection string of the device to be used for remapping. The manufacturer and serial number combination has priority over the connection string when remapping.
2339    ///
2340    /// Calls the openDAQ C function `daqDeviceUpdateOptions_getNewConnectionString()`.
2341    pub fn new_connection_string(&self) -> Result<String> {
2342        let mut __connection_string: *mut sys::daqString = std::ptr::null_mut();
2343        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_getNewConnectionString)(self.as_raw() as *mut _, &mut __connection_string) };
2344        check(__code, "daqDeviceUpdateOptions_getNewConnectionString")?;
2345        Ok(unsafe { crate::marshal::take_string(__connection_string) })
2346    }
2347
2348    /// Gets the new manufacturer of the device to be used for remapping.
2349    ///
2350    /// # Parameters
2351    /// - `manufacturer`: The new manufacturer of the device to be used for remapping.
2352    ///
2353    /// Calls the openDAQ C function `daqDeviceUpdateOptions_getNewManufacturer()`.
2354    pub fn new_manufacturer(&self) -> Result<String> {
2355        let mut __manufacturer: *mut sys::daqString = std::ptr::null_mut();
2356        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_getNewManufacturer)(self.as_raw() as *mut _, &mut __manufacturer) };
2357        check(__code, "daqDeviceUpdateOptions_getNewManufacturer")?;
2358        Ok(unsafe { crate::marshal::take_string(__manufacturer) })
2359    }
2360
2361    /// Gets the new serial number of the device to be used for remapping.
2362    ///
2363    /// # Parameters
2364    /// - `serial_number`: The new serial number of the device to be used for remapping.
2365    ///
2366    /// Calls the openDAQ C function `daqDeviceUpdateOptions_getNewSerialNumber()`.
2367    pub fn new_serial_number(&self) -> Result<String> {
2368        let mut __serial_number: *mut sys::daqString = std::ptr::null_mut();
2369        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_getNewSerialNumber)(self.as_raw() as *mut _, &mut __serial_number) };
2370        check(__code, "daqDeviceUpdateOptions_getNewSerialNumber")?;
2371        Ok(unsafe { crate::marshal::take_string(__serial_number) })
2372    }
2373
2374    /// Gets the serial number of the device, as written in the setup string.
2375    ///
2376    /// # Parameters
2377    /// - `serial_number`: The serial number of the device.
2378    ///
2379    /// Calls the openDAQ C function `daqDeviceUpdateOptions_getSerialNumber()`.
2380    pub fn serial_number(&self) -> Result<String> {
2381        let mut __serial_number: *mut sys::daqString = std::ptr::null_mut();
2382        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_getSerialNumber)(self.as_raw() as *mut _, &mut __serial_number) };
2383        check(__code, "daqDeviceUpdateOptions_getSerialNumber")?;
2384        Ok(unsafe { crate::marshal::take_string(__serial_number) })
2385    }
2386
2387    /// Gets the update mode for the device.
2388    ///
2389    /// # Parameters
2390    /// - `mode`: The update mode for the device.
2391    ///
2392    /// Calls the openDAQ C function `daqDeviceUpdateOptions_getUpdateMode()`.
2393    pub fn update_mode(&self) -> Result<DeviceUpdateMode> {
2394        let mut __mode: u32 = 0;
2395        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_getUpdateMode)(self.as_raw() as *mut _, &mut __mode) };
2396        check(__code, "daqDeviceUpdateOptions_getUpdateMode")?;
2397        Ok(crate::marshal::enum_out(DeviceUpdateMode::from_raw(__mode), "daqDeviceUpdateOptions_getUpdateMode")?)
2398    }
2399
2400    /// Sets the new connection string of the device to be used for remapping.
2401    ///
2402    /// # Parameters
2403    /// - `connection_string`: The new connection string of the device to be used for remapping. The manufacturer and serial number combination has priority over the connection string when remapping.
2404    ///
2405    /// Calls the openDAQ C function `daqDeviceUpdateOptions_setNewConnectionString()`.
2406    pub fn set_new_connection_string(&self, connection_string: &str) -> Result<()> {
2407        let __connection_string = crate::marshal::make_string(connection_string)?;
2408        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_setNewConnectionString)(self.as_raw() as *mut _, __connection_string.as_ptr() as *mut _) };
2409        check(__code, "daqDeviceUpdateOptions_setNewConnectionString")?;
2410        Ok(())
2411    }
2412
2413    /// Sets the new manufacturer of the device to be used for remapping.
2414    ///
2415    /// # Parameters
2416    /// - `manufacturer`: The new manufacturer of the device to be used for remapping.
2417    ///
2418    /// Calls the openDAQ C function `daqDeviceUpdateOptions_setNewManufacturer()`.
2419    pub fn set_new_manufacturer(&self, manufacturer: &str) -> Result<()> {
2420        let __manufacturer = crate::marshal::make_string(manufacturer)?;
2421        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_setNewManufacturer)(self.as_raw() as *mut _, __manufacturer.as_ptr() as *mut _) };
2422        check(__code, "daqDeviceUpdateOptions_setNewManufacturer")?;
2423        Ok(())
2424    }
2425
2426    /// Sets the new serial number of the device to be used for remapping.
2427    ///
2428    /// # Parameters
2429    /// - `serial_number`: The new serial number of the device to be used for remapping.
2430    ///
2431    /// Calls the openDAQ C function `daqDeviceUpdateOptions_setNewSerialNumber()`.
2432    pub fn set_new_serial_number(&self, serial_number: &str) -> Result<()> {
2433        let __serial_number = crate::marshal::make_string(serial_number)?;
2434        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_setNewSerialNumber)(self.as_raw() as *mut _, __serial_number.as_ptr() as *mut _) };
2435        check(__code, "daqDeviceUpdateOptions_setNewSerialNumber")?;
2436        Ok(())
2437    }
2438
2439    /// Sets the update mode for the device.
2440    ///
2441    /// # Parameters
2442    /// - `mode`: The update mode for the device.
2443    ///
2444    /// Calls the openDAQ C function `daqDeviceUpdateOptions_setUpdateMode()`.
2445    pub fn set_update_mode(&self, mode: DeviceUpdateMode) -> Result<()> {
2446        let __code = unsafe { (crate::sys::api().daqDeviceUpdateOptions_setUpdateMode)(self.as_raw() as *mut _, mode as u32) };
2447        check(__code, "daqDeviceUpdateOptions_setUpdateMode")?;
2448        Ok(())
2449    }
2450
2451}
2452
2453impl FolderConfig {
2454    /// Adds a component to the folder.
2455    ///
2456    /// # Parameters
2457    /// - `item`: The component.
2458    ///
2459    /// Calls the openDAQ C function `daqFolderConfig_addItem()`.
2460    pub fn add_item(&self, item: &Component) -> Result<()> {
2461        let __code = unsafe { (crate::sys::api().daqFolderConfig_addItem)(self.as_raw() as *mut _, item.as_raw() as *mut _) };
2462        check(__code, "daqFolderConfig_addItem")?;
2463        Ok(())
2464    }
2465
2466    /// Removes all items from the folder.
2467    ///
2468    /// Calls the openDAQ C function `daqFolderConfig_clear()`.
2469    pub fn clear(&self) -> Result<()> {
2470        let __code = unsafe { (crate::sys::api().daqFolderConfig_clear)(self.as_raw() as *mut _) };
2471        check(__code, "daqFolderConfig_clear")?;
2472        Ok(())
2473    }
2474
2475    /// Creates a folder.
2476    ///
2477    /// # Parameters
2478    /// - `context`: The Context. Most often the creating function-block/device passes its own Context to the Folder.
2479    /// - `parent`: The parent component.
2480    /// - `local_id`: The local ID of the component.
2481    ///
2482    /// Calls the openDAQ C function `daqFolderConfig_createFolder()`.
2483    pub fn folder(context: &Context, parent: &Component, local_id: &str) -> Result<FolderConfig> {
2484        let __local_id = crate::marshal::make_string(local_id)?;
2485        let mut __obj: *mut sys::daqFolderConfig = std::ptr::null_mut();
2486        let __code = unsafe { (crate::sys::api().daqFolderConfig_createFolder)(&mut __obj, context.as_raw() as *mut _, parent.as_raw() as *mut _, __local_id.as_ptr() as *mut _) };
2487        check(__code, "daqFolderConfig_createFolder")?;
2488        Ok(unsafe { crate::marshal::require_object::<FolderConfig>(__obj as *mut _, "daqFolderConfig_createFolder") }?)
2489    }
2490
2491    /// Creates a folder with an interface ID that must be implemented by its children.
2492    ///
2493    /// # Parameters
2494    /// - `context`: The Context. Most often the creating function-block/device passes its own Context to the Folder.
2495    /// - `item_type`: The ID of interface that child objects of the folder must implement.
2496    /// - `parent`: The parent component.
2497    /// - `local_id`: The local ID of the component.
2498    ///
2499    /// Calls the openDAQ C function `daqFolderConfig_createFolderWithItemType()`.
2500    pub fn folder_with_item_type(item_type: crate::IntfID, context: &Context, parent: &Component, local_id: &str) -> Result<FolderConfig> {
2501        let __local_id = crate::marshal::make_string(local_id)?;
2502        let mut __obj: *mut sys::daqFolderConfig = std::ptr::null_mut();
2503        let __code = unsafe { (crate::sys::api().daqFolderConfig_createFolderWithItemType)(&mut __obj, item_type, context.as_raw() as *mut _, parent.as_raw() as *mut _, __local_id.as_ptr() as *mut _) };
2504        check(__code, "daqFolderConfig_createFolderWithItemType")?;
2505        Ok(unsafe { crate::marshal::require_object::<FolderConfig>(__obj as *mut _, "daqFolderConfig_createFolderWithItemType") }?)
2506    }
2507
2508    /// Creates an IO folder.
2509    ///
2510    /// # Parameters
2511    /// - `context`: The Context. Most often the creating function-block/device passes its own Context to the Folder.
2512    /// - `parent`: The parent component.
2513    /// - `local_id`: The local ID of the parent. IO folders are folder created by device and may contain only channels and other IO folders.
2514    ///
2515    /// Calls the openDAQ C function `daqFolderConfig_createIoFolder()`.
2516    pub fn io_folder(context: &Context, parent: &Component, local_id: &str) -> Result<FolderConfig> {
2517        let __local_id = crate::marshal::make_string(local_id)?;
2518        let mut __obj: *mut sys::daqFolderConfig = std::ptr::null_mut();
2519        let __code = unsafe { (crate::sys::api().daqFolderConfig_createIoFolder)(&mut __obj, context.as_raw() as *mut _, parent.as_raw() as *mut _, __local_id.as_ptr() as *mut _) };
2520        check(__code, "daqFolderConfig_createIoFolder")?;
2521        Ok(unsafe { crate::marshal::require_object::<FolderConfig>(__obj as *mut _, "daqFolderConfig_createIoFolder") }?)
2522    }
2523
2524    /// Removes the item from the folder.
2525    ///
2526    /// # Parameters
2527    /// - `item`: The item component.
2528    ///
2529    /// Calls the openDAQ C function `daqFolderConfig_removeItem()`.
2530    pub fn remove_item(&self, item: &Component) -> Result<()> {
2531        let __code = unsafe { (crate::sys::api().daqFolderConfig_removeItem)(self.as_raw() as *mut _, item.as_raw() as *mut _) };
2532        check(__code, "daqFolderConfig_removeItem")?;
2533        Ok(())
2534    }
2535
2536    /// Removes the item from the folder using local id of the component.
2537    ///
2538    /// # Parameters
2539    /// - `local_id`: The local id of the component.
2540    ///
2541    /// Calls the openDAQ C function `daqFolderConfig_removeItemWithLocalId()`.
2542    pub fn remove_item_with_local_id(&self, local_id: &str) -> Result<()> {
2543        let __local_id = crate::marshal::make_string(local_id)?;
2544        let __code = unsafe { (crate::sys::api().daqFolderConfig_removeItemWithLocalId)(self.as_raw() as *mut _, __local_id.as_ptr() as *mut _) };
2545        check(__code, "daqFolderConfig_removeItemWithLocalId")?;
2546        Ok(())
2547    }
2548
2549}
2550
2551impl Folder {
2552    /// Gets the item component with the specified localId.
2553    ///
2554    /// # Parameters
2555    /// - `local_id`: The local id of the child component.
2556    ///
2557    /// # Returns
2558    /// - `item`: The item component.
2559    ///
2560    /// # Errors
2561    /// - `OPENDAQ_SUCCESS`: if succeeded.
2562    /// - `OPENDAQ_NOT_FOUND`: if folder with the specified ID not found.
2563    ///
2564    /// Calls the openDAQ C function `daqFolder_getItem()`.
2565    pub fn item(&self, local_id: &str) -> Result<Option<Component>> {
2566        let __local_id = crate::marshal::make_string(local_id)?;
2567        let mut __item: *mut sys::daqComponent = std::ptr::null_mut();
2568        let __code = unsafe { (crate::sys::api().daqFolder_getItem)(self.as_raw() as *mut _, __local_id.as_ptr() as *mut _, &mut __item) };
2569        check(__code, "daqFolder_getItem")?;
2570        Ok(unsafe { crate::marshal::take_object::<Component>(__item as *mut _) })
2571    }
2572
2573    /// Gets the list of the items in the folder.
2574    ///
2575    /// # Parameters
2576    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
2577    ///
2578    /// # Returns
2579    /// - `items`: The list of the items. If searchFilter is not provided, the returned list contains only immediate children with visible set to `true`.
2580    ///
2581    /// Calls the openDAQ C function `daqFolder_getItems()`.
2582    pub fn items(&self) -> Result<Vec<Component>> {
2583        let mut __items: *mut sys::daqList = std::ptr::null_mut();
2584        let __code = unsafe { (crate::sys::api().daqFolder_getItems)(self.as_raw() as *mut _, &mut __items, std::ptr::null_mut()) };
2585        check(__code, "daqFolder_getItems")?;
2586        Ok(unsafe { crate::marshal::take_list::<Component>(__items as *mut _, "daqFolder_getItems") }?)
2587    }
2588
2589    /// Gets the list of the items in the folder.
2590    ///
2591    /// # Parameters
2592    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
2593    ///
2594    /// # Returns
2595    /// - `items`: The list of the items. If searchFilter is not provided, the returned list contains only immediate children with visible set to `true`.
2596    ///
2597    /// Calls the openDAQ C function `daqFolder_getItems()`.
2598    pub fn items_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<Component>> {
2599        let mut __items: *mut sys::daqList = std::ptr::null_mut();
2600        let __code = unsafe { (crate::sys::api().daqFolder_getItems)(self.as_raw() as *mut _, &mut __items, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
2601        check(__code, "daqFolder_getItems")?;
2602        Ok(unsafe { crate::marshal::take_list::<Component>(__items as *mut _, "daqFolder_getItems") }?)
2603    }
2604
2605    /// Returns True if the folder has an item with local ID.
2606    ///
2607    /// # Parameters
2608    /// - `local_id`: The local ID of the item.
2609    ///
2610    /// # Returns
2611    /// - `value`: True if the folder contains item with local ID.
2612    ///
2613    /// Calls the openDAQ C function `daqFolder_hasItem()`.
2614    pub fn has_item(&self, local_id: &str) -> Result<bool> {
2615        let __local_id = crate::marshal::make_string(local_id)?;
2616        let mut __value: u8 = 0;
2617        let __code = unsafe { (crate::sys::api().daqFolder_hasItem)(self.as_raw() as *mut _, __local_id.as_ptr() as *mut _, &mut __value) };
2618        check(__code, "daqFolder_hasItem")?;
2619        Ok(__value != 0)
2620    }
2621
2622    /// Returns True if the folder is empty.
2623    ///
2624    /// # Returns
2625    /// - `empty`: True if the folder is empty.
2626    ///
2627    /// Calls the openDAQ C function `daqFolder_isEmpty()`.
2628    pub fn is_empty(&self) -> Result<bool> {
2629        let mut __empty: u8 = 0;
2630        let __code = unsafe { (crate::sys::api().daqFolder_isEmpty)(self.as_raw() as *mut _, &mut __empty) };
2631        check(__code, "daqFolder_isEmpty")?;
2632        Ok(__empty != 0)
2633    }
2634
2635}
2636
2637impl ModuleInfo {
2638    /// Calls the openDAQ C function `daqModuleInfo_createModuleInfo()`.
2639    pub fn new(version_info: &VersionInfo, name: &str, id: &str) -> Result<ModuleInfo> {
2640        let __name = crate::marshal::make_string(name)?;
2641        let __id = crate::marshal::make_string(id)?;
2642        let mut __obj: *mut sys::daqModuleInfo = std::ptr::null_mut();
2643        let __code = unsafe { (crate::sys::api().daqModuleInfo_createModuleInfo)(&mut __obj, version_info.as_raw() as *mut _, __name.as_ptr() as *mut _, __id.as_ptr() as *mut _) };
2644        check(__code, "daqModuleInfo_createModuleInfo")?;
2645        Ok(unsafe { crate::marshal::require_object::<ModuleInfo>(__obj as *mut _, "daqModuleInfo_createModuleInfo") }?)
2646    }
2647
2648    /// Gets the module id.
2649    ///
2650    /// # Returns
2651    /// - `id`: The module id.
2652    ///
2653    /// Calls the openDAQ C function `daqModuleInfo_getId()`.
2654    pub fn id(&self) -> Result<String> {
2655        let mut __id: *mut sys::daqString = std::ptr::null_mut();
2656        let __code = unsafe { (crate::sys::api().daqModuleInfo_getId)(self.as_raw() as *mut _, &mut __id) };
2657        check(__code, "daqModuleInfo_getId")?;
2658        Ok(unsafe { crate::marshal::take_string(__id) })
2659    }
2660
2661    /// Gets the module name.
2662    ///
2663    /// # Returns
2664    /// - `name`: The module name.
2665    ///
2666    /// Calls the openDAQ C function `daqModuleInfo_getName()`.
2667    pub fn name(&self) -> Result<String> {
2668        let mut __name: *mut sys::daqString = std::ptr::null_mut();
2669        let __code = unsafe { (crate::sys::api().daqModuleInfo_getName)(self.as_raw() as *mut _, &mut __name) };
2670        check(__code, "daqModuleInfo_getName")?;
2671        Ok(unsafe { crate::marshal::take_string(__name) })
2672    }
2673
2674    /// Retrieves the module version information.
2675    ///
2676    /// # Returns
2677    /// - `version`: The semantic version information.
2678    ///
2679    /// Calls the openDAQ C function `daqModuleInfo_getVersionInfo()`.
2680    pub fn version_info(&self) -> Result<Option<VersionInfo>> {
2681        let mut __version: *mut sys::daqVersionInfo = std::ptr::null_mut();
2682        let __code = unsafe { (crate::sys::api().daqModuleInfo_getVersionInfo)(self.as_raw() as *mut _, &mut __version) };
2683        check(__code, "daqModuleInfo_getVersionInfo")?;
2684        Ok(unsafe { crate::marshal::take_object::<VersionInfo>(__version as *mut _) })
2685    }
2686
2687}
2688
2689impl Removable {
2690    /// Returns True if component was removed.
2691    ///
2692    /// # Returns
2693    /// - `removed`: True if component was removed; otherwise False.
2694    ///
2695    /// Calls the openDAQ C function `daqRemovable_isRemoved()`.
2696    pub fn is_removed(&self) -> Result<bool> {
2697        let mut __removed: u8 = 0;
2698        let __code = unsafe { (crate::sys::api().daqRemovable_isRemoved)(self.as_raw() as *mut _, &mut __removed) };
2699        check(__code, "daqRemovable_isRemoved")?;
2700        Ok(__removed != 0)
2701    }
2702
2703    /// Notifies the component that it is being removed.
2704    /// Call `remove` on the component to mark it as removed. It's up to the implementation
2705    /// to define what is does on the act of removal. Basic implementation of `Component`
2706    /// will switch it to inactive state and it cannot be activated again.
2707    ///
2708    /// Calls the openDAQ C function `daqRemovable_remove()`.
2709    pub fn remove(&self) -> Result<()> {
2710        let __code = unsafe { (crate::sys::api().daqRemovable_remove)(self.as_raw() as *mut _) };
2711        check(__code, "daqRemovable_remove")?;
2712        Ok(())
2713    }
2714
2715}
2716
2717impl Signal {
2718    /// Gets the list of connections to input ports formed by the signal.
2719    ///
2720    /// # Returns
2721    /// - `connections`: The list of connections.
2722    ///
2723    /// Calls the openDAQ C function `daqSignal_getConnections()`.
2724    pub fn connections(&self) -> Result<Vec<Connection>> {
2725        let mut __connections: *mut sys::daqList = std::ptr::null_mut();
2726        let __code = unsafe { (crate::sys::api().daqSignal_getConnections)(self.as_raw() as *mut _, &mut __connections) };
2727        check(__code, "daqSignal_getConnections")?;
2728        Ok(unsafe { crate::marshal::take_list::<Connection>(__connections as *mut _, "daqSignal_getConnections") }?)
2729    }
2730
2731    /// Gets the signal's data descriptor.
2732    ///
2733    /// # Returns
2734    /// - `descriptor`: The signal's data descriptor. The descriptor contains metadata about the signal, providing information about its name, description,... and defines how the data in it's packet's buffers should be interpreted.
2735    ///
2736    /// Calls the openDAQ C function `daqSignal_getDescriptor()`.
2737    pub fn descriptor(&self) -> Result<Option<DataDescriptor>> {
2738        let mut __descriptor: *mut sys::daqDataDescriptor = std::ptr::null_mut();
2739        let __code = unsafe { (crate::sys::api().daqSignal_getDescriptor)(self.as_raw() as *mut _, &mut __descriptor) };
2740        check(__code, "daqSignal_getDescriptor")?;
2741        Ok(unsafe { crate::marshal::take_object::<DataDescriptor>(__descriptor as *mut _) })
2742    }
2743
2744    /// Gets the signal that carries its domain data.
2745    ///
2746    /// # Returns
2747    /// - `signal`: The domain signal. The domain signal contains domain (most often time) data that is used to interpret a signal's data in a given domain. It has the same sampling rate as the signal.
2748    ///
2749    /// Calls the openDAQ C function `daqSignal_getDomainSignal()`.
2750    pub fn domain_signal(&self) -> Result<Option<Signal>> {
2751        let mut __signal: *mut sys::daqSignal = std::ptr::null_mut();
2752        let __code = unsafe { (crate::sys::api().daqSignal_getDomainSignal)(self.as_raw() as *mut _, &mut __signal) };
2753        check(__code, "daqSignal_getDomainSignal")?;
2754        Ok(unsafe { crate::marshal::take_object::<Signal>(__signal as *mut _) })
2755    }
2756
2757    /// Gets the signal last value.
2758    ///
2759    /// # Returns
2760    /// - `value`: The IBaseObject value can be a nullptr if there is no value, or if the data type is not supported by the function. If a value is assigned, it can be cast based on the signal description to IFloat if the type is Float32 or Float64, to IInteger if the type is Int8 through Int64 or UInt8 through UInt64, to IComplexNumber if the type is ComplexFloat32 or ComplexFloat64, to IRange if the type is RangeInt64, to IString if the type is String, to IStruct if the type is Struct, and to IList of the forementioned types if there is exactly one dimension. For String type signals in binary data packets, the string data must be encoded as UTF-8 strings. The string length is determined by the sample size, and the string does not need to be null-terminated. The method extracts the string value from the packet data and returns it as an IString object.
2761    ///
2762    /// Calls the openDAQ C function `daqSignal_getLastValue()`.
2763    pub fn last_value(&self) -> Result<Value> {
2764        let mut __value: *mut sys::daqBaseObject = std::ptr::null_mut();
2765        let __code = unsafe { (crate::sys::api().daqSignal_getLastValue)(self.as_raw() as *mut _, &mut __value) };
2766        check(__code, "daqSignal_getLastValue")?;
2767        Ok(unsafe { crate::value::take_value(__value, "daqSignal_getLastValue") }?)
2768    }
2769
2770    /// Returns true if the signal is public; false otherwise.
2771    ///
2772    /// # Returns
2773    /// - `is_public`: True if the signal is public; false otherwise. Public signals are visible to clients connected to the device, and are streamed.
2774    ///
2775    /// Calls the openDAQ C function `daqSignal_getPublic()`.
2776    pub fn public(&self) -> Result<bool> {
2777        let mut __is_public: u8 = 0;
2778        let __code = unsafe { (crate::sys::api().daqSignal_getPublic)(self.as_raw() as *mut _, &mut __is_public) };
2779        check(__code, "daqSignal_getPublic")?;
2780        Ok(__is_public != 0)
2781    }
2782
2783    /// Gets a list of related signals.
2784    ///
2785    /// # Returns
2786    /// - `signals`: The list of related signals. Signals within the related signals list are facilitate the interpretation of a given signal's data, or are otherwise relevant when working with the signal.
2787    ///
2788    /// Calls the openDAQ C function `daqSignal_getRelatedSignals()`.
2789    pub fn related_signals(&self) -> Result<Vec<Signal>> {
2790        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
2791        let __code = unsafe { (crate::sys::api().daqSignal_getRelatedSignals)(self.as_raw() as *mut _, &mut __signals) };
2792        check(__code, "daqSignal_getRelatedSignals")?;
2793        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqSignal_getRelatedSignals") }?)
2794    }
2795
2796    /// Returns true if the signal is streamed; false otherwise.
2797    ///
2798    /// # Returns
2799    /// - `streamed`: True if the signal is streamed; false otherwise. A streamed signal receives packets from a streaming server and forwards packets on the signal path. Method always sets `streamed` parameter to False if the signal is local to the current Instance.
2800    ///
2801    /// Calls the openDAQ C function `daqSignal_getStreamed()`.
2802    pub fn streamed(&self) -> Result<bool> {
2803        let mut __streamed: u8 = 0;
2804        let __code = unsafe { (crate::sys::api().daqSignal_getStreamed)(self.as_raw() as *mut _, &mut __streamed) };
2805        check(__code, "daqSignal_getStreamed")?;
2806        Ok(__streamed != 0)
2807    }
2808
2809    /// Sets the signal to be either public or private.
2810    ///
2811    /// # Parameters
2812    /// - `is_public`: If false, the signal is set to private; if true, the signal is set to be public. Public signals are visible to clients connected to the device, and are streamed.
2813    ///
2814    /// Calls the openDAQ C function `daqSignal_setPublic()`.
2815    pub fn set_public(&self, is_public: bool) -> Result<()> {
2816        let __code = unsafe { (crate::sys::api().daqSignal_setPublic)(self.as_raw() as *mut _, u8::from(is_public)) };
2817        check(__code, "daqSignal_setPublic")?;
2818        Ok(())
2819    }
2820
2821    /// Sets the signal to be either streamed or not.
2822    ///
2823    /// # Parameters
2824    /// - `streamed`: The new streamed state of the signal. A streamed signal receives packets from a streaming server and forwards packets on the signal path. Setting the "Streamed" flag has no effect if the signal is local to the current Instance. Method returns OPENDAQ_IGNORED if that is the case.
2825    ///
2826    /// Calls the openDAQ C function `daqSignal_setStreamed()`.
2827    pub fn set_streamed(&self, streamed: bool) -> Result<()> {
2828        let __code = unsafe { (crate::sys::api().daqSignal_setStreamed)(self.as_raw() as *mut _, u8::from(streamed)) };
2829        check(__code, "daqSignal_setStreamed")?;
2830        Ok(())
2831    }
2832
2833}
2834
2835impl TagsPrivate {
2836    /// Adds a new tag to the list.
2837    ///
2838    /// # Parameters
2839    /// - `name`: The name of the tag to be added.
2840    ///
2841    /// # Errors
2842    /// - `OPENDAQ_IGNORED`: if a node with the `name` is already in the list of tags.
2843    ///
2844    /// Calls the openDAQ C function `daqTagsPrivate_add()`.
2845    pub fn add(&self, name: &str) -> Result<()> {
2846        let __name = crate::marshal::make_string(name)?;
2847        let __code = unsafe { (crate::sys::api().daqTagsPrivate_add)(self.as_raw() as *mut _, __name.as_ptr() as *mut _) };
2848        check(__code, "daqTagsPrivate_add")?;
2849        Ok(())
2850    }
2851
2852    /// Removes a new tag from the list.
2853    ///
2854    /// # Parameters
2855    /// - `name`: The name of the tag to be removed.
2856    ///
2857    /// # Errors
2858    /// - `OPENDAQ_IGNORED`: if a node with the `name` is not in the list of tags.
2859    ///
2860    /// Calls the openDAQ C function `daqTagsPrivate_remove()`.
2861    pub fn remove(&self, name: &str) -> Result<()> {
2862        let __name = crate::marshal::make_string(name)?;
2863        let __code = unsafe { (crate::sys::api().daqTagsPrivate_remove)(self.as_raw() as *mut _, __name.as_ptr() as *mut _) };
2864        check(__code, "daqTagsPrivate_remove")?;
2865        Ok(())
2866    }
2867
2868    /// Replaces all tags.
2869    ///
2870    /// # Parameters
2871    /// - `tags`: The new list of tags.
2872    ///
2873    /// Calls the openDAQ C function `daqTagsPrivate_replace()`.
2874    pub fn replace(&self, tags: &[&str]) -> Result<()> {
2875        let __tags = crate::marshal::list_from_strs(tags)?;
2876        let __code = unsafe { (crate::sys::api().daqTagsPrivate_replace)(self.as_raw() as *mut _, __tags.as_ptr() as *mut _) };
2877        check(__code, "daqTagsPrivate_replace")?;
2878        Ok(())
2879    }
2880
2881}
2882
2883impl Tags {
2884    /// Checks whether a tag is present in the list of tags.
2885    ///
2886    /// # Parameters
2887    /// - `name`: The name of the tag being checked.
2888    ///
2889    /// # Returns
2890    /// - `value`: True if a tag is found; false otherwise.
2891    ///
2892    /// Calls the openDAQ C function `daqTags_contains()`.
2893    pub fn contains(&self, name: &str) -> Result<bool> {
2894        let __name = crate::marshal::make_string(name)?;
2895        let mut __value: u8 = 0;
2896        let __code = unsafe { (crate::sys::api().daqTags_contains)(self.as_raw() as *mut _, __name.as_ptr() as *mut _, &mut __value) };
2897        check(__code, "daqTags_contains")?;
2898        Ok(__value != 0)
2899    }
2900
2901    /// Calls the openDAQ C function `daqTags_createTags()`.
2902    pub fn new() -> Result<Tags> {
2903        let mut __obj: *mut sys::daqTags = std::ptr::null_mut();
2904        let __code = unsafe { (crate::sys::api().daqTags_createTags)(&mut __obj) };
2905        check(__code, "daqTags_createTags")?;
2906        Ok(unsafe { crate::marshal::require_object::<Tags>(__obj as *mut _, "daqTags_createTags") }?)
2907    }
2908
2909    /// Gets the list of all tags in the list.
2910    ///
2911    /// # Returns
2912    /// - `value`: The list of tag strings.
2913    ///
2914    /// Calls the openDAQ C function `daqTags_getList()`.
2915    pub fn list(&self) -> Result<Vec<String>> {
2916        let mut __value: *mut sys::daqList = std::ptr::null_mut();
2917        let __code = unsafe { (crate::sys::api().daqTags_getList)(self.as_raw() as *mut _, &mut __value) };
2918        check(__code, "daqTags_getList")?;
2919        Ok(unsafe { crate::marshal::take_list::<String>(__value as *mut _, "daqTags_getList") }?)
2920    }
2921
2922    /// Queries the list of tags, creating an EvalValue expression from the `query` string. Returns true if the list of tags matches the query, false otherwise.
2923    ///
2924    /// # Parameters
2925    /// - `query`: The query string. I.e. "tag1 || (tag2 && tag3)"
2926    ///
2927    /// # Returns
2928    /// - `value`: The result of the query
2929    ///
2930    /// Calls the openDAQ C function `daqTags_query()`.
2931    pub fn query(&self, query: &str) -> Result<bool> {
2932        let __query = crate::marshal::make_string(query)?;
2933        let mut __value: u8 = 0;
2934        let __code = unsafe { (crate::sys::api().daqTags_query)(self.as_raw() as *mut _, __query.as_ptr() as *mut _, &mut __value) };
2935        check(__code, "daqTags_query")?;
2936        Ok(__value != 0)
2937    }
2938
2939}
2940
2941impl UpdateParameters {
2942    /// @ingroup opendaq_update_parameters
2943    /// @addtogroup opendaq_update_parameters Factories
2944    ///
2945    /// Calls the openDAQ C function `daqUpdateParameters_createUpdateParameters()`.
2946    pub fn new() -> Result<UpdateParameters> {
2947        let mut __obj: *mut sys::daqUpdateParameters = std::ptr::null_mut();
2948        let __code = unsafe { (crate::sys::api().daqUpdateParameters_createUpdateParameters)(&mut __obj) };
2949        check(__code, "daqUpdateParameters_createUpdateParameters")?;
2950        Ok(unsafe { crate::marshal::require_object::<UpdateParameters>(__obj as *mut _, "daqUpdateParameters_createUpdateParameters") }?)
2951    }
2952
2953    /// Gets the device update options object that allows for specifying how a device and its subdevices are to be updated.
2954    ///
2955    /// # Parameters
2956    /// - `options`: The device update options object.
2957    ///
2958    /// Calls the openDAQ C function `daqUpdateParameters_getDeviceUpdateOptions()`.
2959    pub fn device_update_options(&self) -> Result<Option<DeviceUpdateOptions>> {
2960        let mut __options: *mut sys::daqDeviceUpdateOptions = std::ptr::null_mut();
2961        let __code = unsafe { (crate::sys::api().daqUpdateParameters_getDeviceUpdateOptions)(self.as_raw() as *mut _, &mut __options) };
2962        check(__code, "daqUpdateParameters_getDeviceUpdateOptions")?;
2963        Ok(unsafe { crate::marshal::take_object::<DeviceUpdateOptions>(__options as *mut _) })
2964    }
2965
2966    /// Sets the device update options object that allows for specifying how a device and its subdevices are to be updated.
2967    ///
2968    /// # Parameters
2969    /// - `options`: The device update options object.
2970    ///
2971    /// Calls the openDAQ C function `daqUpdateParameters_setDeviceUpdateOptions()`.
2972    pub fn set_device_update_options(&self, options: &DeviceUpdateOptions) -> Result<()> {
2973        let __code = unsafe { (crate::sys::api().daqUpdateParameters_setDeviceUpdateOptions)(self.as_raw() as *mut _, options.as_raw() as *mut _) };
2974        check(__code, "daqUpdateParameters_setDeviceUpdateOptions")?;
2975        Ok(())
2976    }
2977
2978}
2979