Skip to content

T_CodeJam_PerfTests_CompetitionMetadataAttribute

andrewvk edited this page Nov 8, 2016 · 2 revisions

CompetitionMetadataAttribute Class

Attribute for benchmark classes that stores competition limits as embedded xml resource.

Inheritance Hierarchy

System.Object
  System.Attribute
    CodeJam.PerfTests.CompetitionMetadataAttribute
Namespace: CodeJam.PerfTests
Assembly: CodeJam.PerfTests (in CodeJam.PerfTests.dll) Version: 1.1.0.0 (1.1.0.0)

Syntax

C#

public class CompetitionMetadataAttribute : Attribute

VB

Public Class CompetitionMetadataAttribute
	Inherits Attribute

F#

type CompetitionMetadataAttribute =  
    class
        inherit Attribute
    end

The CompetitionMetadataAttribute type exposes the following members.

Constructors

 

Name Description
Public method CompetitionMetadataAttribute Constructor for competition metadata attribute.
  Back to Top

Properties

 

Name Description
Public property MetadataResourceName The name of the resource containing xml document with competition limits. If not set then path to the resource should be same as path to the source file (resource's extension should be '.xml').
Public property MetadataResourcePath The relative path to the resource containing xml document with competition limits.
Public property TypeId When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute.)
Public property UseFullTypeName Use full type name in XML annotations.
  Back to Top

Methods

 

Name Description
Public method Equals Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Returns the hash code for this instance. (Inherited from Attribute.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method IsDefaultAttribute When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute.)
Public method Match When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
  Back to Top

Remarks

In case the MetadataResourcePath is not set: Let's say there's benchmark class with full type name 'MyNamespace.MyBenchmark' and it's located at

%project_root%\Some Dir\AnotherDir\Benchmarks.cs

. The default namespace for the project is 'MyAmazingNamespace'. So, the resource containing competition limits should be located at

%project_root%\Some Dir\AnotherDir\Benchmarks.xml

. And the attribute should be declared as

[CompetitionMetadata("MyAmazingNamespace.Some_Dir.AnotherDir.Benchmarks.xml")]

Note that all non-alphanumeric symbols are replaced with '_'.

See Also

Reference

CodeJam.PerfTests Namespace

Clone this wiki locally