/// <summary>
        /// The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method.
        /// </summary>
        /// <remarks>
        /// This function takes care of doing the lookups and getting the important information put together to call the Step() function.
        /// That includes pulling out the user's contextData and updating it after the call is made.  We use a sorted list for this so
        /// binary searches can be done to find the data.
        /// </remarks>
        /// <param name="context">A raw context pointer</param>
        /// <param name="nArgs">Number of arguments passed in</param>
        /// <param name="argsptr">A pointer to the array of arguments</param>
        internal void StepCallback(IntPtr context, int nArgs, IntPtr argsptr)
        {
            long          nAux;
            AggregateData data;

            nAux = (long)_base.AggregateContext(context);
            if (_contextDataList.TryGetValue(nAux, out data) == false)
            {
                data = new AggregateData();
                _contextDataList[nAux] = data;
            }

            try
            {
                _context = context;
                Step(ConvertParams(nArgs, argsptr), data._count, ref data._data);
            }
            finally
            {
                data._count++;
            }
        }
Example #2
0
        /// <summary>
        /// The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method.
        /// </summary>
        /// <remarks>
        /// This function takes care of doing the lookups and getting the important information put together to call the Step() function.
        /// That includes pulling out the user's contextData and updating it after the call is made.  We use a sorted list for this so
        /// binary searches can be done to find the data.
        /// </remarks>
        /// <param name="context">A raw context pointer</param>
        /// <param name="nArgs">Number of arguments passed in</param>
        /// <param name="argsptr">A pointer to the array of arguments</param>
        internal void StepCallback(SqliteContextHandle context, int nArgs, SqliteValueHandle[] argsptr)
        {
            SqliteValueHandle nAux;
            AggregateData     data;

            nAux = (SqliteValueHandle)_base.AggregateContext(context);
            if (_contextDataList.TryGetValue(nAux, out data) == false)
            {
                data = new AggregateData();
                _contextDataList[nAux] = data;
            }

            try
            {
                _context = context;
                Step(ConvertParams(nArgs, argsptr), data._count, ref data._data);
            }
            finally
            {
                data._count++;
            }
        }