• <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
            青青青国产成人久久111网站| 99久久国产综合精品成人影院| 国产精品gz久久久| 久久免费观看视频| 久久本道久久综合伊人| 久久久久高潮综合影院| 777久久精品一区二区三区无码| 久久精品一区二区| 一级做a爰片久久毛片人呢| 亚洲精品乱码久久久久久中文字幕| 久久无码国产| 热久久最新网站获取| 精品熟女少妇av免费久久| 久久精品国产久精国产思思| 国产精品99久久不卡| 欧美激情一区二区久久久| 久久国产精品99久久久久久老狼 | 日韩精品久久久久久久电影蜜臀| 亚洲国产欧洲综合997久久| 免费精品99久久国产综合精品| 久久精品国产国产精品四凭| 久久精品欧美日韩精品| 久久综合九色综合网站| 一本久久a久久精品亚洲| 性高朝久久久久久久久久| 人妻精品久久久久中文字幕| 久久久国产视频| 国产毛片欧美毛片久久久| 久久影视综合亚洲| 国内精品伊人久久久久777| 亚洲国产精品无码久久九九| 中文字幕无码久久久| 久久九九久精品国产免费直播| 亚洲国产精品一区二区久久hs| 久久综合狠狠综合久久97色| 国产精品久久久久久久午夜片 | 伊人久久大香线蕉成人| 精品久久久久久国产潘金莲| 久久亚洲国产中v天仙www| 国产免费久久精品99久久| 久久亚洲精品人成综合网|