Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

/magnus/back_end/SessionManager/include/ARC.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: ARC.h,v 1.1.1.1 1995/11/20 17:55:24 rogern Exp $
00003  */
00004 
00005 // Copyright (C) 1995 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 
00008 // Contents: Declaration of interface class ARC
00009 //
00010 // Principal Author: Roger Needham
00011 //
00012 // Status: complete
00013 //
00014 // Revision History:
00015 //
00016 
00017 #ifndef _ARC_H_
00018 #define _ARC_H_
00019 
00020 
00021 #include <iostream.h>
00022 
00023 
00024 //---------------------------------------------------------------------------//
00025 //------------------------------- ARC ---------------------------------------//
00026 //---------------------------------------------------------------------------//
00027 
00028 class ARC
00029 {
00030 public:
00031 
00032   ARC( ) : theARC( 0 ) { }
00033 
00034   operator int ( ) const { return theARC; }
00035 
00036   ARC operator + ( const ARC& arc ) const {
00037          return ARC( theARC + arc.theARC );
00038   }
00039 
00040   ARC operator - ( const ARC& arc ) const {
00041          return ARC( theARC - arc.theARC );
00042   }
00043 
00044   ARC operator += ( const ARC& arc ) {
00045          theARC += arc.theARC;
00046          return *this;
00047   }
00048 
00049   ARC operator -= ( const ARC& arc ) {
00050          theARC -= arc.theARC;
00051          return *this;
00052   }
00053 
00054   inline friend ostream& operator << ( ostream& ostr, const ARC& arc ) {
00055          return ostr << arc.theARC;
00056   }
00057 
00058 protected:
00059 
00060   friend class ComputationManager;
00061   friend class Supervisor;
00062 
00063   ARC( int i ) : theARC( i ) { }
00064   // Used by classes ComputationManager, Supervisor.
00065 
00066 private:
00067 
00068   int theARC;
00069 
00070 };
00071 
00072 
00073 struct ZeroARC : public ARC { ZeroARC( ) : ARC( 0 ) { } };
00074 
00075 struct OneARC : public ARC { OneARC( ) : ARC( 1 ) { } };
00076 
00077 #endif

Generated at Tue Jun 19 09:49:37 2001 for Magnus Classes by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001