MapOfTaggedObjects.hGo 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/storage/MapOfTaggedObjects.h,v $ 00024 00025 00026 #ifndef MapOfTaggedObjects_h 00027 #define MapOfTaggedObjects_h 00028 00029 // File: ~/tagged/storage/MapOfTaggedObjects.h 00030 // 00031 // Written: fmk 00032 // Created: 02/00 00033 // Revision: A 00034 // 00035 // Description: This file contains the class definition for 00036 // MapOfTaggedObjects. MapOfTaggedObjects is a storage class. The class 00037 // is responsible for holding and providing access to objects of type 00038 // TaggedObject. A map template of the standard template class is used to store 00039 // the pointers to these objects. 00040 // 00041 // What: "@(#) MapOfTaggedObjects.h, revA" 00042 00043 00044 #include <TaggedObjectStorage.h> 00045 #include <MapOfTaggedObjectsIter.h> 00046 00047 class MapOfTaggedObjects : public TaggedObjectStorage 00048 { 00049 public: 00050 MapOfTaggedObjects(); 00051 ~MapOfTaggedObjects(); 00052 00053 // public methods to populate a domain 00054 int setSize(int newSize); 00055 bool addComponent(TaggedObject *newComponent); 00056 // bool allowMutltipleTags = false); 00057 TaggedObject *removeComponent(int tag); 00058 int getNumComponents(void) const; 00059 00060 TaggedObject *getComponentPtr(int tag); 00061 TaggedObjectIter &getComponents(); 00062 00063 MapOfTaggedObjectsIter getIter(); 00064 00065 TaggedObjectStorage *getEmptyCopy(void); 00066 void clearAll(bool invokeDestructor = true); 00067 00068 void Print(OPS_Stream &s, int flag =0); 00069 friend class MapOfTaggedObjectsIter; 00070 00071 protected: 00072 00073 private: 00074 map<int, TaggedObject *> theMap; // the map container for storing the pointers 00075 MapOfTaggedObjectsIter myIter; // the iter for this object 00076 }; 00077 00078 #endif 00079 00080 00081 |