range.hpp

Go to the documentation of this file.
00001 /****
00002 ***** Copyright 2010 Intel Corporation All Rights Reserved.
00003 *****
00004 ***** The source code, information and material contained herein are owned by Intel Corporation or its suppliers  *****
00005 ***** or licensors, and title to such Material remains with Intel Corporation or its suppliers or licensors.      *****
00006 ***** The Material contains proprietary information of Intel or its suppliers and licensors. The Material is      *****
00007 ***** protected by worldwide copyright laws and treaty provisions. No part of the Material may be used, copied,   *****
00008 ***** reproduced, modified, published, uploaded, posted, transmitted, distributed or disclosed in any way without *****
00009 ***** Intel's prior express written permission.
00010 *****
00011 ***** No license under any patent, copyright or other intellectual property rights in the material is granted to  *****
00012 ***** or conferred upon you, either expressly, by implication, inducement, estoppel or otherwise. Any license     *****
00013 ***** under such intellectual property rights must be express and approved by Intel in writing.
00014 ****/
00015 
00016 /**** Copyright Ends ****/
00017 
00018 #ifndef ARBB_CPP_RANGE_HPP
00019 #define ARBB_CPP_RANGE_HPP
00020 
00021 #include "type_traits.hpp"
00022 #include "range_iterator.hpp"
00023 #include "detail/range.hpp"
00024 #include "detail/range_iterator.hpp"
00025 #include "detail/range_element.hpp"
00026 
00027 namespace ARBB_CPP_NS {
00028 
00031 
00037 template <typename T>
00038 class range
00039 {
00040 public:
00042   typedef range_iterator<T> iterator;
00044   typedef const_range_iterator<T> const_iterator;
00046   typedef detail::range_element<T> element;
00047 
00049   range();
00050 
00052   range(const range& other);
00053 
00055   void operator=(const range& other);
00056 
00058   iterator begin();
00059 
00061   iterator end();
00062 
00064   const_iterator begin() const;
00065 
00067   const_iterator end() const;
00068 
00071   typename uncaptured<usize>::type size();
00072 
00074   bool empty();
00075 
00077   element operator[](typename uncaptured<usize>::type index);
00078 
00080   const element operator[](typename uncaptured<usize>::type index) const;
00081 
00083   element at(typename uncaptured<usize>::type index);
00084 
00086   const element at(typename uncaptured<usize>::type index) const;
00087 
00089   
00090   range(detail::range<T> detail_range);
00091 
00093 
00094 private:
00095   detail::range<T> m_detail_range;
00096 };
00097 
00103 template <typename T>
00104 class const_range
00105 {
00106 public:
00108   typedef const_range_iterator<T> const_iterator;
00110   typedef detail::range_element<T> element;
00111 
00113   const_range();
00114 
00116   const_range(const const_range& other);
00117 
00119   void operator=(const const_range& other);
00120 
00122   const_iterator begin() const;
00123 
00125   const_iterator end() const;
00126 
00129   typename uncaptured<usize>::type size();
00130 
00132   bool empty();
00133 
00135   const element operator[](typename uncaptured<usize>::type index) const;
00136 
00138   const element at(typename uncaptured<usize>::type index) const;
00139 
00141   
00142   const_range(detail::range<T> detail_range);
00143 
00145   
00146 private:
00147   detail::range<T> m_detail_range;
00148 };
00149 
00151 
00152 } // namespace ARBB_CPP_NS
00153 
00154 #endif // ARBB_CPP_RANGE_HPP

Submit feedback on this help topic

Copyright © 2010, Intel Corporation. All rights reserved.