TaggedObject.h

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.2 $
00022 // $Date: 2003/02/14 23:02:10 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/tagged/TaggedObject.h,v $
00024                                                                         
00025                                                                         
00026 #ifndef TaggedObject_h
00027 #define TaggedObject_h
00028 
00029 // File: ~/tagged/TaggedObject.h
00030 //
00031 // Written: fmk 
00032 // Created: 11/96
00033 // Revision: A
00034 //
00035 // Description: This file contains the class definition for TaggedObject.
00036 // A TaggedObject is an object with an integer identifier. It is used as
00037 // a base class by DomainComponent, Graph and other classes in the framework.
00038 //
00039 // What: "@(#) TaggedObject.h, revA"
00040 
00041 #include <OPS_Stream.h>
00042 
00043 class Domain;
00044 
00045 class TaggedObject 
00046 {
00047   public:
00048     TaggedObject(int tag);
00049     virtual ~TaggedObject();
00050 
00051     inline int getTag(void) const;
00052 
00053     virtual void Print(OPS_Stream &s, int flag =0) =0;       
00054     friend OPS_Stream &operator<<(OPS_Stream &s, TaggedObject &m);        
00055 
00056   protected:
00057     void setTag(int newTag);  // CAUTION: this is a dangerous method to call
00058     
00059   private:    
00060     int theTag;    
00061 };
00062 
00063 // INLINED TAGGED_OBJECT FUNCTIONS
00064 
00065 inline int 
00066 TaggedObject::getTag(void) const
00067 {
00068     return theTag;
00069 }
00070 
00071 #endif
00072 
00073 

Generated on Mon Oct 23 15:05:30 2006 for OpenSees by doxygen 1.5.0