sequence_controller.hpp
Go to the documentation of this file.
00001 /* 00002 Copyright 2005-2007 Adobe Systems Incorporated 00003 Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt 00004 or a copy at http://stlab.adobe.com/licenses.html) 00005 */ 00006 00007 /******************************************************************************/ 00008 00009 #ifndef ADOBE_SEQUENCE_CONTROLLER_HPP 00010 #define ADOBE_SEQUENCE_CONTROLLER_HPP 00011 00012 /******************************************************************************/ 00013 00014 #include <boost/concept_check.hpp> 00015 #include <boost/function.hpp> 00016 00017 #include <adobe/poly_sequence_model.hpp> 00018 #include <adobe/vector.hpp> 00019 00020 /******************************************************************************/ 00021 00022 namespace adobe { 00023 00024 /******************************************************************************/ 00031 /******************************************************************************/ 00037 template <class SequenceController> 00038 struct sequence_controller_value_type 00039 { 00041 typedef typename SequenceController::value_type type; 00042 }; 00043 00044 /******************************************************************************/ 00050 template <class SC> // SC models SequenceController 00051 inline void monitor_sequence(SC& v, 00052 typename poly_sequence_model<typename sequence_controller_value_type<SC>::type>::type& sequence) 00053 { v.monitor_sequence(sequence); } 00054 00055 /******************************************************************************/ 00061 template <class SequenceController> 00062 struct SequenceControllerConcept 00063 { 00065 typedef typename sequence_controller_value_type<SequenceController>::type value_type; 00066 00068 void constraints() 00069 { 00070 monitor_sequence(*controller, *sequence); 00071 } 00072 00074 static void monitor_sequence(SequenceController& controller, typename poly_sequence_model<value_type>::type& sequence) 00075 { 00076 using adobe::monitor_sequence; 00077 00078 monitor_sequence(controller, sequence); 00079 } 00080 00081 #ifndef ADOBE_NO_DOCUMENTATION 00082 SequenceController* controller; 00083 typename poly_sequence_model<value_type>::type* sequence; 00084 #endif 00085 }; 00086 00087 /******************************************************************************/ 00092 template <class T> 00093 struct SequenceControllerConcept<boost::reference_wrapper<T> > : SequenceControllerConcept<T> 00094 { 00095 void constraints() { 00096 //boost concept check lib gets confused on VC8 without this 00097 SequenceControllerConcept<T>::constraints(); 00098 } 00099 }; 00100 00101 /******************************************************************************/ 00102 00103 } // namespace adobe 00104 00105 /******************************************************************************/ 00106 00107 // ADOBE_SEQUENCE_CONTROLLER_HPP 00108 #endif 00109 00110 /******************************************************************************/ |