This commit is contained in:
2026-07-15 02:42:16 +03:00
parent be2a24bfd9
commit 3a1b95dbc5
27 changed files with 1767 additions and 197 deletions
+2
View File
@@ -209,12 +209,14 @@ public class EventDef : MemberDef
return DefinitionAttributeReader.Apply(ei, new EventDef()
{
Definition = schema,
Name = name,
ArgumentType = evtType,
Index = index,
Inherited = ei.DeclaringType != type,
Annotations = annotations,
EventInfo = ei,
MemberPolicyAttributes = Attribute.GetCustomAttributes(ei, true),
AutoDelivered = autoDeliveryAttr != null,
Historical = historicalAttr != null,
OrderingControl = orderingAttr?.Control ?? OrderingControl.Strict,
@@ -367,6 +367,7 @@ public class FunctionDef : MemberDef
return DefinitionAttributeReader.Apply(mi, new FunctionDef()
{
Definition = schema,
Name = name,
Index = index,
Inherited = mi.DeclaringType != type,
@@ -379,6 +380,7 @@ public class FunctionDef : MemberDef
Idempotent = mi.GetCustomAttribute<IdempotentAttribute>(true) != null,
Cancellable = mi.GetCustomAttribute<CancellableAttribute>(true) != null,
RatePolicyName = mi.GetCustomAttribute<RateControlAttribute>(true)?.PolicyName,
MemberPolicyAttributes = Attribute.GetCustomAttributes(mi, true),
StreamMode = streamMode,
Pausable = pausable,
});
+13
View File
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
namespace Esiur.Data.Types;
public class MemberDef
{
IReadOnlyList<Attribute> memberPolicyAttributes = Array.Empty<Attribute>();
// Core fields
public byte Index { get; set; }
@@ -24,6 +25,18 @@ public class MemberDef
/// </summary>
public string? RatePolicyName { get; set; }
/// <summary>
/// Local reflection attributes supplied to resource managers while this member
/// is evaluated. This execution metadata is not serialized to remote peers.
/// </summary>
public IReadOnlyList<Attribute> MemberPolicyAttributes
{
get => memberPolicyAttributes;
internal set => memberPolicyAttributes = value is null
? Array.Empty<Attribute>()
: Array.AsReadOnly(value.ToArray());
}
public TypeDef Definition { get; set; } = null!;
// Human-readable metadata
+6 -1
View File
@@ -312,12 +312,17 @@ public class PropertyDef : MemberDef
return DefinitionAttributeReader.Apply(pi, new PropertyDef()
{
Definition = typeDef,
Name = name,
Index = index,
Inherited = pi.DeclaringType != type,
ValueType = propType,
PropertyInfo = pi,
RatePolicyName = pi.GetCustomAttribute<RateControlAttribute>(true)?.PolicyName,
RatePolicyName = (Attribute.GetCustomAttribute(
pi,
typeof(RateControlAttribute),
true) as RateControlAttribute)?.PolicyName,
MemberPolicyAttributes = Attribute.GetCustomAttributes(pi, true),
ReadOnly = readOnlyAttr != null,
Volatile = volatileAttr != null,
Historical = historicalAttr != null,