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 STILTerminationItem_H 00014 #define STILTerminationItem_H 00015 00016 #include "stilcom.h" // Common macros, typedefs 00017 #include "stilsigrefexpr.h" // STILSigRefExpr interface 00018 #include "stiltermination.h" // STILTermination enumeration 00019 00020 //--------------------------------------------------------------------------- 00026 //--------------------------------------------------------------------------- 00027 class STILTerminationItem { 00028 00029 public: 00030 00031 // - Default Constructor for a STILTerminationItem object. 00032 STILTerminationItem(); 00033 00034 // - Constructor a STILTerminationItem object from another STILTerminationItem 00035 STILTerminationItem(const STILTerminationItem &); 00036 00037 // - Destructor for a STILTerminationItem object. 00038 ~STILTerminationItem(); 00039 00040 // _ Initialize the object 00041 void init(); 00042 00043 // - Assignment operator for a STILTerminationItem object. 00044 STILTerminationItem & operator=(const STILTerminationItem &); 00045 00046 // - Equals operator for a STILTerminationItem object (to make STL happy) 00047 bool operator==(const STILTerminationItem &) const; 00048 00049 // - LT operator for a STILTerminationItem object (also to make STL happy) 00050 bool operator<(const STILTerminationItem &) const; 00051 00052 // - Write the STILTerminationItem object to a FILE 00053 virtual void write(FILE * pOutFile, LONG indentation=0) const; 00054 00055 00056 // - Set/Get the SigRefExpr for this STILTerminationItem 00057 //const STILSigRefExpr * getSigRefExpr(); 00058 void setSigRefExpr(const STILSigRefExpr&); 00059 00060 // - Set/Getthe Termination for this STILTerminationItem 00061 //STILTermination getTermination(); 00062 void setTermination(STILTermination); 00063 00064 private: 00065 00066 // The termination state: 00067 STILTermination m_termination; 00068 00069 // The signal reference expression: 00070 STILSigRefExpr m_sigRef; 00071 00072 }; // end STILTerminationItem class 00073 00074 //INLINE functions: 00075 //-------------------------------------------------------------------------- 00083 //-------------------------------------------------------------------------- 00084 inline void STILTerminationItem::setTermination (STILTermination t) { 00085 m_termination = t; 00086 } 00087 00088 //-------------------------------------------------------------------------- 00096 //-------------------------------------------------------------------------- 00097 inline void STILTerminationItem::setSigRefExpr(const STILSigRefExpr& sre) { 00098 m_sigRef = sre; 00099 } 00100 00101 // These functions aren't used, but STL needs them to be defined. 00102 inline bool STILTerminationItem::operator==(const STILTerminationItem & ti1) const { 00103 return ( ((*this).m_termination == ti1.m_termination) && ((*this).m_sigRef == ti1.m_sigRef) ); 00104 } 00105 00106 inline bool STILTerminationItem::operator<(const STILTerminationItem & ti1) const { 00107 return false; 00108 } 00109 00110 #endif