• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Error

            C++博客 首頁 新隨筆 聯(lián)系 聚合 管理
              217 Posts :: 61 Stories :: 32 Comments :: 0 Trackbacks

             

            ///////////////////////////////////////////////////////////////////////////////////////////

            實(shí)在是沒看出來這樣有什么優(yōu)勢,為了記錄是否走過某個path?

            Query::execute(const SQLString& str)這里看到了遞歸操作,難道是為了輔助遞歸?

            總感覺這里越搞越復(fù)雜,,,

            ///////////////////////////////////////////////////////////////////////////////////////////

            /// \brief A template for setting a flag on a variable as long as the
            /// object that set it is in scope.  Flag resets when object goes
            /// out of scope.  Works on anything that looks like bool.

            template <class T = bool>
            class AutoFlag
            {
            public:
                /// \brief Constructor: sets ref to true.
                AutoFlag(T& ref) :
                referent_(ref)
                {
                    referent_ = true;
                }

                /// \brief Destructor: sets referent passed to ctor to false.
                ~AutoFlag()
                {
                    referent_ = false;
                }

            private:
                T& referent_;
            };

             

            ///////////////////////////////////////////////////////////////////////////////////////////

            ResNSel
            Query::execute(const SQLString& str)
            {
                if ((def.size() == 1) && !def.processing_) {
                    // .  The
                    // auto-reset flag is required because we'll end up back in this
                    // function once the query string is built, but we need to take
                    // the 'else' path to avoid an infinite loop.
                    AutoFlag<> af(def.processing_);
                    return execute(SQLQueryParms() << str);
                }
                else {
                    // Take str to be the entire query string
                    return execute(str.c_str(), str.length());
                }
            }

            ResNSel
            Query::execute(const char* str)
            {
                return execute(SQLString(str));
            }

            ResNSel
            Query::execute(const char* str, size_t len)
            {
                if (lock()) {
                    success_ = false;
                    if (throw_exceptions()) {
                        throw LockFailed();
                    }
                    else {
                        return ResNSel();
                    }
                }

                success_ = !mysql_real_query(&conn_->mysql_, str, len);

                unlock();
                if (success_) {
                    return ResNSel(conn_);
                }
                else if (throw_exceptions()) {
                    throw BadQuery(error());
                }
                else {
                    return ResNSel();
                }
            }

            posted on 2012-10-08 11:51 Enic 閱讀(114) 評論(0)  編輯 收藏 引用

            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            99久久超碰中文字幕伊人| 久久青青草原国产精品免费| 亚洲伊人久久综合中文成人网| 久久99精品免费一区二区 | 亚洲精品国精品久久99热一| 久久综合狠狠综合久久| 97精品伊人久久久大香线蕉 | 香蕉aa三级久久毛片| 久久成人国产精品免费软件| 91精品国产高清久久久久久io| 久久精品无码专区免费| 亚洲国产欧美国产综合久久| 久久国产视频网| 久久国产色AV免费看| 一本大道久久东京热无码AV| 国产精品视频久久久| 久久久久久精品免费看SSS| 久久91精品国产91久久麻豆| 亚洲国产精品嫩草影院久久| 久久免费美女视频| 亚洲va久久久噜噜噜久久男同| 久久国产成人午夜aⅴ影院 | 久久久久久久人妻无码中文字幕爆| 国产精品久久久久久久久久免费| 人妻无码αv中文字幕久久琪琪布| 久久精品成人免费观看97| 久久se精品一区二区| 久久人妻少妇嫩草AV无码专区| 日韩影院久久| 性做久久久久久久久久久| 久久精品中文字幕一区| 久久丝袜精品中文字幕| 久久国产精品偷99| 伊人丁香狠狠色综合久久| 97久久精品国产精品青草| 久久精品国产亚洲av麻豆色欲| 性欧美丰满熟妇XXXX性久久久| 久久人妻AV中文字幕| 99久久无色码中文字幕人妻| 久久婷婷五月综合成人D啪| 亚洲国产香蕉人人爽成AV片久久|