コード例 #1
0
        public void RegisterAlgorithm(StreamingAlgorithm <T> alg)
        {
            lock (this)
            {
                if (alg is StreamingUserAlgorithm <T> )
                {
                    if (!agent.ApplyUserLevel(alg.Epsilon))
                    {
                        throw new Exception("PINQ access denied");
                    }
                }                 // otherwise, we will apply when we receive the data

                activeAlgorithms.Add(alg);
            }
        }
コード例 #2
0
        public void UnregisterAlgorithm(StreamingAlgorithm <T> alg)
        {
            lock (this)
            {
                if (alg is StreamingUserAlgorithm <T> )
                {
                    agent.UnapplyUserLevel(alg.Epsilon);
                }                 // otherwise, we will unapply after we receive the data

                if (processing)
                {
                    toRemove.Add(alg);
                }
                else
                {
                    activeAlgorithms.Remove(alg);
                }
            }
        }