• <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>
            posts - 100,  comments - 15,  trackbacks - 0
            /*
             * 5_9_Strategy.cpp
             *  
             *  Created on: 2010-9-25
             *      Author: wyiu
             
            */

            class Compositor
            {
            public:
                
            virtual int compose(Coord natural[], Coord stretch[], Coord shrink[],
                                
            int componentCount, int lineWidth, int breaks) = 0;

            protected:
                Compositor();

            };

            //------------------------------------------------------------------------
            class Composition
            {
            public:
                Composition(Compositor 
            *);
                
            void repair();

            private:
                Compositor 
            *_compositor;
                Component 
            *_components;
                
            int _componentCount;
                
            int _lineWidth;
                
            int *_lineBreaks;
                
            int _lineCount;
            };

            void Composition::repair()
            {
                Coord 
            *natural;
                Coord 
            *stretchability;
                Coord 
            *shrinkability;
                
            int componentCount;
                
            int *breaks;

                
            //prepare the arrays with the desired component sizes
                
            //

                
            //determine where the breaks are:
                int breakCount;
                breakCount 
            = _compositor->compose(natural, stretchability, shrinkability,
                                                    componentCount, _lineWidth, breaks);

                
            //lay out components according to breaks
                
            //
            }

            //--------------------------------------------------------------------
            //subclass of Compositor
            class SimpleCompositor : public Compositor
            {
            public:
                SimpleCompositor();

                
            virtual int compose(Coord natural[], Coord stretch[], Coord shrink[],
                                
            int componentCount, int lineWidth, int breaks);

                
            //
            };

            class TeXCompositor : public Compositor
            {
            public:
                TeXCompositor();

                
            virtual int compose(Coord natural[], Coord stretch[], Coord shrink[],
                                
            int componentCount, int lineWidth, int breaks);

                
            //
            };

            class ArrayCompositor : public Compositor
            {
            public:
                ArrayCompositor();

                
            virtual int compose(Coord natural[], Coord stretch[], Coord shrink[],
                                
            int componentCount, int lineWidth, int breaks);

                
            //
            };

            //-----------------------------------------
            //using example
            int main()
            {
                
            //

                Composition 
            *quick = new Composition(new SimpleCompositor);
                Composition 
            *slick = new Composition(new TeXCompositor);
                Composition 
            *iconic = new Composition(new ArrayCompositor);

                
            //.

                
            return 0;
            }
            posted on 2010-10-04 12:27 wyiu 閱讀(313) 評論(0)  編輯 收藏 引用 所屬分類: Design Pattern
            日本久久久久亚洲中字幕| 免费精品国产日韩热久久| 成人综合伊人五月婷久久| 中文字幕一区二区三区久久网站| 久久久久成人精品无码 | 99久久精品免费看国产一区二区三区 | 嫩草伊人久久精品少妇AV| 久久精品无码专区免费| 久久香蕉综合色一综合色88| 亚洲精品乱码久久久久久蜜桃图片| 99久久精品免费国产大片| 成人妇女免费播放久久久| 伊人久久大香线蕉成人| 久久久黄色大片| 久久久久国产| 色妞色综合久久夜夜| 久久男人Av资源网站无码软件 | 成人久久精品一区二区三区| 99久久国产综合精品成人影院 | 狠狠色丁香婷婷久久综合不卡| 久久www免费人成精品香蕉| 久久精品国产亚洲αv忘忧草| 久久青草国产手机看片福利盒子 | 久久午夜羞羞影院免费观看| 亚洲午夜久久久久久噜噜噜| 亚洲中文字幕无码一久久区| 久久天天躁夜夜躁狠狠| 精品综合久久久久久97超人 | 久久国产成人午夜AV影院| 日本精品一区二区久久久 | 久久亚洲2019中文字幕| 99久久99久久精品国产片果冻| 97久久精品午夜一区二区| 品成人欧美大片久久国产欧美| 伊人久久大香线蕉AV一区二区 | 色妞色综合久久夜夜| 国产亚洲婷婷香蕉久久精品| 日产久久强奸免费的看| 99久久久精品免费观看国产| 亚洲国产高清精品线久久| 69久久精品无码一区二区|