当前位置: 首页>>代码示例>>C++>>正文


C++ ConfigMap::setConfig方法代码示例

本文整理汇总了C++中ConfigMap::setConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigMap::setConfig方法的具体用法?C++ ConfigMap::setConfig怎么用?C++ ConfigMap::setConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigMap的用法示例。


在下文中一共展示了ConfigMap::setConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: cloneInstance

		/// \brief Clone an instance.
		/// \param inIntancePtr A pointer to the instance to be cloned.
		/// \param inCloneInstanceName The name of the clone.
		/// \details Clone an instance and its configuration. This function does not clone the 
		/// 	instance pins. Instance pins are handled when cloning nets, in function cloneNet.
		InstanceSharedPtr cloneInstance(InstanceSharedPtr inIntancePtr,
			const string& inCloneInstanceName) {

			// Clone inInstancePtr
			InstanceSharedPtr inInstanceClonePtr = Factory::newInstancePtr(inCloneInstanceName,
				inIntancePtr->getType(), inIntancePtr->getTile(), inIntancePtr->getSite(),
				inIntancePtr->getBonding());

			// Begin clone inIntance configuration
			// Get a begin iterator to inIntance config
			ConfigMap::const_iterator instanceConfigBegin = inIntancePtr->configBegin();
			// Get an end iterator to inIntance config
			ConfigMap::const_iterator instanceConfigEnd = inIntancePtr->configEnd();
			// Configuration map
			ConfigMap configMap;

			// Iterate over all configuration
			while(instanceConfigBegin != instanceConfigEnd) {

				// Get current setting
				const string setting = instanceConfigBegin->first;
				// Get current configuration
				const Config config = instanceConfigBegin->second;
				// Add (setting,configuration) to configuration map
				configMap.setConfig(setting, config);
				// Move to the next configuration
				instanceConfigBegin++;

			}

			// Add configurations to instance clone
			inInstanceClonePtr->addConfigs(configMap);
			// End clone inInstance configuration

			// Return cloned instance
			return inInstanceClonePtr;
		}
开发者ID:torc-isi,项目名称:torc,代码行数:42,代码来源:ModuleTransformer.hpp

示例2: cloneNet

		/// \brief Clone a net.
		/// \param inNetPtr A pointer to the net to be cloned.
		/// \param inNetCloneName The name of the clone.
		/// \param inModuleInstanceName The module instance name.
		/// \details Clone a net, its configuration, its sources, sinks and pips. For pips, the
		/// 	routethrough instances are droppped and not cloned.
		NetSharedPtr cloneNet(NetSharedPtr inNetPtr, const string& inNetCloneName,
			const string& inModuleInstanceName) {

			// Clone inNetPtr
			NetSharedPtr inNetClonePtr = Factory::newNetPtr(inNetCloneName, inNetPtr->getNetType());

			// Begin clone inNetPtr configuration
			// Get a begin iterator to net config
			ConfigMap::const_iterator netConfigBegin = inNetPtr->configBegin();
			// Get an end iterator to net config
			ConfigMap::const_iterator netConfigEnd = inNetPtr->configEnd();
			// Configuration map
			ConfigMap configMap;

			// Iterate over all configuration
			while(netConfigBegin != netConfigEnd) {

				// Get current setting
				const string setting = netConfigBegin->first;
				// Get current configuration
				const Config config = netConfigBegin->second;
				// Add (setting,configuration) to configuration map
				configMap.setConfig(setting, config);
				// Move to the next configuration
				netConfigBegin++;

			}

			// Add configurations to net clone
			inNetClonePtr->addConfigs(configMap);
			// End clone inNetPtr configuration

			// Begin clone inNetPtr sources
			// Get a begin iterator to net sources
			InstancePinSharedPtrConstIterator inNetSourcesBegin = inNetPtr->sourcesBegin();
			// Get an end iterator to net sources
			InstancePinSharedPtrConstIterator inNetSourcesEnd = inNetPtr->sourcesEnd();

			// Iterate over all source pins
			while(inNetSourcesBegin != inNetSourcesEnd) {

				// Get pointer to current net pin
				InstancePinSharedPtr instPinPtr = *inNetSourcesBegin;
				// Get net pin reference instance
				InstanceSharedPtr pinInstPtr = instPinPtr->getInstancePtr().lock();
				// Find the cloned instance that correspond to the pin reference instance
				InstanceSharedPtrIterator pinInstPtrCloneItr = mDesignPtr->findInstance(
					inModuleInstanceName + sHierarchySeparator + pinInstPtr->getName());
				// Clone source pin
				InstancePinSharedPtr instPinPtrClone 
					= Factory::newInstancePinPtr(*pinInstPtrCloneItr, instPinPtr->getPinName());
				// Add pin clone to the net clone
				inNetClonePtr->addSource(instPinPtrClone);
				// Move to next source
				inNetSourcesBegin++;

			}
			// End clone inNetPtr sources

			// Begin clone inNetPtr sinks
			// Get a begin iterator to net sinks
			InstancePinSharedPtrConstIterator inNetSinksBegin = inNetPtr->sinksBegin();
			// Get an end iterator to net sinks
			InstancePinSharedPtrConstIterator inNetSinksEnd = inNetPtr->sinksEnd();

			// Iterate over all sink pins
			while(inNetSinksBegin != inNetSinksEnd) {

				// Get pointer to current net pin
				InstancePinSharedPtr instPinPtr = *inNetSinksBegin;
				// Get net pin reference instance
				InstanceSharedPtr pinInstPtr = instPinPtr->getInstancePtr().lock();
				// Find the cloned instance that correspond to the pin reference instance
				InstanceSharedPtrIterator pinInstPtrCloneItr = mDesignPtr->findInstance(
					inModuleInstanceName + sHierarchySeparator + pinInstPtr->getName());
				// Clone sink pin
				InstancePinSharedPtr instPinPtrClone 
					= Factory::newInstancePinPtr(*pinInstPtrCloneItr, instPinPtr->getPinName());
				// Add pin clone to the net clone
				inNetClonePtr->addSink(instPinPtrClone);
				// Move to next sink
				inNetSinksBegin++;

			}
			// End clone inNetPtr sinks

			// Begin clone inNetPtr pips
			// Get a begin iterator to net pips
			PipConstIterator inNetPipsBegin = inNetPtr->pipsBegin();
			// Get an end iterator to net pips
			PipConstIterator inNetPipsEnd = inNetPtr->pipsEnd();

			// Iterate over all pips
			while(inNetPipsBegin != inNetPipsEnd) {
//.........这里部分代码省略.........
开发者ID:torc-isi,项目名称:torc,代码行数:101,代码来源:ModuleTransformer.hpp


注:本文中的ConfigMap::setConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。