• <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) 評(píng)論(0)  編輯 收藏 引用 所屬分類: Design Pattern

            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            7777精品久久久大香线蕉| 好久久免费视频高清| AA级片免费看视频久久| 久久99精品久久久久久hb无码| 色欲综合久久躁天天躁蜜桃| 久久久久av无码免费网| 久久婷婷五月综合97色直播| 久久精品国产久精国产一老狼| 香蕉久久夜色精品国产2020| 18禁黄久久久AAA片| 精品久久人人爽天天玩人人妻 | 无码伊人66久久大杳蕉网站谷歌| 国产精品久久久久久久app| 久久久久久久波多野结衣高潮| 久久国产免费直播| AV无码久久久久不卡蜜桃| 久久亚洲高清观看| 久久夜色精品国产亚洲av| yy6080久久| 国产美女久久久| 久久强奷乱码老熟女| 亚洲午夜久久久久妓女影院 | 久久成人影院精品777| 久久精品国产72国产精福利| 亚洲美日韩Av中文字幕无码久久久妻妇| 一本久久免费视频| 成人国内精品久久久久影院| 久久久久亚洲爆乳少妇无| 亚洲午夜久久久影院伊人| 国产午夜精品理论片久久| 国产成人综合久久精品红 | 久久精品国产秦先生| 中文字幕亚洲综合久久菠萝蜜| 久久精品国产精品亚洲毛片| 欧美久久一区二区三区| 精品人妻久久久久久888| 久久亚洲av无码精品浪潮| 久久精品一本到99热免费| 亚洲国产香蕉人人爽成AV片久久 | 欧美噜噜久久久XXX| 久久99精品久久久久久不卡 |