예제 #1
0
        /**
         * バッファに積まれたログの件数を取得する
         * @output : バッファに積まれたログ件数
         */
        public int GetLogNum()
        {
            int num = 0;

            for (int i = 0; i < blockMax; i++)
            {
                LogBlock block = blocks[writeBufferNo, i];

                if (block != null)
                {
                    for (int j = 0; j < blockSize; j++)
                    {
                        if (block.logs[j] != null)
                        {
                            num++;
                        }
                    }
                }
            }

            return(num);
        }
예제 #2
0
        // for Debug
        public void DebugPrint()
        {
            if (blocks == null)
            {
                return;
            }

            for (int j = 0; j < blockMax; j++)
            {
                LogBlock block = blocks[currentBufferNo, j];

                if (block != null)
                {
                    for (int k = 0; k < blockSize; k++)
                    {
                        if (block.logs[k] != null)
                        {
                            Console.WriteLine("[{0}][{1}][{2}] {3}", currentBufferNo, j, k, block.logs[k].ToString());
                        }
                    }
                }
            }
        }