Polaris: IntElem.h Source File

IntElem.h

Go to the documentation of this file.
00001 ///
00002 ///
00003 #ifndef _INT_ELEM_H
00004 #define _INT_ELEM_H
00005 ///
00006 /// file IntElem.h
00007 ///
00008 #ifdef POLARIS_GNU_PRAGMAS
00009 #pragma interface
00010 #endif
00011 ///
00012 #include "ClassNames.h"
00013 #include "Listable.h"
00014 ///
00015 class IntElem   : public Listable {
00016  protected:
00017     int             _val;
00018 
00019  public:
00020     IntElem(int v) 
00021         { 
00022     #ifdef CLASS_INSTANCE_REGISTRY
00023     register_instance(INT_ELEM, sizeof(IntElem), this);
00024     #endif
00025       _val = v; }
00026 
00027     virtual         ~IntElem(); 
00028 
00029     int             value() const 
00030         { return _val; }
00031 
00032     void            value(int val) 
00033         { _val = val; }
00034 
00035     operator int () const
00036         { return _val; }
00037 
00038     inline void    print(ostream & o) const 
00039         { o << _val; }
00040 
00041     inline int     structures_OK() const 
00042         { return 1; }
00043 
00044     inline Listable *listable_clone() const 
00045         { return new IntElem(_val); }
00046 };
00047 
00048 #endif
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:05:55 2005