• <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
            久久久久AV综合网成人| 伊人久久大香线蕉亚洲五月天| 日韩AV无码久久一区二区| 久久精品亚洲一区二区三区浴池 | 久久久久亚洲AV成人网人人网站 | 久久精品亚洲福利| 久久久亚洲裙底偷窥综合| 久久99国产精品久久| 国产精品99久久久精品无码| 久久亚洲日韩精品一区二区三区| 久久久久中文字幕| 一本一本久久a久久综合精品蜜桃 一本一道久久综合狠狠老 | 久久亚洲欧洲国产综合| 国产精品一久久香蕉国产线看观看 | a级毛片无码兔费真人久久| 欧美日韩精品久久免费| 热re99久久精品国产99热| 久久久久久精品无码人妻| 人妻少妇精品久久| 精品久久久久久无码中文字幕| 久久夜色精品国产欧美乱| 久久久久亚洲AV无码观看| 香蕉99久久国产综合精品宅男自 | 久久亚洲国产精品123区| 国产高潮国产高潮久久久| 亚洲AV无码久久精品狠狠爱浪潮| 久久精品中文字幕有码| 久久精品国产亚洲Aⅴ香蕉| 99久久亚洲综合精品网站| 久久精品人人做人人爽97 | 久久国产一片免费观看| 91精品国产色综久久| 中文字幕亚洲综合久久2| 久久久久国产一级毛片高清版| 久久精品国产99国产电影网| 亚洲国产精品人久久| 久久精品免费网站网| 亚洲国产精品成人久久蜜臀| 亚洲精品美女久久久久99小说 | 伊人久久综合成人网| 人妻无码αv中文字幕久久|