Beispiel #1
0
        /// <summary>
        /// Gets the name of the result type differentiating promises from normal types. For promises it returns the type of the promised value instead of the promises type itself.
        /// </summary>
        protected string GetActualMethodReturnType(Type type, SerializeFlag flag)
        {
            if (!type.IsGenericType)
            {
                return(GetGenericTypeName(type, flag));
            }

            if (GrainInterfaceData.IsTaskType(type))
            {
                Type[] genericArguments = type.GetGenericArguments();
                if (genericArguments.Length == 1)
                {
                    return(GetGenericTypeName(genericArguments[0], flag));
                }

                var errorMsg = String.Format("Unexpected number of arguments {0} for generic type {1} used as a return type. Only Type<T> are supported as generic return types of grain methods.", genericArguments.Length, type);
                ConsoleText.WriteError(errorMsg);
                throw new ApplicationException(errorMsg);
            }

            return(GetGenericTypeName(type, flag));
        }
Beispiel #2
0
 public static extern int hb_buffer_serialize_glyphs(IntPtr buffer, int start, int end, IntPtr buf, int buf_size, out int buf_consumed, IntPtr font, SerializeFormat format, SerializeFlag flags);
Beispiel #3
0
 /// <summary>
 /// Get the name string for generic type
 /// </summary>
 private string GetGenericTypeName(Type type, SerializeFlag flag = SerializeFlag.NoSerialize, bool includeImpl = true)
 {
     return(GetGenericTypeName(type, RecordReferencedNamespaceAndAssembly,
                               t => flag != SerializeFlag.NoSerialize && IsDeclaredHere(type) && includeImpl));
 }
Beispiel #4
0
 protected CodeTypeReference GetReturnTypeReference(Type type, SerializeFlag flag)
 {
     return(type == typeof(void)
         ? new CodeTypeReference(typeof(void))
         : new CodeTypeReference(GetGenericTypeName(type, flag)));
 }
Beispiel #5
0
 /// <summary>
 /// Get the name string for generic type
 /// </summary>
 private string GetGenericTypeName(Type type, SerializeFlag flag = SerializeFlag.NoSerialize, bool includeImpl = true)
 {
     return GetGenericTypeName(type, RecordReferencedNamespaceAndAssembly,
         t => flag != SerializeFlag.NoSerialize && IsDeclaredHere(type) && includeImpl);
 }
Beispiel #6
0
 protected CodeTypeReference GetReturnTypeReference(Type type, SerializeFlag flag)
 {
     return type == typeof(void) 
         ? new CodeTypeReference(typeof(void)) 
         : new CodeTypeReference(GetGenericTypeName(type, flag));
 }
Beispiel #7
0
        /// <summary>
        /// Gets the name of the result type differentiating promises from normal types. For promises it returns the type of the promised value instead of the promises type itself.
        /// </summary>
        protected string GetActualMethodReturnType(Type type, SerializeFlag flag)
        {
            if (!type.IsGenericType)
                return GetGenericTypeName(type, flag);

            if (GrainInterfaceData.IsTaskType(type))
            {
                Type[] genericArguments = type.GetGenericArguments();
                if (genericArguments.Length == 1) 
                    return GetGenericTypeName(genericArguments[0], flag);

                var errorMsg = String.Format("Unexpected number of arguments {0} for generic type {1} used as a return type. Only Type<T> are supported as generic return types of grain methods.", genericArguments.Length, type);
                ReportError(errorMsg);
                throw new ApplicationException(errorMsg);
            }

            return GetGenericTypeName(type, flag);
        }
Beispiel #8
0
 public ReservedMethod(byte argCount, SerializeFlag serializeFlag, byte syncLevel, AcpiMethodImpl impl)
     : base(argCount, serializeFlag, syncLevel)
 {
     this.impl = impl;
 }
Beispiel #9
0
 public BytecodeMethod(byte argCount, SerializeFlag serializeFlag, byte syncLevel, byte[] unparsedTermList)
     : base(argCount, serializeFlag, syncLevel)
 {
     this.unparsedTermList = unparsedTermList;
     this.body             = null;
 }
Beispiel #10
0
 public Method(byte argCount, SerializeFlag serializeFlag, byte syncLevel)
 {
     this.argCount      = argCount;
     this.serializeFlag = serializeFlag;
     this.syncLevel     = syncLevel;
 }