• <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 閱讀(326) 評論(0)  編輯 收藏 引用 所屬分類: Design Pattern
            99国产欧美精品久久久蜜芽| 色综合久久综合网观看| 久久中文字幕视频、最近更新| 久久国产成人午夜AV影院| 伊人久久五月天| 精品久久人妻av中文字幕| 精品无码久久久久久久久久| 2021国产精品久久精品| 久久福利青草精品资源站| 伊人久久大香线蕉无码麻豆| 好久久免费视频高清| 久久婷婷五月综合成人D啪| 91亚洲国产成人久久精品网址| 亚洲国产精品无码久久98| 久久久久国产日韩精品网站| 久久综合精品国产二区无码| 久久久久亚洲精品天堂久久久久久| 久久影院综合精品| 2021国产精品午夜久久| 亚洲国产综合久久天堂| 九九99精品久久久久久| 色妞色综合久久夜夜| 亚洲午夜福利精品久久| 久久久久久久综合日本| 国产精品内射久久久久欢欢| 99久久免费国产特黄| 久久免费的精品国产V∧| 香蕉久久av一区二区三区| 精品一二三区久久aaa片| 狠狠精品久久久无码中文字幕| 久久伊人五月天论坛| 欧美精品福利视频一区二区三区久久久精品| 狠狠色丁香婷综合久久| 久久精品国内一区二区三区| 国产亚洲欧美成人久久片| 久久免费视频网站| 国产一区二区精品久久| 久久AAAA片一区二区| 狠狠色伊人久久精品综合网 | 97久久超碰国产精品2021| 久久精品亚洲精品国产色婷|