コード例 #1
0
        public Provider(
            LocatedRef <string> name,
            LocatedVal <Guid> id,
            LocatedRef <string> symbol)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (symbol == null)
            {
                throw new ArgumentNullException(nameof(symbol));
            }

            Name   = name;
            Id     = id;
            Symbol = symbol;

            Channels     = new ChannelCollection(this);
            Levels       = new LevelCollection(this);
            Opcodes      = new OpcodeCollection(this);
            Tasks        = new TaskCollection(this);
            Keywords     = new KeywordCollection(this);
            Maps         = new MapCollection(this);
            NamedQueries = new PatternMapCollection(this);
            Filters      = new FilterCollection(this);
            Templates    = new TemplateCollection(this);
            Events       = new EventCollection(this);
        }
コード例 #2
0
ファイル: Keyword.cs プロジェクト: maxgolov/event-trace-kit
 public Keyword(LocatedRef <QName> name, LocatedVal <ulong> mask,
                LocatedRef <string> symbol, LocalizedString message)
     : this(name, mask)
 {
     Symbol  = symbol;
     Message = message;
 }
コード例 #3
0
 public BitMapItem(
     BitMap map, LocatedVal <uint> value, LocatedRef <string> symbol,
     LocalizedString message)
     : base(value, message, symbol)
 {
     this.map = map ?? throw new ArgumentNullException(nameof(map));
 }
コード例 #4
0
 public static void ReportError <T, TProperty>(
     T entity,
     LocatedRef <TProperty> value,
     IDiagnostics diags,
     IUniqueConstraint <T> constraint) where TProperty : class
 {
     diags.ReportError(value.Location, constraint.FormatMessage(entity));
 }
コード例 #5
0
 public Opcode(
     LocatedRef <QName> name, LocatedVal <byte> value,
     LocatedRef <string> symbol, LocalizedString message)
     : this(name, value)
 {
     Symbol  = symbol;
     Message = message;
 }
コード例 #6
0
 public Level(LocatedRef <QName> name, LocatedVal <byte> value)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     Name  = name;
     Value = value;
 }
コード例 #7
0
ファイル: Template.cs プロジェクト: maxgolov/event-trace-kit
 public Template(LocatedRef <string> id)
 {
     if (id == null)
     {
         throw new ArgumentNullException(nameof(id));
     }
     Id         = id;
     Properties = new PropertyCollection();
 }
コード例 #8
0
ファイル: Channel.cs プロジェクト: maxgolov/event-trace-kit
 public Channel(LocatedRef <string> name, LocatedVal <ChannelType> type)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     Name = name;
     Type = type;
 }
コード例 #9
0
 public Provider(
     LocatedRef <string> name,
     LocatedVal <Guid> id,
     LocatedRef <string> symbol,
     LocalizedString message)
     : this(name, id, symbol)
 {
     Message = message;
 }
コード例 #10
0
ファイル: Keyword.cs プロジェクト: maxgolov/event-trace-kit
 public Keyword(LocatedRef <QName> name, LocatedVal <ulong> mask)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     Name = name;
     Mask = mask;
 }
コード例 #11
0
        public void Constructor()
        {
            var value    = new X();
            var location = new SourceLocation("z:\\foo", 23, 42);

            var located = new LocatedRef <X>(value, location);

            Assert.Equal(value, located.Value);
            Assert.Equal(location, located.Location);
        }
コード例 #12
0
ファイル: Task.cs プロジェクト: maxgolov/event-trace-kit
 public Task(
     LocatedRef <QName> name, LocatedVal <ushort> value,
     LocatedRef <string> symbol, LocatedNullable <Guid> guid,
     LocalizedString message)
     : this(name, value)
 {
     Symbol  = symbol;
     Guid    = guid;
     Message = message;
 }
コード例 #13
0
ファイル: Filter.cs プロジェクト: maxgolov/event-trace-kit
 public Filter(
     LocatedRef <QName> name,
     LocatedVal <byte> value,
     LocatedVal <byte> version,
     LocatedRef <string> symbol,
     LocalizedString message)
     : this(name, value, version)
 {
     Symbol  = symbol;
     Message = message;
 }
コード例 #14
0
        public void ImplicitConversion()
        {
            var value = new X();

            X convertedValue            = new LocatedRef <X>(value, new SourceLocation());
            LocatedRef <X> convertedRef = convertedValue;

            Assert.Same(value, convertedValue);
            Assert.Same(value, convertedRef.Value);
            Assert.Null(convertedRef.Location);
        }
コード例 #15
0
ファイル: Filter.cs プロジェクト: maxgolov/event-trace-kit
 public Filter(
     LocatedRef <QName> name,
     LocatedVal <byte> value,
     LocatedVal <byte> version)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     Name    = name;
     Value   = value;
     Version = version;
 }
コード例 #16
0
        public void Equatable()
        {
            var sameValue     = new EquatableX(1);
            var equalValue    = new EquatableX(1);
            var notEqualValue = new EquatableX(3);
            var location      = new SourceLocation("a", 1, 1);
            var otherLocation = new SourceLocation("b", 2, 2);

            var located = new LocatedRef <EquatableX>(sameValue, location);

            var same     = new LocatedRef <EquatableX>(sameValue);
            var equal    = new LocatedRef <EquatableX>(equalValue);
            var notEqual = new LocatedRef <EquatableX>(notEqualValue);

            var sameWithLoc     = new LocatedRef <EquatableX>(sameValue, otherLocation);
            var equalWithLoc    = new LocatedRef <EquatableX>(equalValue, otherLocation);
            var notEqualWithLoc = new LocatedRef <EquatableX>(notEqualValue, otherLocation);

            Assert.True(located.Equals(located));
            Assert.True(located.Equals(same));
            Assert.True(located.Equals(equal));
            Assert.False(located.Equals(notEqual));

            Assert.True(located.Equals(sameWithLoc));
            Assert.True(located.Equals(equalWithLoc));
            Assert.False(located.Equals(notEqualWithLoc));

            Assert.True(located.Equals((object)same));
            Assert.True(located.Equals((object)equal));
            Assert.False(located.Equals((object)notEqual));

            Assert.True(located.Equals((object)sameWithLoc));
            Assert.True(located.Equals((object)equalWithLoc));
            Assert.False(located.Equals((object)notEqualWithLoc));

            Assert.True(located.Equals(sameValue));
            Assert.True(located.Equals(equalValue));
            Assert.False(located.Equals(notEqualValue));

            Assert.True(located.Equals((object)sameValue));
            Assert.True(located.Equals((object)equalValue));
            Assert.False(located.Equals((object)notEqualValue));

            Assert.True(located.Equals((object)sameValue.Value));
            Assert.True(located.Equals((object)equalValue.Value));
            Assert.False(located.Equals((object)notEqualValue.Value));
        }
コード例 #17
0
        public void Comparable()
        {
            var sameValue     = new ComparableX(10);
            var equalValue    = new ComparableX(10);
            var smallerValue  = new ComparableX(9);
            var largerValue   = new ComparableX(11);
            var location      = new SourceLocation("a", 1, 1);
            var otherLocation = new SourceLocation("b", 2, 2);

            var located = new LocatedRef <ComparableX>(sameValue, location);

            var same    = new LocatedRef <ComparableX>(sameValue);
            var equal   = new LocatedRef <ComparableX>(equalValue);
            var smaller = new LocatedRef <ComparableX>(smallerValue);
            var larger  = new LocatedRef <ComparableX>(largerValue);

            var sameWithLoc    = new LocatedRef <ComparableX>(sameValue, otherLocation);
            var equalWithLoc   = new LocatedRef <ComparableX>(equalValue, otherLocation);
            var smallerWithLoc = new LocatedRef <ComparableX>(smallerValue, otherLocation);
            var largerWithLoc  = new LocatedRef <ComparableX>(largerValue, otherLocation);

            Assert.Equal(0, located.CompareTo(located));
            Assert.Equal(0, located.CompareTo(same));
            Assert.Equal(0, located.CompareTo(equal));
            Assert.Equal(1, located.CompareTo(smaller));
            Assert.Equal(-1, located.CompareTo(larger));

            Assert.Equal(0, located.CompareTo(sameWithLoc));
            Assert.Equal(0, located.CompareTo(equalWithLoc));
            Assert.Equal(1, located.CompareTo(smallerWithLoc));
            Assert.Equal(-1, located.CompareTo(largerWithLoc));

            Assert.Equal(0, located.CompareTo(sameValue));
            Assert.Equal(0, located.CompareTo(equalValue));
            Assert.Equal(1, located.CompareTo(smallerValue));
            Assert.Equal(-1, located.CompareTo(largerValue));
        }
コード例 #18
0
 public PatternMapItem(PatternMap map, LocatedRef <string> name, LocatedRef <string> value)
 {
     Map   = map ?? throw new ArgumentNullException(nameof(map));
     Name  = name ?? throw new ArgumentNullException(nameof(name));
     Value = value;
 }
コード例 #19
0
ファイル: Map.cs プロジェクト: maxgolov/event-trace-kit
 protected Map(LocatedRef <string> name, LocatedRef <string> symbol)
     : this(name)
 {
     Symbol = symbol;
 }
コード例 #20
0
ファイル: Task.cs プロジェクト: maxgolov/event-trace-kit
 public Task(LocatedRef <QName> name, LocatedVal <ushort> value)
 {
     Name  = name ?? throw new ArgumentNullException(nameof(name));
     Value = value;
 }
コード例 #21
0
 public BitMap(LocatedRef <string> name)
     : base(name)
 {
 }
コード例 #22
0
 protected MapItem(LocatedVal <uint> value, LocalizedString message,
                   LocatedRef <string> symbol)
     : this(value, message)
 {
     Symbol = symbol;
 }
コード例 #23
0
 protected Property(LocatedRef <string> name)
 {
     Name = name ?? throw new ArgumentNullException(nameof(name));
 }
コード例 #24
0
 public Opcode(LocatedRef <QName> name, LocatedVal <byte> value)
 {
     Name  = name ?? throw new ArgumentNullException(nameof(name));
     Value = value;
 }
コード例 #25
0
 public PatternMap(
     LocatedRef <string> name, LocatedRef <string> format, LocatedRef <string> symbol)
     : this(name, format)
 {
     Symbol = symbol;
 }
コード例 #26
0
 public ValueMap(LocatedRef <string> name)
     : base(name)
 {
 }
コード例 #27
0
 public StructProperty(LocatedRef <string> name)
     : base(name)
 {
 }
コード例 #28
0
 public DataProperty(LocatedRef <string> name, InType inType)
     : base(name)
 {
     InType = inType ?? throw new ArgumentNullException(nameof(inType));
 }
コード例 #29
0
 public PatternMap(LocatedRef <string> name, LocatedRef <string> format)
 {
     Name   = name ?? throw new ArgumentNullException(nameof(name));
     Format = format ?? throw new ArgumentNullException(nameof(format));
 }
コード例 #30
0
 public ValueMap(LocatedRef <string> name, LocatedRef <string> symbol)
     : base(name, symbol)
 {
 }