コード例 #1
0
        public virtual void MakeInArgument(CodeTypeFactory codetypefactoryIn
            , string idlMethodName
            , ref int nInArgCounter
            , Udbus.Parsing.BuildContext context
            , ref CodeThrowExceptionStatement throwargInPrev
            , IDLMethodArgument idlMethodArg
            , Udbus.Parsing.IDLArgumentTypeNameBuilderBase nameBuilder
            , ref ParamCodeTypeHolderMarshalBase paramtypeHolder
            , ref CodeTypeReference typerefParam
            , out CodeConditionStatement condVarResult)
        {
            marshal.inward.ParamCodeTypeHolderMarshalIn paramtypeHolderIn = new marshal.inward.ParamCodeTypeHolderMarshalIn(codetypefactoryIn);
            Udbus.Parsing.CodeBuilderHelper.BuildCodeParamType(paramtypeHolderIn, nameBuilder, idlMethodArg.Type, context);
            paramtypeHolder = paramtypeHolderIn;
            /*typerefParamIter = */
            typerefParam = paramtypeHolder.paramtype.CodeType;

            condVarResult = new CodeConditionStatement(
                // * if (this.result == 0)
                exprResultOk
                , new CodeStatement[] // True statements
                {
                    // * this.result = builder.Marshal<arg_type>(<marshal_function>, <arg_name>);
                    new CodeAssignStatement(fieldrefResult,
                        paramtypeHolderIn.BuildWriteExpression(varrefBuilder,
                            MarshalArgument(idlMethodName, idlMethodArg)))
                }
                , new CodeStatement[] // False statements
                {
                    throwargInPrev
                }
                );

            throwargInPrev = new CodeThrowExceptionStatement(
                new CodeMethodInvokeExpression(MarshalBuilderHelper.typerefexprArgumentInException, "Create",
                    new CodePrimitiveExpression(nInArgCounter + 1),
                    new CodePrimitiveExpression(idlMethodArg.Name),
                    new CodeTypeOfExpression(typerefParam),
                    fieldrefResult,
                    new CodePrimitiveExpression(idlMethodName),
                    fieldrefConnectionParameters
                )
            );

            ++nInArgCounter;
        }
コード例 #2
0
ファイル: In.cs プロジェクト: rneilturner/win-tools
 public ArrayParamCodeTypeHolderMarshalIn(ParamCodeTypeHolderMarshalIn owner)
     : base(owner.CodeTypeFactory)
 {
     this.owner = owner;
 }
コード例 #3
0
ファイル: In.cs プロジェクト: rneilturner/win-tools
        /// <summary>
        /// Set the reference type for the marshalling method.
        /// </summary>
        /// <param name="typeMethod">Type being marshalled</param>
        protected static void SetMethodType(ParamCodeTypeHolderMarshalIn owner, CodeTypeReference typeMethod)
        {
            if (owner.methodTypes != null)
            {
                // Runtime error.
            }

            owner.methodTypes = new CodeTypeReference[] { typeMethod };
        }
コード例 #4
0
ファイル: In.cs プロジェクト: rneilturner/win-tools
 protected static void SetExpressionBuilder(ParamCodeTypeHolderMarshalIn owner, IWriteExpressionBuilder exprbuilder)
 {
     owner.exprbuilder = exprbuilder;
 }
コード例 #5
0
ファイル: In.cs プロジェクト: rneilturner/win-tools
 /// <summary>
 /// Remove reference type for the marshalling method.
 /// </summary>
 /// <param name="owner"></param>
 /// <param name="typeMethod"></param>
 protected static void ClearMethodType(ParamCodeTypeHolderMarshalIn owner)
 {
     owner.methodTypes = null;
 }
コード例 #6
0
ファイル: In.cs プロジェクト: rneilturner/win-tools
 public ValueArrayParamCodeTypeHolderMarshalIn(ParamCodeTypeHolderMarshalIn owner)
     : base(owner)
 {
 }