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;
        }
Exemplo n.º 2
0
 public ArrayParamCodeTypeHolderMarshalIn(ParamCodeTypeHolderMarshalIn owner)
     : base(owner.CodeTypeFactory)
 {
     this.owner = owner;
 }
Exemplo n.º 3
0
        /// <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 };
        }
Exemplo n.º 4
0
 protected static void SetExpressionBuilder(ParamCodeTypeHolderMarshalIn owner, IWriteExpressionBuilder exprbuilder)
 {
     owner.exprbuilder = exprbuilder;
 }
Exemplo n.º 5
0
 /// <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;
 }
Exemplo n.º 6
0
 public ValueArrayParamCodeTypeHolderMarshalIn(ParamCodeTypeHolderMarshalIn owner)
     : base(owner)
 {
 }