00001 /*************************************************************************** 00002 seqdelayvec.h - description 00003 ------------------- 00004 begin : Mon Oct 7 2002 00005 copyright : (C) 2001 by Thies H. Jochimsen 00006 email : jochimse@cns.mpg.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef SEQDELAYVEC_H 00019 #define SEQDELAYVEC_H 00020 00021 #include <odinseq/seqobj.h> 00022 #include <odinseq/seqvec.h> 00023 #include <odinseq/seqdriver.h> 00024 00029 class SeqDelayVecDriver : public SeqDriverBase { 00030 00031 public: 00032 SeqDelayVecDriver() {} 00033 virtual ~SeqDelayVecDriver() {} 00034 00035 virtual bool prep_driver() = 0; 00036 00037 virtual STD_string get_program(programContext& context, double duration) const = 0; 00038 00039 virtual bool unroll_program() const = 0; 00040 00041 virtual SeqDelayVecDriver* clone_driver() const = 0; 00042 }; 00043 00045 00046 00058 class SeqDelayVector : public SeqObjBase, public SeqVector { 00059 00060 public: 00061 00067 SeqDelayVector(const STD_string& object_label,const dvector& delaylist); 00068 00069 00073 SeqDelayVector(const STD_string& object_label = "unnamedSeqDelayVector"); 00074 00075 00079 SeqDelayVector(const SeqDelayVector& sdv); 00080 00081 00085 SeqDelayVector& operator = (const SeqDelayVector& sdv); 00086 00087 00092 SeqDelayVector& set_delayvector(const dvector& delaylist); 00093 00098 dvector get_delayvector() const; 00099 00100 00101 // overloading virtual function from SeqTreeObj 00102 double get_duration() const; 00103 STD_string get_program(programContext& context) const; 00104 SeqValList get_delayvallist() const; 00105 00106 private: 00107 00108 // overwriting virtual functions from SeqClass 00109 bool prep(); 00110 00111 // overloading virtual function from SeqVector 00112 unsigned int get_vectorsize() const; 00113 bool needs_unrolling_check() const {return delayvecdriver->unroll_program();} 00114 00115 mutable SeqDriverInterface<SeqDelayVecDriver> delayvecdriver; 00116 00117 dvector delayvec; 00118 00119 }; 00120 00121 00126 #endif
1.7.1