• Main Page
  • Packages
  • Classes
  • Files
  • File List
  • File Members

unlock/bci/acquire-c++/RandomSignal.hpp

Go to the documentation of this file.
00001 
00002 // Copyright (c) James Percent and Unlock contributors.
00003 // All rights reserved.
00004 // Redistribution and use in source and binary forms, with or without modification,
00005 // are permitted provided that the following conditions are met:
00006 //
00007 //    1. Redistributions of source code must retain the above copyright notice,
00008 //       this list of conditions and the following disclaimer.
00009 //    
00010 //    2. Redistributions in binary form must reproduce the above copyright
00011 //       notice, this list of conditions and the following disclaimer in the
00012 //       documentation and/or other materials provided with the distribution.
00013 //
00014 //    3. Neither the name of Unlock nor the names of its contributors may be used
00015 //       to endorse or promote products derived from this software without
00016 //       specific prior written permission.
00017 
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00019 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00020 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00021 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
00022 // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00023 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00024 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00025 // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00026 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00027 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00028 
00029 #ifndef RANDOM_SIGNAL_HPP
00030 #define RANDOM_SIGNAL_HPP
00031 
00032 #include <boost/random/mersenne_twister.hpp>
00033 
00034 #include "ISignal.hpp"
00035 #include "Portability.hpp"
00036 
00037 class DllExport RandomSignal : public ISignal
00038 {
00039  public:
00040   static const size_t MAC_ADDRESS_SIZE=6;    
00041 
00042  public:
00043   RandomSignal();
00044   virtual ~RandomSignal();
00045   virtual bool open(uint8_t* mac);
00046   virtual bool init(size_t channels);
00047   virtual size_t channels();
00048   virtual bool start();
00049   virtual size_t acquire();
00050   virtual void getdata(uint32_t* buffer, size_t samples);
00051   virtual uint64_t timestamp();
00052   virtual bool stop();
00053   virtual bool close();
00054 
00055  public:
00056   boost::random::mt19937 gen;
00057   size_t mOpenCount;
00058   bool mOpenRet;
00059   uint8_t mLastMac[MAC_ADDRESS_SIZE];
00060   size_t mInitCount;
00061   size_t mLastChannels;
00062   bool mInitRet;
00063   size_t mChannelsCount;
00064   size_t mStartCount;
00065   bool mStartRet;
00066   size_t mAcquireCount;
00067   size_t mAcquireRet;
00068   size_t mGetDataCount;
00069   uint32_t* mpLastGetData;
00070   size_t mLastSamples;
00071   size_t mTimestampCount;
00072   uint64_t mTimestampRet;
00073   size_t mStopCount;
00074   bool mStopRet;
00075   size_t mCloseCount;
00076   bool mCloseRet;       
00077 };
00078 
00079 #endif

Generated on Mon Nov 10 2014 11:09:08 for The Unlock Project by  doxygen 1.7.1