TOBI SignalServer  0.1
/home/breidi/Dropbox/signalserver/include/hardware/sine_generator.h
Go to the documentation of this file.
00001 /*
00002     This file is part of the TOBI SignalServer.
00003 
00004     Commercial Usage
00005     Licensees holding valid Graz University of Technology Commercial
00006     licenses may use this file in accordance with the Graz University
00007     of Technology Commercial License Agreement provided with the
00008     Software or, alternatively, in accordance with the terms contained in
00009     a written agreement between you and Graz University of Technology.
00010 
00011     --------------------------------------------------
00012 
00013     GNU General Public License Usage
00014     Alternatively, this file may be used under the terms of the GNU
00015     General Public License version 3.0 as published by the Free Software
00016     Foundation and appearing in the file gpl.txt included in the
00017     packaging of this file.  Please review the following information to
00018     ensure the GNU General Public License version 3.0 requirements will be
00019     met: http://www.gnu.org/copyleft/gpl.html.
00020 
00021     In case of GNU General Public License Usage ,the TOBI SignalServer
00022     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 the TOBI SignalServer. If not, see <http://www.gnu.org/licenses/>.
00029 
00030     Copyright 2010 Graz University of Technology
00031     Contact: SignalServer@tobi-project.org
00032 */
00033 
00049 #ifndef SINEGENERATOR_H
00050 #define SINEGENERATOR_H
00051 
00052 #include <vector>
00053 #include <map>
00054 
00055 #include <boost/cstdint.hpp>
00056 #include <boost/enable_shared_from_this.hpp>
00057 
00058 #include "hw_thread.h"
00059 #include "hardware/hw_thread_builder.h"
00060 #include "hardware/artificial_signal_source.h"
00061 
00062 
00063 namespace tobiss
00064 {
00065 //-----------------------------------------------------------------------------
00079 class SineGenerator : public ArtificialSignalSource /*, public boost::enable_shared_from_this<SineGenerator>*/
00080 {
00081   public:
00087     SineGenerator(boost::asio::io_service& io, ticpp::Iterator<ticpp::Element> hw);
00088 
00092     virtual ~SineGenerator();
00093 
00094 //    virtual void run();
00095 //    virtual void stop();
00096 
00097 //-----------------------------------------------
00098 
00099   private:
00105     void setHardware(ticpp::Iterator<ticpp::Element>const &hw);
00118     void genSine();
00119 
00123     void generateSignal()
00124     {
00125       genSine();
00126     }
00127 
00133     virtual void setDeviceSettings(ticpp::Iterator<ticpp::Element>const &father);
00139     virtual void setChannelSettings(ticpp::Iterator<ticpp::Element>const &father);
00140 
00141 //-----------------------------------------------
00142 
00143   private:
00144     static const HWThreadBuilderTemplateRegistrator<SineGenerator> factory_registrator_;
00145 
00146     boost::shared_ptr<SineGenerator>    shd_ptr_;
00147 };
00148 
00149 } // Namespace tobiss
00150 
00151 #endif // SINEGENERATOR_H
00152 
00153 //-----------------------------------------------------------------------------
 All Data Structures Files Functions Variables