GNU Radio's LFAST Package
CC2F2ByteVector_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2017 ghostop14.
4  *
5  * This is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * any later version.
9  *
10  * This software is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this software; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef INCLUDED_TESTTIMING_CC2F2BYTEVECTOR_IMPL_H
22 #define INCLUDED_TESTTIMING_CC2F2BYTEVECTOR_IMPL_H
23 
24 #include <lfast/CC2F2ByteVector.h>
25 #include <boost/thread/thread.hpp>
26 
27 #define LF_MAX_THREADS 8
28 
29 namespace gr {
30  namespace lfast {
31 
33  {
34  protected:
35  int d_scale;
36  int d_vlen;
37 
38  boost::thread *threads[LF_MAX_THREADS];
42  const gr_complex *inBuffer;
43  char *outBuffer;
44 
46  unsigned concurrentMinus1;
47 
49 
50  boost::mutex d_mutex;
51 
52  float min_val = -128;
53  float max_val = 127;
54 
55  float *floatBuff = NULL;
57 
58  void processItems(int threadIndex);
59 
60  public:
61  CC2F2ByteVector_impl(int scale,int vecLength,int numVecItems);
63  virtual bool stop();
64  void setBufferLength(int numItems);
65 
66  // Where all the action really happens
67  int work_original(int noutput_items,
68  gr_vector_const_void_star &input_items,
69  gr_vector_void_star &output_items);
70  int work_test(int noutput_items,
71  gr_vector_const_void_star &input_items,
72  gr_vector_void_star &output_items);
73  int work(int noutput_items,
74  gr_vector_const_void_star &input_items,
75  gr_vector_void_star &output_items);
76  };
77 
78  } // namespace testtiming
79 } // namespace gr
80 
81 #endif /* INCLUDED_TESTTIMING_CC2F2BYTEVECTOR_IMPL_H */
82 
<+description of block+>
Definition: CC2F2ByteVector.h:36
void setBufferLength(int numItems)
boost::thread * threads[LF_MAX_THREADS]
Definition: CC2F2ByteVector_impl.h:38
long threadBlockSize[LF_MAX_THREADS]
Definition: CC2F2ByteVector_impl.h:40
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
int curBufferSize
Definition: CC2F2ByteVector_impl.h:56
int work_original(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Definition: CC2F2ByteVector_impl.h:32
#define LF_MAX_THREADS
Definition: CC2F2ByteVector_impl.h:27
void processItems(int threadIndex)
float max_val
Definition: CC2F2ByteVector_impl.h:53
int work_test(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
bool stopThreads
Definition: CC2F2ByteVector_impl.h:48
bool dataReady[LF_MAX_THREADS]
Definition: CC2F2ByteVector_impl.h:39
unsigned concurentThreadsSupported
Definition: CC2F2ByteVector_impl.h:45
boost::mutex d_mutex
Definition: CC2F2ByteVector_impl.h:50
float * floatBuff
Definition: CC2F2ByteVector_impl.h:55
CC2F2ByteVector_impl(int scale, int vecLength, int numVecItems)
long startIndex[LF_MAX_THREADS]
Definition: CC2F2ByteVector_impl.h:41
char * outBuffer
Definition: CC2F2ByteVector_impl.h:43
int d_vlen
Definition: CC2F2ByteVector_impl.h:36
float min_val
Definition: CC2F2ByteVector_impl.h:52
const gr_complex * inBuffer
Definition: CC2F2ByteVector_impl.h:42
int d_scale
Definition: CC2F2ByteVector_impl.h:35
unsigned concurrentMinus1
Definition: CC2F2ByteVector_impl.h:46