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 STILVectorBlock_H 00014 #define STILVectorBlock_H 00015 00016 #include "stilcomstr.h" 00017 #include "stilblock.h" // STIL Block Interface (base class) 00018 #include "stilvectoritem.h" // STIL Vector Item Interface 00019 00020 #include <list> // STL Linked List Interface 00021 00022 //--------------------------------------------------------------------------- 00028 //--------------------------------------------------------------------------- 00029 class STILVectorBlock : public STILBlock { 00030 00031 // - Public members 00032 public: 00033 00034 // - Default Constructor 00035 STILVectorBlock(); 00036 00037 // - Construct given some entity type 00038 STILVectorBlock(Type t); 00039 00040 // - Copy Constructor 00041 STILVectorBlock(const STILVectorBlock &); 00042 00043 // - Destructor 00044 virtual ~STILVectorBlock(); 00045 00046 // - Assignment operator 00047 STILVectorBlock & operator=(const STILVectorBlock &); 00048 00049 // - Initialize this STILVectorBlock object. 00050 void init(); 00051 00052 // - Write out this object to a given FILE 00053 virtual void write(FILE * pOutFile, LONG indentation=0) const; 00054 00055 00056 // - Add a new STILVectorItem to this vector 00057 void addVectorItem(const STILVectorItem &); 00058 00059 // - Get flag indicating if this vector contains a vector item with 00060 // a "#" WFC 00061 bool getHasPoundSign() const; 00062 00063 // - Get flag indicating if this vector contains a vector item with 00064 // a "%" WFC 00065 bool getHasPercentSign() const; 00066 00067 // ***************************************************************** 00068 // ************************** NOTE ********************************* 00069 // ***************************************************************** 00070 // Only support cyclized data initially. Eventually support 00071 // multi-bit and non-cyclized data 00072 // ***************************************************************** 00073 00074 00075 // Private section 00076 private: 00077 00078 // Private functions 00079 void m_updateEntityList(); 00080 00081 // Private members 00082 std::list<STILVectorItem> m_vectorItemList; // List of vector items 00083 00084 bool m_hasPoundSign; // Does a vector item in this 00085 // vector contain a "#" 00086 00087 bool m_hasPercentSign; // Does a vector item in this 00088 // vector contain a "%" 00089 00090 }; // end STILVectorBlock class 00091 00092 00093 // inline functions 00094 //-------------------------------------------------------------------------- 00102 //-------------------------------------------------------------------------- 00103 inline bool STILVectorBlock::getHasPoundSign() const { return m_hasPoundSign; } 00104 00105 //-------------------------------------------------------------------------- 00113 //-------------------------------------------------------------------------- 00114 inline bool STILVectorBlock::getHasPercentSign() const { return m_hasPercentSign; } 00115 00116 00117 #endif