• <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久久精品一区二区| 久久久久九国产精品| 少妇久久久久久被弄高潮| 久久久久亚洲AV成人网人人网站| 久久久久青草线蕉综合超碰| 99久久婷婷免费国产综合精品| 国产女人aaa级久久久级| 久久综合亚洲色一区二区三区| 久久综合丁香激情久久| 久久无码AV中文出轨人妻| 亚洲欧美精品伊人久久| 亚洲AV日韩精品久久久久| 久久综合色之久久综合| 国产亚洲综合久久系列| 久久精品国产AV一区二区三区 | 色青青草原桃花久久综合| 日本一区精品久久久久影院| 亚洲熟妇无码另类久久久| 久久婷婷午色综合夜啪| 久久影院午夜理论片无码| 久久精品国产亚洲一区二区三区| 色综合合久久天天综合绕视看 | 亚洲欧美成人综合久久久| 青青热久久国产久精品| 精品无码久久久久久国产| 亚洲精品国产成人99久久| 久久婷婷国产麻豆91天堂| 91精品国产色综合久久| 成人免费网站久久久| 久久精品一区二区三区不卡| 久久国产精品久久久| 久久精品国产精品青草| 国产亚州精品女人久久久久久 | 国产精品一区二区久久| 国产精品99久久久久久人| 久久久久综合网久久|