TOBI Interface A
0.1
|
00001 /* 00002 This file is part of the TOBI Interface A (TiA) library. 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 Lesser General Public License Usage 00014 Alternatively, this file may be used under the terms of the GNU Lesser 00015 General Public License version 3.0 as published by the Free Software 00016 Foundation and appearing in the file lgpl.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/lgpl.html. 00020 00021 In case of GNU Lesser General Public License Usage ,the TiA library 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 Lesser General Public License 00028 along with the TiA library. If not, see <http://www.gnu.org/licenses/>. 00029 00030 Copyright 2010 Graz University of Technology 00031 Contact: TiA@tobi-project.org 00032 */ 00033 00041 #ifndef DATAPACKET_INTERFACE_H 00042 #define DATAPACKET_INTERFACE_H 00043 00044 #include <vector> 00045 #include <boost/cstdint.hpp> 00046 #include <iostream> 00047 00048 namespace tia 00049 { 00050 00057 class DataPacket 00058 { 00059 public: 00060 00061 virtual ~DataPacket() {} 00062 virtual void reset() = 0; 00063 virtual void reset(void* mem) = 0; 00064 00065 virtual void incPacketID() = 0; 00066 virtual void setPacketID(boost::uint64_t nr) = 0; 00067 virtual boost::uint64_t getPacketID() = 0; 00068 00069 virtual void insertDataBlock(std::vector<double> v, boost::uint32_t signal_flag, 00070 boost::uint16_t blocksize, bool prepend = false) = 0; 00071 00072 virtual void setConnectionPacketNr(boost::uint64_t) = 0; 00073 virtual boost::uint64_t getConnectionPacketNr() = 0; 00074 00075 virtual void setTimestamp() = 0; 00076 virtual boost::uint64_t getTimestamp() = 0; 00077 00078 virtual bool hasFlag(boost::uint32_t f) = 0; 00079 00080 virtual boost::uint16_t getNrOfSignalTypes() = 0; 00081 00082 virtual boost::uint32_t getFlags() = 0; 00083 00084 virtual std::vector<boost::uint16_t> getNrSamplesPerChannel() = 0; 00085 virtual std::vector<boost::uint16_t> getNrOfChannels() = 0; 00086 virtual std::vector<boost::uint16_t> getNrOfSamples() = 0; 00087 00088 virtual boost::uint16_t getNrSamplesPerChannel(boost::uint32_t flag) = 0; 00089 virtual boost::uint16_t getNrOfSamples(boost::uint32_t flag) = 0; 00090 virtual boost::uint16_t getNrOfChannels(boost::uint32_t flag) = 0; 00091 00092 virtual const std::vector<double>& getData() = 0; 00093 virtual std::vector<double> getSingleDataBlock(boost::uint32_t flag) = 0; 00094 00095 virtual void* getRaw() = 0; 00096 virtual boost::uint32_t getRawMemorySize() = 0; 00097 virtual boost::uint32_t getRequiredRawMemorySize() = 0; 00098 virtual boost::uint32_t getRequiredRawMemorySize(void* mem, boost::uint32_t bytes_available) = 0; 00099 00100 protected: 00101 DataPacket() {} 00102 00103 private: 00104 DataPacket(const DataPacket &src) { } 00105 virtual DataPacket& operator=(const DataPacket &src) {return *this;}; 00106 00107 00108 }; 00109 00110 } // Namespace tia 00111 00112 #endif // DATAPACKET_H