libpsynth 0.2.1
/home/raskolnikov/dev/psynth/trunk/src/psynth/sound/forwards.hpp
Go to the documentation of this file.
00001 
00012 /*
00013  *  Copyright (C) 2011 Juan Pedro BolĂ­var Puente
00014  *
00015  *  This file is part of Psychosynth.
00016  *   
00017  *  Psychosynth is free software: you can redistribute it and/or modify
00018  *  it under the terms of the GNU General Public License as published by
00019  *  the Free Software Foundation, either version 3 of the License, or
00020  *  (at your option) any later version.
00021  *
00022  *  Psychosynth is distributed in the hope that it will be useful,
00023  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00024  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025  *  GNU General Public License for more details.
00026  *
00027  *  You should have received a copy of the GNU General Public License
00028  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00029  *
00030  */
00031 
00032 #ifndef PSYNTH_SOUND_FORWARDS_H_
00033 #define PSYNTH_SOUND_FORWARDS_H_
00034 
00035 #include <boost/type_traits.hpp>
00036 #include <boost/utility.hpp>
00037 
00038 namespace psynth
00039 {
00040 namespace sound
00041 {
00042 
00043 template <typename T> struct dynamic_step_type;
00044 
00045 template <typename T> struct sample_traits;
00046 template <typename P> struct is_frame;
00047 
00048 template <typename dstT, typename srcT>
00049 typename sample_traits<dstT>::value_type sample_convert (const srcT& val);
00050 
00051 template <typename ChannelBase, int K> struct
00052 kth_element_type;
00053 template <typename ChannelBase, int K> struct
00054 kth_element_reference_type;
00055 template <typename ChannelBase, int K> struct
00056 kth_element_const_reference_type;
00057 template <typename ChannelBase, int K>
00058 struct kth_semantic_element_reference_type;
00059 template <typename ChannelBase, int K>
00060 struct kth_semantic_element_const_reference_type;
00061 
00062 template <typename ChannelBase> struct size;
00063 template <typename ChannelBase> struct element_type;
00064 template <typename T> struct sample_type;
00065 template <typename T> struct channel_space_type;
00066 template <typename T> struct sample_mapping_type;
00067 template <typename T> struct is_planar;
00068 template <typename T> struct num_samples;
00069 
00070 template <typename It> struct const_iterator_type;
00071 template <typename It> struct iterator_is_mutable;
00072 template <typename It> struct is_iterator_adaptor;
00073 template <typename It, typename NewBaseIt> struct iterator_adaptor_rebind;
00074 template <typename It> struct iterator_adaptor_get_base;
00075 
00076 /* forward-declare at_c */
00077 namespace detail
00078 {
00079 
00080 template <typename Element, typename Layout, int K>
00081 struct homogeneous_channel_base;
00082 
00083 } /* namespace detail */
00084 
00085 template <int K, typename E, typename L, int N>
00086 typename boost::add_reference<E>::type at_c (
00087     detail::homogeneous_channel_base<E,L,N>& p);
00088 
00089 template <int K, typename E, typename L, int N>
00090 typename boost::add_reference<typename boost::add_const<E>::type>::type at_c (
00091     const detail::homogeneous_channel_base<E,L,N>& p);
00092 
00093 #if !defined(_MSC_VER)  || _MSC_VER > 1310
00094 template <typename P, typename C, typename L> struct packed_frame;
00095 template <int K, typename P, typename C, typename L>
00096 typename kth_element_reference_type<packed_frame<P,C,L>, K>::type 
00097 at_c (packed_frame<P,C,L>& p);
00098 
00099 template <int K, typename P, typename C, typename L>
00100 typename kth_element_const_reference_type<packed_frame<P,C,L>,K>::type 
00101 at_c (const packed_frame<P,C,L>& p);
00102 
00103 template <typename B, typename C, typename L, bool M>
00104 struct bit_aligned_frame_reference;
00105 
00106 template <int K, typename B, typename C, typename L, bool M> inline
00107 typename kth_element_reference_type<
00108     bit_aligned_frame_reference<B,C,L,M>, K>::type
00109 at_c(const bit_aligned_frame_reference<B,C,L,M>& p);
00110 #endif
00111 
00112 /* Forward-declare semantic_at_c */
00113 template <int K, typename ChannelBase>
00114 typename boost::disable_if<
00115     boost::is_const<ChannelBase>,
00116     typename kth_semantic_element_reference_type<ChannelBase,K>::type>::type
00117 semantic_at_c (ChannelBase& p);
00118 
00119 template <int K, typename ChannelBase>
00120 typename kth_semantic_element_const_reference_type<ChannelBase,K>::type
00121 semantic_at_c(const ChannelBase& p);
00122 
00123 namespace detail
00124 {
00125 
00126 template <typename T>
00127 void initialize_it (T& x) {}
00128 
00129 } /* namespace detail */
00130 
00131 template <typename T>
00132 struct remove_const_and_reference :
00133         public boost::remove_const<typename boost::remove_reference<T>::type> {};
00134 
00135 } /* namespace sound */
00136 } /* namespace psynth */
00137 
00138 #endif /* PSYNTH_SOUND_FORWARDS_H_ */