Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
StorageQualifier.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 
5 namespace SiliconStudio.Shaders.Ast
6 {
7  /// <summary>
8  /// A Storage qualifier.
9  /// </summary>
10  public class StorageQualifier : Qualifier
11  {
12  #region Constants and Fields
13 
14  /// <summary>
15  /// Const qualifier.
16  /// </summary>
17  public static readonly StorageQualifier Const = new StorageQualifier("const");
18 
19  /// <summary>
20  /// Uniform qualifier.
21  /// </summary>
22  public static readonly StorageQualifier Uniform = new StorageQualifier("uniform");
23 
24  /// <summary>
25  /// Internal map used for parsing.
26  /// </summary>
27  private static readonly StringEnumMap Map = PrepareParsing<StorageQualifier>();
28 
29  #endregion
30 
31  #region Constructors and Destructors
32 
33  /// <summary>
34  /// Initializes a new instance of the <see cref = "StorageQualifier" /> class.
35  /// </summary>
37  {
38  }
39 
40  /// <summary>
41  /// Initializes a new instance of the <see cref="StorageQualifier"/> class.
42  /// </summary>
43  /// <param name="key">
44  /// Name of the enum.
45  /// </param>
46  public StorageQualifier(object key) : base(key)
47  {
48  }
49 
50  #endregion
51 
52  #region Public Methods
53 
54  /// <summary>
55  /// Parses the specified enum name.
56  /// </summary>
57  /// <param name="enumName">
58  /// Name of the enum.
59  /// </param>
60  /// <returns>
61  /// A storage qualifier
62  /// </returns>
63  public static StorageQualifier Parse(string enumName)
64  {
65  return Map.ParseEnumFromName<StorageQualifier>(enumName);
66  }
67 
68  #endregion
69 
70  #region Operators
71 
72  /// <summary>
73  /// Implements the operator ==.
74  /// </summary>
75  /// <param name = "left">The left.</param>
76  /// <param name = "right">The right.</param>
77  /// <returns>
78  /// The result of the operator.
79  /// </returns>
80  public static StorageQualifier operator &(StorageQualifier left, StorageQualifier right)
81  {
82  return OperatorAnd(left, right);
83  }
84 
85  /// <summary>
86  /// Implements the operator |.
87  /// </summary>
88  /// <param name = "left">The left.</param>
89  /// <param name = "right">The right.</param>
90  /// <returns>
91  /// The result of the operator.
92  /// </returns>
93  public static StorageQualifier operator |(StorageQualifier left, StorageQualifier right)
94  {
95  return OperatorOr(left, right);
96  }
97 
98  /// <summary>
99  /// Implements the operator ^.
100  /// </summary>
101  /// <param name = "left">The left.</param>
102  /// <param name = "right">The right.</param>
103  /// <returns>
104  /// The result of the operator.
105  /// </returns>
106  public static StorageQualifier operator ^(StorageQualifier left, StorageQualifier right)
107  {
108  return OperatorXor(left, right);
109  }
110 
111  #endregion
112  }
113 }
StorageQualifier()
Initializes a new instance of the StorageQualifier class.
Internal dictionary that provides conversion helper methods.
SiliconStudio.Shaders.Ast.StorageQualifier StorageQualifier
static StorageQualifier Parse(string enumName)
Parses the specified enum name.
StorageQualifier(object key)
Initializes a new instance of the StorageQualifier class.