forked from ThadHouse/MinimalNtCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPubSubOptions.cs
More file actions
29 lines (26 loc) · 796 Bytes
/
PubSubOptions.cs
File metadata and controls
29 lines (26 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
namespace MinimalNtCore
{
public struct PubSubOptions
{
public static PubSubOptions AllDefault { get; } = new PubSubOptions()
{
Periodic = 0.01,
SendAll = true,
KeepDuplicates = true,
};
public double Periodic { get; set; }
public bool SendAll { get; set; }
public bool KeepDuplicates { get; set; }
public unsafe NativePubSubOptions ToNative()
{
NativePubSubOptions native = new NativePubSubOptions
{
structSize = (uint)sizeof(NativePubSubOptions),
periodic = Periodic,
sendAll = SendAll ? 1 : 0,
keepDuplicates = KeepDuplicates ? 1 : 0
};
return native;
}
}
}