public RppMethodInfo([NotNull] string name, [NotNull] RType declaringType, RMethodAttributes attributes, [CanBeNull] RType returnType, [NotNull] RppParameterInfo[] parameters) { Name = name; DeclaringType = declaringType; Attributes = attributes; ReturnType = returnType; Parameters = parameters; }
public static MethodAttributes GetMethodAttributes(RMethodAttributes rAttributes, bool constructor) { MethodAttributes attrs = MethodAttributes.Public; if (rAttributes.HasFlag(RMethodAttributes.Private)) { attrs = MethodAttributes.Private; } if (rAttributes.HasFlag(RMethodAttributes.Protected)) { attrs = MethodAttributes.Family; } // always virtual, even for statics but not for property accessors :) if (!constructor && !rAttributes.HasFlag(RMethodAttributes.Final)) { attrs |= MethodAttributes.Virtual; } attrs |= MethodAttributes.HideBySig; if (!rAttributes.HasFlag(RMethodAttributes.Override)) { if (!constructor && !rAttributes.HasFlag(RMethodAttributes.Final)) { attrs |= MethodAttributes.NewSlot; } } if (rAttributes.HasFlag(RMethodAttributes.Abstract)) { attrs |= MethodAttributes.Abstract; } return attrs; }
private static string ToString(RMethodAttributes attrs) { List<string> res = new List<string>(); _attrToStr.Aggregate(res, (list, tuple) => { if (attrs.HasFlag(tuple.Item1)) { list.Add(tuple.Item2); } return list; }); return string.Join(" ", res); }
public RppMethodInfo DefineConstructor(RMethodAttributes attributes, RppParameterInfo[] parameterTypes) { RppMethodInfo constructor = new RppMethodInfo("ctor", this, attributes, UnitTy, parameterTypes); _constructors.Add(constructor); return constructor; }
public RppMethodInfo DefineConstructor(RMethodAttributes attributes) { return DefineConstructor(attributes, new RppParameterInfo[0]); }
public RppMethodInfo DefineMethod([NotNull] string name, RMethodAttributes attributes, [CanBeNull] RType returnType, [NotNull] RppParameterInfo[] parameterTypes, [NotNull] RppGenericParameter[] genericParameters) { RppMethodInfo method = new RppMethodInfo(name, this, attributes, returnType, parameterTypes); if (name == "ctor") { _constructors.Add(method); } else { _methods.Add(method); } return method; }
public RppMethodInfo DefineMethod([NotNull] string name, RMethodAttributes attributes, [CanBeNull] RType returnType, [NotNull] RppParameterInfo[] parameterTypes) { return DefineMethod(name, attributes, returnType, parameterTypes, new RppGenericParameter[0]); }
public RppMethodInfo DefineMethod([NotNull] string name, RMethodAttributes attributes) { return DefineMethod(name, attributes, null, new RppParameterInfo[0]); }