• <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
            婷婷久久精品国产| 亚洲国产精品无码久久久不卡| 少妇精品久久久一区二区三区| 97精品依人久久久大香线蕉97| 欧美无乱码久久久免费午夜一区二区三区中文字幕 | 99久久婷婷免费国产综合精品| 狠狠色噜噜狠狠狠狠狠色综合久久 | 欧美久久亚洲精品| 久久婷婷激情综合色综合俺也去| 久久棈精品久久久久久噜噜| 一本大道加勒比久久综合| 欧美精品丝袜久久久中文字幕| 久久亚洲精品无码AV红樱桃| 91精品国产91久久久久久蜜臀| 久久国产免费直播| 色欲综合久久躁天天躁| 久久99精品国产99久久| 思思久久精品在热线热| 久久亚洲国产精品123区| 99久久免费国产精品| aaa级精品久久久国产片| a级成人毛片久久| 欧美一区二区精品久久| 99精品久久久久中文字幕| 国产亚洲欧美精品久久久| 久久精品中文无码资源站| 99久久99久久精品免费看蜜桃| 亚洲国产精品一区二区久久hs | 国产精品99久久精品爆乳| 99久久精品国产一区二区蜜芽| 亚洲国产成人久久综合碰碰动漫3d | 久久亚洲精品成人AV| 久久精品国产精品青草| 久久天天躁狠狠躁夜夜2020| 要久久爱在线免费观看| 97久久精品国产精品青草| 91久久婷婷国产综合精品青草| 久久精品国产精品亚洲| 久久午夜福利无码1000合集| 国产精品99久久精品| 色天使久久综合网天天|