GNU Radio 3.6.5 C++ API

pmt_unv_int.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2006,2009 Free Software Foundation, Inc.
00004  *
00005  * This file is part of GNU Radio
00006  *
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  *
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef INCLUDED_PMT_UNV_INT_H
00024 #define INCLUDED_PMT_UNV_INT_H
00025 
00026 ////////////////////////////////////////////////////////////////////////////
00027 //                           pmt_u8vector
00028 ////////////////////////////////////////////////////////////////////////////
00029 
00030 class pmt_u8vector : public pmt_uniform_vector
00031 {
00032   std::vector< uint8_t >        d_v;
00033 
00034 public:
00035   pmt_u8vector(size_t k, uint8_t fill);
00036   pmt_u8vector(size_t k, const uint8_t *data);
00037   // ~pmt_u8vector();
00038 
00039   bool is_u8vector() const { return true; }
00040   size_t length() const { return d_v.size(); }
00041   uint8_t ref(size_t k) const;
00042   void set(size_t k, uint8_t x);
00043   const uint8_t *elements(size_t &len);
00044   uint8_t *writable_elements(size_t &len);
00045   const void *uniform_elements(size_t &len);
00046   void *uniform_writable_elements(size_t &len);
00047 };
00048 
00049 ////////////////////////////////////////////////////////////////////////////
00050 //                           pmt_s8vector
00051 ////////////////////////////////////////////////////////////////////////////
00052 
00053 class pmt_s8vector : public pmt_uniform_vector
00054 {
00055   std::vector< int8_t > d_v;
00056 
00057 public:
00058   pmt_s8vector(size_t k, int8_t fill);
00059   pmt_s8vector(size_t k, const int8_t *data);
00060   // ~pmt_s8vector();
00061 
00062   bool is_s8vector() const { return true; }
00063   size_t length() const { return d_v.size(); }
00064   int8_t ref(size_t k) const;
00065   void set(size_t k, int8_t x);
00066   const int8_t *elements(size_t &len);
00067   int8_t *writable_elements(size_t &len);
00068   const void *uniform_elements(size_t &len);
00069   void *uniform_writable_elements(size_t &len);
00070 };
00071 
00072 ////////////////////////////////////////////////////////////////////////////
00073 //                           pmt_u16vector
00074 ////////////////////////////////////////////////////////////////////////////
00075 
00076 class pmt_u16vector : public pmt_uniform_vector
00077 {
00078   std::vector< uint16_t >       d_v;
00079 
00080 public:
00081   pmt_u16vector(size_t k, uint16_t fill);
00082   pmt_u16vector(size_t k, const uint16_t *data);
00083   // ~pmt_u16vector();
00084 
00085   bool is_u16vector() const { return true; }
00086   size_t length() const { return d_v.size(); }
00087   uint16_t ref(size_t k) const;
00088   void set(size_t k, uint16_t x);
00089   const uint16_t *elements(size_t &len);
00090   uint16_t *writable_elements(size_t &len);
00091   const void *uniform_elements(size_t &len);
00092   void *uniform_writable_elements(size_t &len);
00093 };
00094 
00095 ////////////////////////////////////////////////////////////////////////////
00096 //                           pmt_s16vector
00097 ////////////////////////////////////////////////////////////////////////////
00098 
00099 class pmt_s16vector : public pmt_uniform_vector
00100 {
00101   std::vector< int16_t >        d_v;
00102 
00103 public:
00104   pmt_s16vector(size_t k, int16_t fill);
00105   pmt_s16vector(size_t k, const int16_t *data);
00106   // ~pmt_s16vector();
00107 
00108   bool is_s16vector() const { return true; }
00109   size_t length() const { return d_v.size(); }
00110   int16_t ref(size_t k) const;
00111   void set(size_t k, int16_t x);
00112   const int16_t *elements(size_t &len);
00113   int16_t *writable_elements(size_t &len);
00114   const void *uniform_elements(size_t &len);
00115   void *uniform_writable_elements(size_t &len);
00116 };
00117 
00118 ////////////////////////////////////////////////////////////////////////////
00119 //                           pmt_u32vector
00120 ////////////////////////////////////////////////////////////////////////////
00121 
00122 class pmt_u32vector : public pmt_uniform_vector
00123 {
00124   std::vector< uint32_t >       d_v;
00125 
00126 public:
00127   pmt_u32vector(size_t k, uint32_t fill);
00128   pmt_u32vector(size_t k, const uint32_t *data);
00129   // ~pmt_u32vector();
00130 
00131   bool is_u32vector() const { return true; }
00132   size_t length() const { return d_v.size(); }
00133   uint32_t ref(size_t k) const;
00134   void set(size_t k, uint32_t x);
00135   const uint32_t *elements(size_t &len);
00136   uint32_t *writable_elements(size_t &len);
00137   const void *uniform_elements(size_t &len);
00138   void *uniform_writable_elements(size_t &len);
00139 };
00140 
00141 ////////////////////////////////////////////////////////////////////////////
00142 //                           pmt_s32vector
00143 ////////////////////////////////////////////////////////////////////////////
00144 
00145 class pmt_s32vector : public pmt_uniform_vector
00146 {
00147   std::vector< int32_t >        d_v;
00148 
00149 public:
00150   pmt_s32vector(size_t k, int32_t fill);
00151   pmt_s32vector(size_t k, const int32_t *data);
00152   // ~pmt_s32vector();
00153 
00154   bool is_s32vector() const { return true; }
00155   size_t length() const { return d_v.size(); }
00156   int32_t ref(size_t k) const;
00157   void set(size_t k, int32_t x);
00158   const int32_t *elements(size_t &len);
00159   int32_t *writable_elements(size_t &len);
00160   const void *uniform_elements(size_t &len);
00161   void *uniform_writable_elements(size_t &len);
00162 };
00163 
00164 ////////////////////////////////////////////////////////////////////////////
00165 //                           pmt_u64vector
00166 ////////////////////////////////////////////////////////////////////////////
00167 
00168 class pmt_u64vector : public pmt_uniform_vector
00169 {
00170   std::vector< uint64_t >       d_v;
00171 
00172 public:
00173   pmt_u64vector(size_t k, uint64_t fill);
00174   pmt_u64vector(size_t k, const uint64_t *data);
00175   // ~pmt_u64vector();
00176 
00177   bool is_u64vector() const { return true; }
00178   size_t length() const { return d_v.size(); }
00179   uint64_t ref(size_t k) const;
00180   void set(size_t k, uint64_t x);
00181   const uint64_t *elements(size_t &len);
00182   uint64_t *writable_elements(size_t &len);
00183   const void *uniform_elements(size_t &len);
00184   void *uniform_writable_elements(size_t &len);
00185 };
00186 
00187 ////////////////////////////////////////////////////////////////////////////
00188 //                           pmt_s64vector
00189 ////////////////////////////////////////////////////////////////////////////
00190 
00191 class pmt_s64vector : public pmt_uniform_vector
00192 {
00193   std::vector< int64_t >        d_v;
00194 
00195 public:
00196   pmt_s64vector(size_t k, int64_t fill);
00197   pmt_s64vector(size_t k, const int64_t *data);
00198   // ~pmt_s64vector();
00199 
00200   bool is_s64vector() const { return true; }
00201   size_t length() const { return d_v.size(); }
00202   int64_t ref(size_t k) const;
00203   void set(size_t k, int64_t x);
00204   const int64_t *elements(size_t &len);
00205   int64_t *writable_elements(size_t &len);
00206   const void *uniform_elements(size_t &len);
00207   void *uniform_writable_elements(size_t &len);
00208 };
00209 
00210 ////////////////////////////////////////////////////////////////////////////
00211 //                           pmt_f32vector
00212 ////////////////////////////////////////////////////////////////////////////
00213 
00214 class pmt_f32vector : public pmt_uniform_vector
00215 {
00216   std::vector< float >  d_v;
00217 
00218 public:
00219   pmt_f32vector(size_t k, float fill);
00220   pmt_f32vector(size_t k, const float *data);
00221   // ~pmt_f32vector();
00222 
00223   bool is_f32vector() const { return true; }
00224   size_t length() const { return d_v.size(); }
00225   float ref(size_t k) const;
00226   void set(size_t k, float x);
00227   const float *elements(size_t &len);
00228   float *writable_elements(size_t &len);
00229   const void *uniform_elements(size_t &len);
00230   void *uniform_writable_elements(size_t &len);
00231 };
00232 
00233 ////////////////////////////////////////////////////////////////////////////
00234 //                           pmt_f64vector
00235 ////////////////////////////////////////////////////////////////////////////
00236 
00237 class pmt_f64vector : public pmt_uniform_vector
00238 {
00239   std::vector< double > d_v;
00240 
00241 public:
00242   pmt_f64vector(size_t k, double fill);
00243   pmt_f64vector(size_t k, const double *data);
00244   // ~pmt_f64vector();
00245 
00246   bool is_f64vector() const { return true; }
00247   size_t length() const { return d_v.size(); }
00248   double ref(size_t k) const;
00249   void set(size_t k, double x);
00250   const double *elements(size_t &len);
00251   double *writable_elements(size_t &len);
00252   const void *uniform_elements(size_t &len);
00253   void *uniform_writable_elements(size_t &len);
00254 };
00255 
00256 ////////////////////////////////////////////////////////////////////////////
00257 //                           pmt_c32vector
00258 ////////////////////////////////////////////////////////////////////////////
00259 
00260 class pmt_c32vector : public pmt_uniform_vector
00261 {
00262   std::vector< std::complex<float> >    d_v;
00263 
00264 public:
00265   pmt_c32vector(size_t k, std::complex<float> fill);
00266   pmt_c32vector(size_t k, const std::complex<float> *data);
00267   // ~pmt_c32vector();
00268 
00269   bool is_c32vector() const { return true; }
00270   size_t length() const { return d_v.size(); }
00271   std::complex<float> ref(size_t k) const;
00272   void set(size_t k, std::complex<float> x);
00273   const std::complex<float> *elements(size_t &len);
00274   std::complex<float> *writable_elements(size_t &len);
00275   const void *uniform_elements(size_t &len);
00276   void *uniform_writable_elements(size_t &len);
00277 };
00278 
00279 ////////////////////////////////////////////////////////////////////////////
00280 //                           pmt_c64vector
00281 ////////////////////////////////////////////////////////////////////////////
00282 
00283 class pmt_c64vector : public pmt_uniform_vector
00284 {
00285   std::vector< std::complex<double> >   d_v;
00286 
00287 public:
00288   pmt_c64vector(size_t k, std::complex<double> fill);
00289   pmt_c64vector(size_t k, const std::complex<double> *data);
00290   // ~pmt_c64vector();
00291 
00292   bool is_c64vector() const { return true; }
00293   size_t length() const { return d_v.size(); }
00294   std::complex<double> ref(size_t k) const;
00295   void set(size_t k, std::complex<double> x);
00296   const std::complex<double> *elements(size_t &len);
00297   std::complex<double> *writable_elements(size_t &len);
00298   const void *uniform_elements(size_t &len);
00299   void *uniform_writable_elements(size_t &len);
00300 };
00301 
00302 #endif