00001 /******************************************************************************* 00002 * Copyright (c) 2006 International Business Machines Corporation 00003 * All rights reserved. This program and the accompanying materials 00004 * are made available under the terms of the Common Public License v1.0 00005 * which accompanies this distribution, and is available at 00006 * http://www.opensource.org/licenses/cpl1.0.php 00007 * 00008 * Contributors: 00009 * Douglas Sprague, Joel Wheeler - initial API and implementation 00010 * 00011 *****************************************************************************/ 00012 00013 #ifndef STILPatternBurst_H 00014 #define STILPatternBurst_H 00015 00016 00017 #include "stilcom.h" // Common 00018 #include "stilcomstr.h" 00019 #include "stilpatlist.h" 00020 00021 #include <list> // STL doubly linked list class 00022 00023 00024 //--------------------------------------------------------------------------- 00033 //--------------------------------------------------------------------------- 00034 class STILPatternBurst : public STILPatternBurstBlock { 00035 00036 // - Global std::ostream << operator as friend to output STILPatternBurst object 00037 friend std::ostream& operator<<( std::ostream &os, const STILPatternBurst &); 00038 00039 public: 00040 00041 // - Default Constructor 00042 STILPatternBurst(); 00043 00044 // - Copy Constructor 00045 STILPatternBurst(const STILPatternBurst &); 00046 00047 // - Destructor which frees storage associated to a STILPatternBurst object 00048 virtual ~STILPatternBurst(); 00049 00050 // - Assignment operator 00051 STILPatternBurst & operator=(const STILPatternBurst &); 00052 00053 // - Member function to update Entity list pointers to link list nodes 00054 void updateEntityList(); 00055 00056 // - Member function to initialize a PatternBurst object 00057 void init(); 00058 00059 // - Member function to write the PatternBurst block 00060 virtual void write(FILE * pOutFile, LONG indentation=0) const; 00061 00062 // - Member function to add a PatList block 00063 void addPatList(const STILPatList& patlist); 00064 00065 // - Member function to see if a PatternBurst name matches any of its 00066 // PatList names (circular recursion) 00067 bool locateInPatLists(const sstring& name) const; 00068 00069 // - Member function to search for a pattern in the PatternBurst hierarchy 00070 // note: class STILPatternBursts is declared in "stilpatlist.h" 00071 void findPattern( 00072 const sstring& patname, 00073 std::list<STILEntity*>& find_list) const; 00074 00075 private: 00076 00077 // Note: inherit everything from STILPatList_item 00078 00079 // - A list of lists of PatList_items (Patterns or nested PatternBursts) 00080 std::list<STILPatList> m_patListLists; 00081 00082 }; // end STILPatternBurst class 00083 00084 #endif