switch source package format to 3.0 quilt
[debian/gnuradio] / pmt / src / lib / pmt_int.h
index 73354641216a3f05deb37d250cd82370eb64c0b5..285244cb5f0b7ac72a77876dc1885ca6a2791b90 100644 (file)
@@ -6,7 +6,7 @@
  * 
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * GNU Radio is distributed in the hope that it will be useful,
  * 
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
  */
 #ifndef INCLUDED_PMT_INT_H
 #define INCLUDED_PMT_INT_H
 
 #include <pmt.h>
+#include <boost/utility.hpp>
 
 /*
  * EVERYTHING IN THIS FILE IS PRIVATE TO THE IMPLEMENTATION!
  * See pmt.h for the public interface
  */
 
-class pmt_base {
+#define PMT_LOCAL_ALLOCATOR 0          // define to 0 or 1
+
+class pmt_base : boost::noncopyable {
 protected:
   pmt_base(){};
   virtual ~pmt_base();
 
-private:
-  pmt_base(const pmt_base& rhs);               // NOT IMPLEMENTED
-  pmt_base& operator=(const pmt_base& rhs);    // NOT IMPLEMENTED
-  
-
 public:
   virtual bool is_bool()    const { return false; }
   virtual bool is_symbol()  const { return false; }
@@ -51,6 +49,26 @@ public:
   virtual bool is_pair()    const { return false; }
   virtual bool is_vector()  const { return false; }
   virtual bool is_dict()    const { return false; }
+  virtual bool is_any()     const { return false; }
+
+  virtual bool is_uniform_vector() const { return false; }
+  virtual bool is_u8vector()  const { return false; }
+  virtual bool is_s8vector()  const { return false; }
+  virtual bool is_u16vector() const { return false; }
+  virtual bool is_s16vector() const { return false; }
+  virtual bool is_u32vector() const { return false; }
+  virtual bool is_s32vector() const { return false; }
+  virtual bool is_u64vector() const { return false; }
+  virtual bool is_s64vector() const { return false; }
+  virtual bool is_f32vector() const { return false; }
+  virtual bool is_f64vector() const { return false; }
+  virtual bool is_c32vector() const { return false; }
+  virtual bool is_c64vector() const { return false; }
+
+# if (PMT_LOCAL_ALLOCATOR)
+  void *operator new(size_t);
+  void operator delete(void *, size_t);
+#endif
 };
 
 class pmt_bool : public pmt_base
@@ -87,6 +105,7 @@ public:
   pmt_integer(long value);
   //~pmt_integer(){}
 
+  bool is_number()  const { return true; }
   bool is_integer() const { return true; }
   long value() const { return d_value; }
 };
@@ -99,6 +118,7 @@ public:
   pmt_real(double value);
   //~pmt_real(){}
 
+  bool is_number()  const { return true; }
   bool is_real() const { return true; }
   double value() const { return d_value; }
 };
@@ -111,6 +131,7 @@ public:
   pmt_complex(std::complex<double> value);
   //~pmt_complex(){}
 
+  bool is_number()  const { return true; }
   bool is_complex() const { return true; }
   std::complex<double> value() const { return d_value; }
 };
@@ -175,4 +196,29 @@ public:
   pmt_t values() const;
 };
 
+class pmt_any : public pmt_base
+{
+  boost::any   d_any;
+
+public:
+  pmt_any(const boost::any &any);
+  //~pmt_any();
+
+  bool is_any() const { return true; }
+  const boost::any &ref() const { return d_any; }
+  void  set(const boost::any &any) { d_any = any; }
+};
+
+
+class pmt_uniform_vector : public pmt_base
+{
+public:
+  bool is_uniform_vector() const { return true; }
+  virtual const void *uniform_elements(size_t &len) = 0;
+  virtual void *uniform_writable_elements(size_t &len) = 0;
+  virtual size_t length() const = 0;
+};
+
+#include "pmt_unv_int.h"
+
 #endif /* INCLUDED_PMT_INT_H */