• <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 閱讀(317) 評論(0)  編輯 收藏 引用 所屬分類: Design Pattern
            99精品国产在热久久无毒不卡| 久久久高清免费视频| 久久精品视频91| 久久综合视频网站| 亚洲成色WWW久久网站| 好久久免费视频高清| 午夜精品久久久内射近拍高清| 狼狼综合久久久久综合网| 久久久精品午夜免费不卡| 99久久国产综合精品女同图片| 精品国产福利久久久| 怡红院日本一道日本久久| 亚洲婷婷国产精品电影人久久| 久久se精品一区精品二区| 久久精品国产亚洲Aⅴ香蕉| 日韩AV无码久久一区二区| 久久精品国产精品亜洲毛片 | 久久伊人五月天论坛| 久久精品水蜜桃av综合天堂| 亚洲国产婷婷香蕉久久久久久| 99999久久久久久亚洲| 久久精品中文字幕大胸| 久久国产精品偷99| 久久精品国产亚洲网站| 久久夜色精品国产噜噜麻豆| 亚洲精品无码久久毛片| 久久影视综合亚洲| 久久99精品久久久久久不卡| 国产精品久久久久久久久| 中文精品久久久久人妻不卡| 人人妻久久人人澡人人爽人人精品| 色婷婷噜噜久久国产精品12p| 国产一区二区三区久久精品| 久久精品www人人爽人人| 亚洲午夜久久久久久久久电影网 | 久久婷婷激情综合色综合俺也去| 久久精品国产一区二区三区不卡 | 久久久WWW成人免费毛片| 久久免费高清视频| 91久久福利国产成人精品| 久久综合九色欧美综合狠狠 |