-
Notifications
You must be signed in to change notification settings - Fork 35
T_CodeJam_PerfTests_CompetitionMetadataAttribute
andrewvk edited this page Nov 8, 2016
·
2 revisions
Attribute for benchmark classes that stores competition limits as embedded xml resource.
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)
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.
Name | Description | |
---|---|---|
CompetitionMetadataAttribute | Constructor for competition metadata attribute. |
Name | Description | |
---|---|---|
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'). | |
MetadataResourcePath | The relative path to the resource containing xml document with competition limits. | |
TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute.) | |
UseFullTypeName | Use full type name in XML annotations. |
Name | Description | |
---|---|---|
Equals | Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Returns the hash code for this instance. (Inherited from Attribute.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
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.) | |
Match | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
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 '_'.