commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] pmt/src/lib pmt.h pmt_int.h


From: Eric Blossom
Subject: [Commit-gnuradio] pmt/src/lib pmt.h pmt_int.h
Date: Sat, 01 Jul 2006 23:28:02 +0000

CVSROOT:        /sources/gnuradio
Module name:    pmt
Changes by:     Eric Blossom <eb>       06/07/01 23:28:02

Modified files:
        src/lib        : pmt.h 
Added files:
        src/lib        : pmt_int.h 

Log message:
        work-in-progress

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pmt/src/lib/pmt.h?cvsroot=gnuradio&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/pmt/src/lib/pmt_int.h?cvsroot=gnuradio&rev=1.1

Patches:
Index: pmt.h
===================================================================
RCS file: /sources/gnuradio/pmt/src/lib/pmt.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- pmt.h       26 Jun 2006 23:20:21 -0000      1.3
+++ pmt.h       1 Jul 2006 23:28:02 -0000       1.4
@@ -38,12 +38,9 @@
  */
 
 /*!
- * \brief abstract base class of all pmt types
+ * \brief base class of all pmt types
  */
-class pmt_base {
-protected:
-  virtual ~pmt_base() = 0;
-};
+class pmt_base;
 
 /*!
  * \brief typedef for shared pointer (transparent reference counting).

Index: pmt_int.h
===================================================================
RCS file: pmt_int.h
diff -N pmt_int.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pmt_int.h   1 Jul 2006 23:28:02 -0000       1.1
@@ -0,0 +1,109 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * 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)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ */
+#ifndef INCLUDED_PMT_INT_H
+#define INCLUDED_PMT_INT_H
+
+#include <pmt.h>
+
+
+class pmt_base {
+protected:
+  virtual ~pmt_base() = 0;
+
+public:
+  virtual bool pmt_is_bool()    { return false; }
+  virtual bool pmt_is_symbol()  { return false; }
+  virtual bool pmt_is_number()  { return false; }
+  virtual bool pmt_is_integer() { return false; }
+  virtual bool pmt_is_real()    { return false; }
+  virtual bool pmt_is_complex() { return false; }
+};
+
+class pmt_bool : public pmt_base
+{
+public:
+  ~pmt_bool() {}
+
+  bool pmt_is_bool() { return true; }
+};
+
+
+class pmt_symbol : public pmt_base
+{
+  std::string  d_name;
+  
+public:
+  pmt_symbol(const std::string &name);
+  ~pmt_symbol() {}
+
+  bool pmt_is_symbol() { return true; }
+};
+
+class pmt_integer : public pmt_base
+{
+  long         d_value;
+
+public:
+  pmt_integer(long value);
+  ~pmt_integer() {}
+
+  bool pmt_is_integer() { return true; }
+  bool pmt_is_real()    { return true; }
+  bool pmt_is_complex() { return true; }
+};
+
+class pmt_real : public pmt_base
+{
+  double       d_value;
+
+public:
+  pmt_real(double value);
+  ~pmt_real() {}
+
+  bool pmt_is_real()    { return true; }
+  bool pmt_is_complex() { return true; }
+};
+
+class pmt_complex : public pmt_base
+{
+  std::complex<double> d_value;
+
+public:
+  pmt_real(std::complex<double> value);
+  ~pmt_real() {}
+
+  bool pmt_is_complex() { return true; }
+};
+
+class pmt_pair : public pmt_base
+{
+  pmt_t                d_car;
+  pmt_t                d_cdr;
+public:
+  pmt_pair(pmt_t car, pmt_t cdr);
+  ~pmt_pair();
+
+  bool pmt_is_pair() { return true; }
+};
+
+
+#endif /* INCLUDED_PMT_INT_H */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]