• <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 閱讀(316) 評論(0)  編輯 收藏 引用 所屬分類: Design Pattern
            久久狠狠色狠狠色综合| 色偷偷91久久综合噜噜噜噜| 久久99精品国产自在现线小黄鸭 | 亚洲国产成人久久综合一 | 久久久久亚洲国产| 久久精品欧美日韩精品| 久久久久久久尹人综合网亚洲| 国产激情久久久久影院小草| 国内精品久久久久影院薰衣草 | 2021最新久久久视精品爱| 国内精品久久人妻互换| 婷婷久久综合九色综合绿巨人| 久久精品国产亚洲精品2020| 一本色综合久久| 国产精品嫩草影院久久| 久久Av无码精品人妻系列| 一本大道久久香蕉成人网| 国产精品成人99久久久久91gav| 亚洲AV日韩精品久久久久| 尹人香蕉久久99天天拍| 久久久网中文字幕| 国产成人久久久精品二区三区| 久久狠狠高潮亚洲精品| 亚洲中文久久精品无码ww16| 伊人久久国产免费观看视频| 久久国产一片免费观看| 国产AⅤ精品一区二区三区久久| 精品国产乱码久久久久久1区2区| 亚洲精品乱码久久久久久久久久久久 | 亚洲午夜久久久影院| 久久久久久国产a免费观看黄色大片| 色综合久久天天综合| 色综合合久久天天综合绕视看 | 狠狠色婷婷久久一区二区| 一个色综合久久| 久久精品国产乱子伦| 色综合久久久久综合体桃花网| 无码专区久久综合久中文字幕| 久久人人妻人人爽人人爽| 999久久久无码国产精品| 丁香五月网久久综合|