• <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| 无码人妻久久一区二区三区免费| 久久综合久久综合九色| 国内精品久久久久影院日本| 97精品伊人久久大香线蕉app | 久久久久久久免费视频| 久久精品国产AV一区二区三区| 乱亲女H秽乱长久久久| 国产精品久久久久乳精品爆| 久久久久无码精品国产app| 亚洲v国产v天堂a无码久久| 久久久久无码精品国产不卡| 国产一区二区精品久久岳| 人妻无码中文久久久久专区| 久久精品国产只有精品66| 人妻少妇久久中文字幕| 亚洲欧洲中文日韩久久AV乱码| 久久久久久国产精品免费无码| 国产激情久久久久影院老熟女免费| 亚洲精品无码久久久久AV麻豆| 久久精品国产精品国产精品污| 久久九九兔免费精品6| 精品久久人人爽天天玩人人妻 | 久久国产精品-久久精品| 久久免费视频1| 日韩久久无码免费毛片软件| 久久久久免费精品国产| 色偷偷久久一区二区三区| 精品国产日韩久久亚洲| 久久亚洲天堂| 日韩电影久久久被窝网| 久久久久久久亚洲精品| 久久久久亚洲精品天堂久久久久久 | 国产伊人久久| 久久精品国产亚洲av瑜伽| 99精品伊人久久久大香线蕉| 久久97精品久久久久久久不卡| 久久精品午夜一区二区福利| 少妇人妻88久久中文字幕| 日本欧美久久久久免费播放网| 欧美一区二区三区久久综合|