亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? csink.cpp

?? 研讀AxCrypt對(duì)加解密的處理方法
?? CPP
字號(hào):
/*! \file
    \brief Implementation of AxPipe::CSink base class for sinks

    @(#) $Id: CSink.cpp,v 1.3 2004/02/02 12:10:47 svante Exp $

    AxPipe - Binary Stream Framework

    Copyright (C) 2003 Svante Seleborg/Axon Data, All rights reserved.

    This program is free software; you can redistribute it and/or modify it under the terms
    of the GNU General Public License as published by the Free Software Foundation;
    either version 2 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with this program;
    if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
    Boston, MA 02111-1307 USA

    The author may be reached at mailto:axpipe@axondata.se and http://axpipe.sourceforge.net

    Why is this framework released as GPL and not LGPL? See http://www.gnu.org/philosophy/why-not-lgpl.html

----
\verbatim
    CSink.cpp                       Implementation of CSink base class for sinks

    E-mail                          YYYY-MM-DD              Reason
    axpipe@axondata.se              2003-12-01              Initial
\endverbatim
*/
#include "stdafx.h"

#include "AxAssert.h"
#define AXLIB_ASSERT_FILE "CSink.cpp"

namespace AxPipe {
    /// Helper function that is also called by derived classes that want slightly
    /// different Work() logic, but can leverage this common base.
    /// Checks for special AxPipe::eSegType types, and calls the appropriate OutOpen(),
    /// OutClose(), OutFlush() and Out() functions depending on the case.
    /// Only in the case of Out() does the actual data segment get passed on. Any custom
    /// AxPipe::eSegType segment types gets passed as normal segments to Out().
    /// Ensures that the pipe is Open() at this stage before sending data etc.
    /// \return true if the caller should propagate the segment. The pSeg is never CSeg::Release()'d here. Caller must.
    bool
    CSink::DoSegWork(CSeg *pSeg) {
        bool fPropagate;                    // true if we propagate in band signals

        switch (pSeg->Type()) {
        case eSegTypeOpen:
            fPropagate = OutOpen();
            // Can't set this false before we've closed properly
            m_fIsOpen = true;
            return fPropagate;
            break;

        case eSegTypeFlush:
            return OutFlush();
            break;

        case eSegTypeClose:
            if (m_fIsOpen) {
                fPropagate = OutClose();
                // Can't set this false before we've closed properly
                m_fIsOpen = false;
            } else {
                // If we're not open doesn't make sense to propagate close
                fPropagate = false;
            }
            return fPropagate;
            break;

        case eSegTypePlug:
            // Set the exit so we can end if it's a thread etc.
            OutPlug();                      // Call this class's Plug-function
            fPropagate = m_fExit = true;
            return fPropagate;
            break;

        case 0:
            if (!m_fIsOpen) {
                SetError(ERROR_CODE_NOTOPEN, ERROR_MSG_NOTOPEN);
                break;
            }
            // Ignore zero-length segments.
            if (pSeg->Len()) {
                // non-zero length data segment.
                // Out() will not be called with anything else. CFilter derived classes have slightly
                // different rules.
                Out(pSeg->AddRef());
            }
            break;
        default:
            // It's an special/unknown segment type, call the handler (even with zero-length)
            // Note that we auto propagate special segments, even if they are semantially similar
            // to normal data segments.
            // CSeg::AddRef() it since the OutSpecial() handler is expected to CSeg::Release() it - as will the caller of DoSegWork()
            return OutSpecial(pSeg->AddRef());
            break;
        }
        return false;
    }

    /// Called with CSink::m_pSeg set to whatever needs to be processed.
    /// Work guarantees to never call Out() with anything but a valid, non-zero-length
    /// data segment. Other cases are handled by OutOpen(), OutClose() and OutFlush().
    /// A Plug() request causes nothing to be sent to Out().
    void
    CSink::Work() {
        CSeg *pSeg = m_pSeg;
        m_pSeg = NULL;

        (void)DoSegWork(pSeg);
        // DoSegWork() never releases, so we must.
        pSeg->Release();
    }

    /// Unless we're already exited, end processing and wait for it to reach
    /// idle state. Should not be called from Work() or Out(). Finally, we
    /// wait for the worker thread, if any, to actually exit, thus assuring
    /// that when Plug() returns, it is safe to call the destructor.
    /// The purpose of Plug is to finalize all processing and to ensure that
    /// any errors are found and reported. Final error checking for processing should
    /// thus not be done before Plug() is called. After Plug() is called, the
    /// only thing that should be done with the object and the pipe line is
    /// to destruct it.
    void
    CSink::OutPlug() {
        AxLib::OutputDebugStringF(_T("CSink::OutPlug() m_fExit=%d\n"), m_fExit);
    }

    /// Allocate a new segment, possibly from the next section of the pipe.
    ///
    /// Callable from user code in derived classes.
    ///
    /// Call this to get a segment if you suspect the next in line is a sink that
    /// might provide an efficient segment, such as for a memory mapped file.
    /// \return A writeable CSeg of the requested size, or NULL on error.
    CSeg *
    CSink::GetSeg(size_t cb)  {
        return new CSeg(cb);
    }

    /// \brief Send Out-of-band signal. Callable from user code in derived classes.
    ///
    /// Does nothing, this is a CSink.
    /// \see CPipe::Signal()
    void
    CSink::Signal(void *vId, void *p) {
    }

    /// Callable from user code in derived classes.
    ///
    /// \return The maximum output size in bytes. -1 if unknown or unlimited.
    /// \see OutSizeMax() The corresponding overrideable
    longlong
    CSink::SizeMax() {
        return OutSizeMax();
    }

    /// Do not call from user code, only from derived framework classes.
    /// The normal usage is to have the previous section up the line
    /// call this via it's CPipe::m_pSink pointer, the roundabout way is
    /// to enable seamless threading.
    /// Is frequently called from other library-internal classes, therefore public
    /// \param pSeg The segment to send off to Work(). Don't use it afterwards unless you've CSeg::AddRef()'d it.
    void
    CSink::OutPump(CSeg *pSeg) {
        WorkStart();
        m_pSeg = pSeg;
        WorkSignal();
    }
    
    /// Override this in user derived classes to return the maximum size
    /// of the sink, or -1 for expandable. The default CSink implementation
    /// always returns -1.
    /// \return The maximum output size in bytes. -1 if unknown or unlimited.
    /// \see SizeMax()
    longlong
    CSink::OutSizeMax() {
        return -1;
    }
    
    /// Override in user derived classes to provide an efficient memory segment
    /// output from a CSink, especially for memory mapped files.
    /// \see GetSeg() The User callable function.
    /// \return A writeable segment.
    CSeg *
    CSink::OutGetSeg(size_t cb) {
		CSeg *pSeg = new CSeg(cb);
		ASSPTR(pSeg);
        return pSeg;
    }
    
    /// Override in user derived classes to receive a out-of band signal sent from upstream.
    /// This will be called synchronized with the data stream, so previously sent
    /// data will have reached this section, unless some intermediate section buffers.
    /// No automatic Flush() request is sent though. This CSink default implementation
    /// does nothing and returns false to stop propagation, since it's CSink.
    /// \return false to stop the signal-propagation, true to continue it.
    /// \param vId A unique value identifying the signal, suggested is ClassId().
    /// \param p An opaque pointer value, interpretable by the receiver.
    /// \see CPipe::OutSignal()
    /// \sse CPipe::OutSpecial()
    bool
    CSink::OutSignal(void *vId, void *p) {
        return false;
    }

    /// Override in user derived classes. Called by the framework as a result of an
    /// Open() call here or upstream. Prepare for processing of a new stream, it must
    /// support being called again after a Close() call. No data may be processed by
    /// the stream without an Open() call.
    ///
    /// The default implementation for a CSink returns false, as it does not make
    /// sense to propagate downstream from a CSink()
    /// \return true if the framework should propagate the Open() request downstream.
    bool
    CSink::OutOpen() {
        return false;
    };
    
    /// You are not required to honor the request.
    /// \return true if the framework should propagate the Flush() request downstream.
    bool
    CSink::OutFlush() {
        return false;
    };
    
    /// The code should handle multiple (extra) calls to an already closed stream with
    /// no ill effects, i.e. silently ignore them. This default implementation returns
    /// false to stop propagation, since it's a CSink.
    /// \return true if the framework should propagate the Close() request downstream.
    bool
    CSink::OutClose() {
        return false;
    };
    /// Segments may be marked as special with a non-zero value based on AxPipe::eSegType types. These are
    /// filtered out of the stream by the framework and presented here instead of to Out(). Use
    /// this in derived classes to provide in band signalling and for other custom needs. Start
    /// numbering from AxPipe::eSegTypeDerived.
    ///
    /// The default implementation here just calls CSeg::Release() on the provided CSeg .
    ///
    /// These segements may be zero-length.
	/// \return false, since we're at the end of the line. No more propagation.
    /// \see AxPipe::eSegType
    bool
    CSink::OutSpecial(CSeg *pSeg) {
        pSeg->Release();
		return false;
    }

    /// Initialize member variables.
    CSink::CSink() {
        m_pSeg = NULL;
        m_fIsOpen = false;
    }

    /// Plug the pipe, destroy the sink and release remaining m_pSeg if any
    CSink::~CSink() {
        OutputDebugStringF(_T("CSink::~CSink() Initating... this=%p\n"), this);
        ASSCHK(m_fExit, _T("CSink::~CSink() called without Plug()"));
        if (CSeg::IsSeg(m_pSeg)) m_pSeg->Release();
        OutputDebugStringF(_T("CSink::~CSink() ...Done. this=%p\n"), this);
    }

    /// You can't append a CSink to a CSink, so this implements code to catch
    /// that error.
    void
    CSink::AppendSink(CSink *pSink, bool fAutoDelete) {
        SetError(ERROR_CODE_GENERIC, _T("Attempt to append to a sink"));
    }

    /// Synchronize all work downstream, ensuring
    /// that there is no work in progress.
    void
    CSink::Sync() {
        WaitForIdle();
        // Do no more, this is a CSink - It's the end of the line.
    }

    /// Called by the virtual destructor, the default implementation for CSink
    /// does nothing. The purpose of DestructSink() is to ensure that the
    /// whole chain gets destructed, also depending on if they should be
    /// auto deleted. It should be called by the destructor before it
    /// does the remaining destructing.
    void
    CSink::DestructSink() {
        OutputDebugString(_T("CSink::DestructSink()\n"));
    }
};

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产三级欧美三级日产三级99 | 国产欧美va欧美不卡在线| 蜜桃免费网站一区二区三区| 日韩一区二区三| 久久er99热精品一区二区| 精品国产制服丝袜高跟| 国产成人免费视频网站| 国产精品美女一区二区三区| 91在线国产观看| 亚洲一区二区三区三| 在线成人免费观看| 国产剧情一区二区| 亚洲天堂久久久久久久| 亚洲欧美偷拍卡通变态| 91网址在线看| 奇米色777欧美一区二区| 国产午夜精品一区二区 | 有码一区二区三区| 欧美精品18+| 国产米奇在线777精品观看| 国产欧美一二三区| 在线精品亚洲一区二区不卡| 奇米色一区二区三区四区| 欧美极品aⅴ影院| 欧美性猛交一区二区三区精品| 美女视频一区二区| 综合激情成人伊人| 日韩欧美国产三级| 99国产精品久| 老司机免费视频一区二区| 欧美国产激情二区三区| 欧美日韩视频一区二区| 国产成人精品在线看| 亚洲一区二区三区在线看| 国产午夜精品一区二区三区四区| 91老师国产黑色丝袜在线| 免费人成在线不卡| 亚洲婷婷综合久久一本伊一区| 日韩午夜小视频| 91麻豆免费观看| 91麻豆精品国产综合久久久久久| 国产乱理伦片在线观看夜一区| 亚洲激情欧美激情| 久久精品欧美一区二区三区麻豆| 精品视频123区在线观看| 成人深夜福利app| 韩日av一区二区| 天天色综合成人网| 亚洲免费观看高清完整版在线 | 午夜激情综合网| 国产精品国产a级| 欧美大片免费久久精品三p| 欧美亚洲一区三区| av高清不卡在线| 久久精品国产**网站演员| 亚洲一区国产视频| 综合av第一页| 中文字幕一区二区日韩精品绯色| 精品国产乱码久久久久久老虎| 精品视频资源站| 91色在线porny| av高清久久久| jizzjizzjizz欧美| 大桥未久av一区二区三区中文| 激情六月婷婷久久| 日韩成人伦理电影在线观看| 亚洲国产精品欧美一二99| 一区二区三区成人| 一区二区三区产品免费精品久久75| 亚洲欧美在线视频观看| 国产精品国产精品国产专区不片| 国产午夜精品美女毛片视频| 久久九九久久九九| 久久久久久毛片| 国产欧美日韩久久| 亚洲国产电影在线观看| 久久久国产综合精品女国产盗摄| 精品国产sm最大网站免费看| 精品对白一区国产伦| 久久蜜臀精品av| 国产日韩v精品一区二区| 久久久久久麻豆| 国产精品人妖ts系列视频| 中文在线免费一区三区高中清不卡| 2022国产精品视频| 中文一区在线播放| 亚洲色图制服丝袜| 亚洲一区二区三区自拍| 亚洲成人资源网| 日韩黄色在线观看| 久久er99精品| 成人一道本在线| 91麻豆国产精品久久| 色噜噜狠狠成人中文综合| 在线看日本不卡| 日韩欧美专区在线| 国产欧美日韩另类一区| 亚洲激情在线激情| 白白色亚洲国产精品| 在线观看三级视频欧美| 777午夜精品免费视频| 欧美成人高清电影在线| 国产亚洲精品精华液| 亚洲精品自拍动漫在线| 丝袜亚洲另类欧美| 国产精品自在在线| 色噜噜久久综合| 日韩欧美亚洲另类制服综合在线| 国产亚洲污的网站| 亚洲免费在线观看| 老司机午夜精品99久久| 成人激情免费视频| 欧美日韩成人高清| 国产色一区二区| 亚洲一区二区精品视频| 老司机午夜精品99久久| 91一区二区在线| 欧美一级日韩免费不卡| 国产精品看片你懂得| 亚洲成人一二三| 国产成人精品三级麻豆| 欧美丝袜丝交足nylons图片| 国产性天天综合网| 亚洲成人中文在线| 成人网在线免费视频| 欧美一区二区在线免费播放| 国产精品传媒入口麻豆| 日韩av电影免费观看高清完整版| 粉嫩av亚洲一区二区图片| 欧美日韩国产一级片| 中文字幕精品一区二区精品绿巨人| 五月激情六月综合| 99精品欧美一区二区三区小说 | 激情国产一区二区| 99国产欧美久久久精品| 欧美成人bangbros| 亚洲精品国产精华液| 韩国v欧美v亚洲v日本v| 欧美怡红院视频| 国产精品久久久久影视| 久久精品国产第一区二区三区| 在线视频你懂得一区| 欧美激情艳妇裸体舞| 蓝色福利精品导航| 欧美日韩第一区日日骚| 一区二区三区欧美视频| 成人免费视频caoporn| 久久新电视剧免费观看| 日韩黄色免费电影| 欧美在线播放高清精品| 中文字幕在线不卡视频| 国产乱人伦精品一区二区在线观看 | 亚洲欧美偷拍三级| 成人a区在线观看| 26uuu亚洲综合色| 免费成人在线影院| 6080yy午夜一二三区久久| 亚洲伊人伊色伊影伊综合网| www.欧美日韩国产在线| 国产人成亚洲第一网站在线播放| 狂野欧美性猛交blacked| 91精品国产免费| 首页亚洲欧美制服丝腿| 欧美日韩国产中文| 亚洲国产乱码最新视频| 欧洲av一区二区嗯嗯嗯啊| 亚洲免费大片在线观看| 日本韩国一区二区三区视频| 亚洲免费看黄网站| 亚洲色图.com| 91丨九色丨蝌蚪丨老版| 亚洲女人****多毛耸耸8| av在线播放成人| 亚洲视频资源在线| 99久久99久久精品国产片果冻| 国产精品久久久久久久久图文区 | 日本不卡一二三| 日韩欧美精品三级| 精品一区二区在线免费观看| 日韩免费在线观看| 国产一区二区三区电影在线观看| 精品久久国产老人久久综合| 国产一区二区免费看| 欧美国产精品一区二区三区| 国产91精品免费| 亚洲人成网站影音先锋播放| 91啪亚洲精品| 日韩福利电影在线| 精品91自产拍在线观看一区| 国产a久久麻豆| 综合激情网...| 3d动漫精品啪啪一区二区竹菊| 美国欧美日韩国产在线播放| 久久久久久亚洲综合影院红桃| 国产精品12区| 亚洲欧美在线另类| 91精品国产91久久综合桃花 | 老司机精品视频导航| 日本一区二区三区电影| 成人91在线观看|