ivl 679
ivl/details/core/keyword_operators/rvalue.hpp
00001 /* This file is part of the ivl C++ library <http://image.ntua.gr/ivl>.
00002    A C++ template library extending syntax towards mathematical notation.
00003 
00004    Copyright (C) 2012 Yannis Avrithis <iavr@image.ntua.gr>
00005    Copyright (C) 2012 Kimon Kontosis <kimonas@image.ntua.gr>
00006 
00007    ivl is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU Lesser General Public License 
00009    version 3 as published by the Free Software Foundation.
00010 
00011    Alternatively, you can redistribute it and/or modify it under the terms 
00012    of the GNU General Public License version 2 as published by the Free 
00013    Software Foundation.
00014 
00015    ivl is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00018    See the GNU General Public License for more details.
00019 
00020    You should have received a copy of the GNU General Public License 
00021    and a copy of the GNU Lesser General Public License along 
00022    with ivl. If not, see <http://www.gnu.org/licenses/>. */
00023 
00024 #ifndef IVL_CORE_DETAILS_RVALUE_HPP
00025 #define IVL_CORE_DETAILS_RVALUE_HPP
00026 
00027 namespace ivl {
00028 
00029 #if 1
00030 template<class DERIVED>
00031 class rvalue_base
00032 : public types::rvalue_identifier,
00033 public internal::tuple_rvalue<rvalue_base<DERIVED> >
00034 {
00035 private:
00036         typedef DERIVED derived_type;
00037 
00038 public:
00039         rvalue_base() {}
00040 
00041         const derived_type& derived() const
00042                 { return static_cast<const derived_type&>(*this); }
00043 
00044         derived_type& derived()
00045                 { return static_cast<derived_type&>(*this); }
00046 
00047         template<class T>
00048         void tuple_output(T& t) const
00049         {
00050                 internal::apply_tuple_output(t, derived());
00051         }
00052 
00053 
00054         /*
00055         template<class T>
00056         void tuple_output(T& t)
00057         {
00058 
00059         }
00060         */
00061 };
00062 
00063 
00064 template<class CONV, class DERIVED>
00065 class rvalue_output_converter
00066 : public rvalue_base<DERIVED>
00067 {
00068 private:
00069         typedef rvalue_output_converter<CONV, DERIVED> this_type;
00070         typedef DERIVED derived_type;
00071 
00072 public:
00073         typedef CONV conv_type;
00074 
00075         rvalue_output_converter() {}
00076 
00077         const derived_type& derived() const
00078                 { return static_cast<const derived_type&>(*this); }
00079 
00080         derived_type& derived()
00081                 { return static_cast<derived_type&>(*this); }
00082 };
00083 
00084 
00085 template <class DERIVED>
00086 class rvalue
00087 : public rvalue_base<DERIVED>
00088 {
00089 public:
00090         rvalue() {}
00091 };
00092 
00093 #endif
00094 
00095 }; /*namespace ivl*/
00096 
00097 #endif // IVL_CORE_DETAILS_RVALUE_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations