When I was searching for a view library to have some container adapters so that I can store a portion of a dynamic container in a class, I came across Boost View library and uBLAS range_vector and slice_vector. (Iterators are unsuitable for my purpose as I can't store a portion of a container through iterator when container are resizing (through push_back & pop_front) , and also iterators are dumb enough so they dont give the index for the container they are locating :( ) So I needed the alternative view classes or container adapters , which are store-able even when container is allocating/reallocating as long as the portion of the container which the view is pointing is available. At present I have my own view classes (only the classes I need ) , but planning to switch to boost View classes. A few questions regarding boost View library (from sandbox) 1) is it an accepted library ? if not when it will be accepted ? 2) Apart from range_view all other views are based on container (i.e they are container adapter ). So all other views are store-able while range view is not ( when the iterator becomes invalid , the view is also) any reason for this decision ? 3) for step_iterator, why no step_view is given ? 3) How can I make a composite view mixing a set of views like 2 range view, or one range_view and one permutation_view. For eg. I want to make a container adapter for a container taking a range 2-10 (range_view) and 15,18,17 (permutation_view ). AFAIK some of this mixed views are supported by blitz library. Thanks abir -- Abir Basak, Member IEEE Software Engineer, Read Ink Technologies B. Tech, IIT Kharagpur email: abir@abirbasak.com homepage: www.abirbasak.com
shunsuke wrote:
abir basak wrote:
A few questions regarding boost View library (from sandbox) 1) is it an accepted library ? if not when it will be accepted ?
A few weeks ago, Boost.Range seems to officially start a project for views.
Thanks for the information. Can you give me a pointer about how to implement a composite_view ? It should have the functionality like, 1) iterates over a single container (single container view rather than multi container view) 2) it is a view composed of 2 or more different kind of views,for e.g , I want a view of (2-120 , a range_view) and (133, 145, 148 , an index_view/ permutation_view ), and one will be able to iterate over theme seamlessly without having trouble to go through the underlying container. I have all of the different views already written, but unable to club them together to make a composite_view (I am thinking whether boost::any or tuple can make this happen) BTW, for permutation_view I cant make use of boost::permutation_iterator , because it is not converting a non-const iterator to const one , as the friend conversion is not defined. I need to add the line to make my permutation_view const corrected. Thanks -- Abir Basak, Member IEEE Software Engineer, Read Ink Technologies B. Tech, IIT Kharagpur email: abir@abirbasak.com homepage: www.abirbasak.com
abir basak wrote:
Can you give me a pointer about how to implement a composite_view ? It should have the functionality like, 1) iterates over a single container (single container view rather than multi container view) 2) it is a view composed of 2 or more different kind of views,for e.g , I want a view of (2-120 , a range_view) and (133, 145, 148 , an index_view/ permutation_view ), and one will be able to iterate over theme seamlessly without having trouble to go through the underlying container. I have all of the different views already written, but unable to club them together to make a composite_view (I am thinking whether boost::any or tuple can make this happen)
FWIW, see "jointed" of my library: http://tinyurl.com/2fkxup Fortunately it was released yesterday. Regards, -- Shunsuke Sogame
participants (2)
-
abir basak
-
shunsuke