• <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

             

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

            實在是沒看出來這樣有什么優(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   管理


            久久久久久久波多野结衣高潮| 午夜人妻久久久久久久久| 97精品伊人久久久大香线蕉| 国产精品热久久毛片| 日产精品久久久久久久| 中文字幕日本人妻久久久免费| 久久亚洲私人国产精品| 国产日韩久久久精品影院首页| 日韩精品久久久久久久电影| 99精品国产在热久久无毒不卡| 久久久久久久亚洲精品| 午夜精品久久久久久久| 久久久久亚洲精品中文字幕| AV狠狠色丁香婷婷综合久久| 无码任你躁久久久久久老妇| 99久久无色码中文字幕| 久久久一本精品99久久精品88| 亚洲国产成人久久综合一 | 国产一级做a爰片久久毛片| 久久久久久亚洲精品无码| 久久精品国产99久久久| 精品国产99久久久久久麻豆| 国产三级观看久久| Xx性欧美肥妇精品久久久久久| 久久久久亚洲精品天堂| 久久这里只精品99re66| 国产精自产拍久久久久久蜜| 久久精品国产精品青草| 九九99精品久久久久久| 久久91综合国产91久久精品| 69久久夜色精品国产69| 人妻少妇久久中文字幕一区二区| 国产精品久久久久久久久软件| 久久国产V一级毛多内射| 曰曰摸天天摸人人看久久久| 99国产欧美精品久久久蜜芽| 国产亚洲精品美女久久久| 日韩精品久久无码人妻中文字幕 | 日韩一区二区久久久久久| 97久久超碰成人精品网站| 国产V亚洲V天堂无码久久久|