00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TORC_GENERIC_OM_SIMULATIONINFO_HPP
00017 #define TORC_GENERIC_OM_SIMULATIONINFO_HPP
00018
00019 #include "torc/generic/om/PointerTypes.hpp"
00020 #include "torc/generic/util/Error.hpp"
00021 #include "torc/generic/om/Commentable.hpp"
00022 #include "torc/generic/om/ParentedObject.hpp"
00023 #include "torc/generic/om/Visitable.hpp"
00024 #include "torc/generic/om/VisitorType.hpp"
00025 #include "torc/generic/om/FactoryType.hpp"
00026 #include "torc/generic/om/SelfReferencing.hpp"
00027 #include "torc/generic/om/SymTab.hpp"
00028 #include "torc/generic/om/UserDataContainer.hpp"
00029
00030 #include <list>
00031 #include <vector>
00032
00033 namespace torc { namespace generic { class BaseVisitor; } }
00034 namespace torc { namespace generic { class Library; } }
00035 namespace torc { namespace generic { class LogicValue; } }
00036
00037 namespace torc {
00038
00039 namespace generic {
00040
00041
00042
00043
00044
00045 class SimulationInfo :
00046 public Commentable,
00047 public Visitable,
00048 public ParentedObject<Library>,
00049 public SelfReferencing<SimulationInfo>,
00050 public UserDataContainer {
00051
00052 friend class FactoryType<SimulationInfo>;
00053
00054 public:
00055
00056
00057
00058 typedef VisitorType<SimulationInfo> Visitor;
00059
00060
00061
00062
00063 class Factory: public FactoryType<SimulationInfo>
00064 {
00065 public:
00066 using FactoryType<SimulationInfo>::create;
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 virtual SimulationInfoSharedPtr
00077 newSimulationInfoPtr( const std::vector< LogicValueSharedPtr > & inLogicValues,
00078 const LibrarySharedPtr & inLibraryPtr ) throw(Error);
00079 };
00080
00081 virtual void
00082 accept(BaseVisitor & inoutVisitor) throw(Error);
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 void
00093 addLogicValue(const LogicValueSharedPtr & inLogicValue) throw(Error);
00094
00095
00096
00097
00098
00099
00100
00101
00102 LogicValueSharedPtr
00103 findLogicValue(const std::string & inName) throw();
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113 void
00114 removeLogicValue(const std::string &inName) throw(Error);
00115
00116
00117
00118
00119
00120
00121 inline void
00122 getLogicValues(
00123 std::vector< LogicValueSharedPtr > & outLogicValues) const throw();
00124
00125
00126
00127
00128
00129
00130 void
00131 setLogicValues(
00132 const std::vector< LogicValueSharedPtr > & inLogicValues) throw(Error);
00133
00134
00135
00136
00137
00138
00139 template<typename _Action>
00140 inline void
00141 applyOnAllLogicValues( const _Action &action ) throw(Error);
00142
00143 virtual
00144 ~SimulationInfo() throw();
00145
00146 protected:
00147 SimulationInfo();
00148
00149 private:
00150 SimulationInfo(const SimulationInfo & source) throw();
00151
00152 SimulationInfo &
00153 operator=(const SimulationInfo & source) throw();
00154
00155 SymTab< std::string, LogicValueSharedPtr > mLogicValueSymTab;
00156
00157 };
00158
00159
00160
00161
00162
00163
00164 inline void
00165 SimulationInfo::getLogicValues(
00166 std::vector< LogicValueSharedPtr > & outLogicValues) const throw() {
00167 mLogicValueSymTab.getValues( outLogicValues );
00168 }
00169
00170
00171
00172
00173
00174
00175 template<typename _Action>
00176 inline void
00177 SimulationInfo::applyOnAllLogicValues( const _Action &action ) throw(Error) {
00178 try
00179 {
00180 mLogicValueSymTab.applyOnAll( action );
00181 }
00182 catch(Error &e)
00183 {
00184 e.setCurrentLocation( __FUNCTION__, __FILE__, __LINE__ );
00185 throw;
00186 }
00187 }
00188
00189 }
00190
00191 }
00192 #endif // TORC_GENERIC_OM_SIMULATIONINFO_HPP