• <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
            香蕉久久夜色精品国产2020 | 91久久九九无码成人网站 | 国产精品美女久久福利网站| 一本一本久久a久久精品综合麻豆| 一本色道久久综合| 精品国产一区二区三区久久| 无码精品久久一区二区三区| 日韩人妻无码精品久久久不卡 | 国产精品久久久久…| 国产福利电影一区二区三区久久久久成人精品综合 | 一本一本久久a久久精品综合麻豆| 亚洲人成精品久久久久| 久久精品国产72国产精福利| 热re99久久精品国99热| 久久久99精品成人片中文字幕| 久久综合给合久久狠狠狠97色69| 久久99精品久久久久久秒播| 麻豆成人久久精品二区三区免费 | 久久久久久精品免费免费自慰| 狠狠干狠狠久久| 久久精品人妻中文系列| 免费一级欧美大片久久网| 国产国产成人精品久久| 久久99精品久久只有精品| 久久精品国产乱子伦| 国产精品久久久久免费a∨| 九九热久久免费视频| 嫩草影院久久国产精品| 久久久久人妻精品一区二区三区| 午夜精品久久影院蜜桃| 国产精品日韩欧美久久综合| 欧美伊香蕉久久综合类网站| 国产精品久久久久aaaa| 久久综合综合久久97色| 久久成人国产精品二三区| 久久亚洲精品中文字幕三区| 99久久久精品| 国产ww久久久久久久久久| 青青草原综合久久大伊人精品| 97久久超碰成人精品网站| 97超级碰碰碰久久久久|