GNU   davin.50webs.com/research
Bringing to you notes for the ages

       Main Menu          Research Projects         Photo Album            Curriculum Vitae      The Greatest Artists
    Email Address       Computer Games          Web Design          Java Training Wheels      The Fly (A Story)   
  Political Activism   Scruff the Cat       My Life Story          Smoking Cessation          Other Links      
Debugging Macros     String Class I     Linked List System I Java for C Programmers Naming Convention
    String Class II         How I use m4              Strings III                 Symmetrical I/O             Linked Lists II     
Run-Time Type Info   Virtual Methods      An Array System        Science & Religion            Submodes       
  Nested Packages      Memory Leaks    Garbage Collection      Internet & Poverty      What is Knowledge?
Limits of Evolution   Emacs Additions      Function Plotter           Romantic Love        The Next Big Thing
    Science Fiction     Faster Compilation Theory of Morality         Elisp Scoping               Elisp Advice      
  S.O.G.M. Pattern       Safe Properties         School Bullying          Charisma Control          Life and Death    
     Splitting Java          Multiple Ctors       Religious Beliefs         Conversation 1           Conversation 2    
   J.T.W. Language    Emacs Additions II      Build Counter             Relation Plotter          Lisp++ Language  
  Memory Leaks II   Super Constructors CRUD Implementation Order a Website Form There Is An Afterlife
More Occam's Razor C to Java Translator Theory of Morality II


_Double.hh

    
#ifndef ALREADY_INCLUDED_2006_LIBD__DOUBLE_HH
#define ALREADY_INCLUDED_2006_LIBD__DOUBLE_HH

#include "libd.hh"

namespace dmp
{
   ///
   /// NOTE: size = 4 + 12 = 16
   ///
   class Double : private Single
   {
   public:
      double v;
      rtti_same(Double);

private:
      Double(double v) : Single(DCODE_DOUBLE)
      {
         this->v = v;
      }

public:
      static ptr<Double> ctor()
      {
         return new Double(0);
      }
      static ptr<Double> ctor(double v)
      {
         return new Double(v);
      }

private:
      ///
      /// NOTE: opens up ~Double() to ptr class
      ///
      template <class T> friend class ptr;
      ~Double()
      {
         ///
         /// NOTE: do nothing
         ///
      }

      //public:
      //   friend void supress_compiler_warning();

#ifdef DAVINS_IO_ONLINE
      friend dmp::Writer& operator << (dmp::Writer& w, Double& d)
      {
         ASSERT(&w != null);
         ASSERT(&d != null);
         w << d.v;
         return w;
      }
#endif /* DAVINS_IO_ONLINE */

      ///
      /// NOTE: disables passing and returning by value
      ///
   private:
      Double(const Double&);
      Double& operator = (const Double&);
   };

class Float : private Single
   {
   public:
      float v;

private:
      Float(float v) : Single(DCODE_FLOAT)
      {
         this->v = v;
      }

public:
      static ptr<Float> ctor()
      {
         return new Float(0);
      }
      static ptr<Float> ctor(float v)
      {
         return new Float(v);
      }

private:
      ///
      /// NOTE: opens up ~Float() to ptr class
      ///
      template <class T> friend class ptr;
      ~Float()
      {
         ///
         /// NOTE: do nothing
         ///
      }

      //public:
      //   friend void supress_compiler_warning();

#ifdef DAVINS_IO_ONLINE
      friend dmp::Writer& operator << (dmp::Writer& w, Float& d)
      {
         ASSERT(&w != null);
         ASSERT(&d != null);
         w << d.v;
         return w;
      }
#endif /* DAVINS_IO_ONLINE */

      ///
      /// NOTE: disables passing and returning by value
      ///
   private:
      Float(const Float&);
      Float& operator = (const Float&);
   };
}

#endif /* ALREADY_INCLUDED_2006_LIBD__DOUBLE_HH */
Back
| Main Menu | Research Projects | Photo Album | Curriculum Vitae | The Greatest Artists |
| Email Address | Computer Games | Web Design | Java Training Wheels | The Fly (A Story) |
| Political Activism | Scruff the Cat | My Life Story | Smoking Cessation | Other Links |
| Debugging Macros | String Class I | Linked List System I | Java for C Programmers | Naming Convention |
| String Class II | How I use m4 | Strings III | Symmetrical I/O | Linked Lists II |
| Run-Time Type Info | Virtual Methods | An Array System | Science & Religion | Submodes |
| Nested Packages | Memory Leaks | Garbage Collection | Internet & Poverty | What is Knowledge? |
| Limits of Evolution | Emacs Additions | Function Plotter | Romantic Love | The Next Big Thing |
| Science Fiction | Faster Compilation | Theory of Morality | Elisp Scoping | Elisp Advice |
| S.O.G.M. Pattern | Safe Properties | School Bullying | Charisma Control | Life and Death |
| Splitting Java | Multiple Ctors | Religious Beliefs | Conversation 1 | Conversation 2 |
| J.T.W. Language | Emacs Additions II | Build Counter | Relation Plotter | Lisp++ Language |
| Memory Leaks II | Super Constructors | CRUD Implementation | Order a Website Form | There Is An Afterlife |
| More Occam's Razor | C to Java Translator | Theory of Morality II
Last modified: Sat Oct 29 20:43:18 NZDT 2016
Best viewed at 800x600 or above resolution.
© Copyright 1999-2016 Davin Pearson.
Please report any broken links to