• <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
            国产人久久人人人人爽| 国产精品久久久久久久久软件| 热久久视久久精品18| 精品久久久无码人妻中文字幕| 久久久久亚洲Av无码专| 国内精品久久久久| 欧美无乱码久久久免费午夜一区二区三区中文字幕 | 久久精品国产只有精品2020| 精品久久久久久久中文字幕| 热99RE久久精品这里都是精品免费 | 久久国产乱子伦免费精品| 99精品久久久久久久婷婷| 亚洲精品视频久久久| 久久久青草久久久青草| 亚洲AV无码一区东京热久久| 91精品国产高清久久久久久io| 无码人妻久久一区二区三区蜜桃| 久久亚洲AV无码精品色午夜麻豆| www.久久热| 亚洲中文字幕无码久久2020| 久久艹国产| 99久久精品免费国产大片| 久久99国产综合精品| 亚洲va中文字幕无码久久| 一日本道伊人久久综合影| 久久久久亚洲爆乳少妇无 | 国产A三级久久精品| 无码人妻久久一区二区三区蜜桃| 秋霞久久国产精品电影院| 少妇精品久久久一区二区三区| 亚洲精品午夜国产va久久| 日韩美女18网站久久精品| 九九久久精品国产| 99久久精品免费国产大片| 97久久精品人人做人人爽| 伊人久久免费视频| 久久久久国产一级毛片高清版| 国内精品伊人久久久久AV影院| 国产精品无码久久久久久| 久久99毛片免费观看不卡| 99精品久久久久久久婷婷|