mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 14:51:41 +01:00
24 lines
651 B
C#
24 lines
651 B
C#
|
using System.Diagnostics;
|
|||
|
|
|||
|
namespace CapnpC.CSharp.Generator.Model
|
|||
|
{
|
|||
|
class Constant : IDefinition
|
|||
|
{
|
|||
|
public ulong Id { get; }
|
|||
|
public bool IsGenerated { get; }
|
|||
|
public TypeTag Tag { get => TypeTag.Const; }
|
|||
|
public IHasNestedDefinitions DeclaringElement { get; }
|
|||
|
|
|||
|
public Value Value { get; set; }
|
|||
|
|
|||
|
public Constant(ulong id, IHasNestedDefinitions parent)
|
|||
|
{
|
|||
|
Trace.Assert(parent != null);
|
|||
|
Id = id;
|
|||
|
IsGenerated = (parent as IDefinition).IsGenerated;
|
|||
|
DeclaringElement = parent;
|
|||
|
parent.NestedDefinitions.Add(this);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|