torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::_impl Namespace Reference

Data Structures

class  Copier
 
class  Copier< class Root >
 
class  Copier< class Design >
 
class  Copier< class Library >
 
class  Copier< class Cell >
 
class  Copier< class Status >
 
class  Copier< class SimulationInfo >
 
class  Copier< class LogicValue >
 
class  Copier< class View >
 
class  Copier< class ScalarPort >
 
class  Copier< class ScalarPortReference >
 
class  Copier< class VectorPort >
 
class  Copier< class VectorPortReference >
 
class  Copier< class PortBundle >
 
class  Copier< class PortBundleReference >
 
class  Copier< class SingleInstance >
 
class  Copier< class ScalarNet >
 
class  Copier< class NetBundle >
 
class  Copier< class VectorNet >
 
class  Copier< class InstanceArray >
 
class  Copier< class SingleParameter >
 
class  Copier< class ParameterArray >
 
class  Copier< class Property >
 
class  Copier< class Port >
 
class  Copier< class PortReference >
 
class  Copier< class Net >
 
class  Copier< class Instance >
 
class  Copier< class Parameter >
 
class  Copier< class Permutable >
 
class  Copier< class InterfaceJoinedInfo >
 
class  Copier< class PortList >
 
class  Copier< class Simulate >
 
class  Copier< class LogicalResponse >
 
class  Copier< class Timing >
 
class  Copier< class ForbiddenEvent >
 
class  Copier< class Event >
 
class  Copier< class LogicElement >
 

Functions

template<typename _PointerType >
void copyObject (ScalarPort &inPort, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (ScalarPortReference &inPortRef, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (VectorPort &inPort, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (VectorPortReference &inPortRef, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (PortBundle &inPort, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (PortBundleReference &inPortRef, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (SingleInstance &inInstance, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (ScalarNet &inNet, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (NetBundle &inNet, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (VectorNet &inNet, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (InstanceArray &inInstanceArray, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (SingleParameter &inSingleParameter, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 
template<typename _PointerType >
void copyObject (ParameterArray &inParamArray, ObjectFactorySharedPtr &inFactory, _PointerType &outPointer) throw (Error)
 

Function Documentation

template<typename _PointerType >
void torc::generic::_impl::copyObject ( ScalarPort &  inPort,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 993 of file Cloning.hpp.

994  {
995  try {
996  ScalarPortSharedPtr scalarPort;
997  inFactory->create(scalarPort);
998  scalarPort->setComments(inPort.getComments());
999  scalarPort->setName(inPort.getName());
1000  scalarPort->setDirection(inPort.getDirection());
1001  scalarPort->setOriginalName(inPort.getOriginalName());
1002  scalarPort->setAttributes(inPort.getAttributes());
1003  scalarPort->setIsExtern(inPort.getIsExtern());
1004  scalarPort->setParent(inPort.getParent());
1005  scalarPort->setParentCollection(inPort.getParentCollection());
1006 
1007  std::list < std::string > userData;
1008  inPort.getUserData(userData);
1009  scalarPort->setUserData(userData);
1010 
1011  std::map<std::string, PropertySharedPtr> outProperties;
1012  std::vector<PropertySharedPtr> properties;
1013  inPort.getProperties(outProperties);
1014  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1015  it != outProperties.end(); ++it) {
1016  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1017  properties.push_back(clonedProperty);
1018  }
1019  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1020  it != properties.end(); ++it) {
1021  scalarPort->setProperty((*it)->getName(), *it);
1022  }
1023 
1024  outPointer = scalarPort;
1025  } catch(Error& e) {
1026  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1027  throw;
1028  }
1029 }
boost::shared_ptr< ScalarPort > ScalarPortSharedPtr
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< Property > PropertySharedPtr

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( ScalarPortReference &  inPortRef,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1064 of file Cloning.hpp.

1065  {
1066  try {
1067  ScalarPortReferenceSharedPtr portRefPtr;
1068  inFactory->create(portRefPtr);
1069  portRefPtr->setParent(inPortRef.getParent());
1070  portRefPtr->setParentCollection(inPortRef.getParentCollection());
1071  portRefPtr->setParent(inPortRef.getParent());
1072  portRefPtr->bindToMasterPort(inPortRef.getMaster());
1073  outPointer = portRefPtr;
1074  } catch(Error& e) {
1075  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1076  throw;
1077  }
1078 }
boost::shared_ptr< ScalarPortReference > ScalarPortReferenceSharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( VectorPort &  inPort,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1113 of file Cloning.hpp.

1114  {
1115  try {
1116  VectorPortSharedPtr vectorPortPtr;
1117  inFactory->create(vectorPortPtr);
1118  vectorPortPtr->setComments(inPort.getComments());
1119  vectorPortPtr->setName(inPort.getName());
1120  vectorPortPtr->setDirection(inPort.getDirection());
1121  vectorPortPtr->setOriginalName(inPort.getOriginalName());
1122  vectorPortPtr->setAttributes(inPort.getAttributes());
1123  vectorPortPtr->setIsExtern(inPort.getIsExtern());
1124  vectorPortPtr->setParent(inPort.getParent());
1125  vectorPortPtr->setParentCollection(inPort.getParentCollection());
1126 
1127  std::list < std::string > userData;
1128  inPort.getUserData(userData);
1129  vectorPortPtr->setUserData(userData);
1130 
1131  std::map<std::string, PropertySharedPtr> outProperties;
1132  std::vector<PropertySharedPtr> properties;
1133  inPort.getProperties(outProperties);
1134  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1135  it != outProperties.end(); ++it) {
1136  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1137  properties.push_back(clonedProperty);
1138  }
1139  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1140  it != properties.end(); ++it) {
1141  vectorPortPtr->setProperty((*it)->getName(), *it);
1142  }
1143 
1144  //CREATE AND POPULATE CHILDREN
1145  std::vector < size_t > outLimits;
1146  inPort.getLimits(outLimits);
1147  vectorPortPtr->constructChildren(inFactory, outLimits);
1148  VectorPort::BaseType::List children;
1149  inPort.getCreatedChildren(children);
1150  for(VectorPort::BaseType::List::iterator it = children.begin(); it != children.end();
1151  ++it) {
1152  PortSharedPtr child = *it;
1153  PortSharedPtr clonedChild = vectorPortPtr->get(
1154  IndexFinder<Port, VectorPortBit>()(child));
1155  clonedChild->setComments(child->getComments());
1156  clonedChild->setName(child->getName());
1157  clonedChild->setDirection(child->getDirection());
1158  clonedChild->setOriginalName(child->getOriginalName());
1159  clonedChild->setAttributes(child->getAttributes());
1160  clonedChild->setIsExtern(child->getIsExtern());
1161  clonedChild->setParent(child->getParent());
1162 
1163  std::map < std::string, PropertySharedPtr > outProperties;
1164  std::vector < PropertySharedPtr > properties;
1165  child->getProperties(outProperties);
1166  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1167  it != outProperties.end(); ++it) {
1168  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1169  properties.push_back(clonedProperty);
1170  }
1171  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1172  it != properties.end(); ++it) {
1173  clonedChild->setProperty((*it)->getName(), *it);
1174  }
1175  }
1176  //CONNECTIONS ARE NOT COPIED
1177  outPointer = vectorPortPtr;
1178  } catch(Error& e) {
1179  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1180  throw;
1181  }
1182 }
boost::shared_ptr< VectorPort > VectorPortSharedPtr
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< Port > PortSharedPtr
boost::shared_ptr< Property > PropertySharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( VectorPortReference &  inPortRef,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1217 of file Cloning.hpp.

1218  {
1219  try {
1220  VectorPortReferenceSharedPtr vectorPortRefPtr;
1221  inFactory->create(vectorPortRefPtr);
1222  //CREATE AND POPULATE CHILDREN
1223  std::vector < size_t > outLimits;
1224  inPortRef.getLimits(outLimits);
1225  vectorPortRefPtr->constructChildren(inFactory, outLimits);
1226  vectorPortRefPtr->setParent(inPortRef.getParent());
1227  vectorPortRefPtr->setParentCollection(inPortRef.getParentCollection());
1228  vectorPortRefPtr->bindToMasterPort(inPortRef.getMaster());
1229  VectorPortReference::BaseType::List children;
1230  inPortRef.getCreatedChildren(children);
1231  for(VectorPortReference::BaseType::List::iterator it = children.begin();
1232  it != children.end(); ++it) {
1233  PortReferenceSharedPtr child = *it;
1234  PortReferenceSharedPtr clonedChild = vectorPortRefPtr->get(
1235  IndexFinder<PortReference, VectorPortBitReference>()(child));
1236  clonedChild->setParent(child->getParent());
1237  // clonedChild->bindToMasterPort(child->getMaster());
1238  }
1239  //CONNECTIONS ARE NOT COPIED
1240  outPointer = vectorPortRefPtr;
1241  } catch(Error& e) {
1242  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1243  throw;
1244  }
1245 }
boost::shared_ptr< PortReference > PortReferenceSharedPtr
boost::shared_ptr< VectorPortReference > VectorPortReferenceSharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( PortBundle &  inPort,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1280 of file Cloning.hpp.

1281  {
1282  try {
1283  PortBundleSharedPtr portBundlePtr;
1284  inFactory->create(portBundlePtr);
1285  portBundlePtr->setComments(inPort.getComments());
1286  portBundlePtr->setName(inPort.getName());
1287  portBundlePtr->setIsExtern(inPort.getIsExtern());
1288  portBundlePtr->setParent(inPort.getParent());
1289  portBundlePtr->setParentCollection(inPort.getParentCollection());
1290 
1291  std::list < std::string > userData;
1292  inPort.getUserData(userData);
1293  portBundlePtr->setUserData(userData);
1294 
1295  std::map<std::string, PropertySharedPtr> outProperties;
1296  std::vector<PropertySharedPtr> properties;
1297  inPort.getProperties(outProperties);
1298  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1299  it != outProperties.end(); ++it) {
1300  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1301  properties.push_back(clonedProperty);
1302  }
1303  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1304  it != properties.end(); ++it) {
1305  portBundlePtr->setProperty((*it)->getName(), *it);
1306  }
1307 
1308  portBundlePtr->setDirection(inPort.getDirection());
1309  portBundlePtr->setAttributes(inPort.getAttributes());
1310  portBundlePtr->setOriginalName(inPort.getOriginalName());
1311  std::vector<PortSharedPtr> children;
1312  inPort.getChildren(children);
1313  for(std::vector<PortSharedPtr>::iterator it = children.begin(); it != children.end();
1314  ++it) {
1315  PortSharedPtr clonedPort = clone(*it, inFactory);
1316  portBundlePtr->addChild(clonedPort);
1317  }
1318  //CONNECTIONS ARE NOT COPIED
1319  outPointer = portBundlePtr;
1320  } catch(Error& e) {
1321  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1322  throw;
1323  }
1324 }
boost::shared_ptr< PortBundle > PortBundleSharedPtr
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< Port > PortSharedPtr
boost::shared_ptr< Property > PropertySharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( PortBundleReference &  inPortRef,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1359 of file Cloning.hpp.

1360  {
1361  try {
1362  PortBundleReferenceSharedPtr portBundleRefPtr;
1363  inFactory->create(portBundleRefPtr);
1364  portBundleRefPtr->setParent(inPortRef.getParent());
1365  portBundleRefPtr->setParentCollection(inPortRef.getParentCollection());
1366  std::vector<PortReferenceSharedPtr> children;
1367  inPortRef.getChildren(children);
1368  for(std::vector<PortReferenceSharedPtr>::iterator it = children.begin();
1369  it != children.end(); ++it) {
1370  PortReferenceSharedPtr clonedPortRef = clone(*it, inFactory);
1371  portBundleRefPtr->addChild(clonedPortRef);
1372  }
1373  portBundleRefPtr->bindToMasterPort(inPortRef.getMaster());
1374 
1375  //CONNECTIONS ARE NOT COPIED
1376  outPointer = portBundleRefPtr;
1377  } catch(Error& e) {
1378  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1379  throw;
1380  }
1381 }
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< PortReference > PortReferenceSharedPtr
boost::shared_ptr< PortBundleReference > PortBundleReferenceSharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( SingleInstance &  inInstance,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1416 of file Cloning.hpp.

1417  {
1418  try {
1419  SingleInstanceSharedPtr instPtr;
1420  inFactory->create(instPtr);
1421  instPtr->setComments(inInstance.getComments());
1422  instPtr->setName(inInstance.getName());
1423  instPtr->setOriginalName(inInstance.getOriginalName());
1424  instPtr->setParent(inInstance.getParent());
1425 
1426  std::vector<PortReferenceSharedPtr> outPortRefs;
1427  inInstance.getPortReferences(outPortRefs);
1428  for(std::vector<PortReferenceSharedPtr>::iterator it = outPortRefs.begin();
1429  it != outPortRefs.end(); ++it) {
1430  PortReferenceSharedPtr clonedRef = clone(*it, inFactory);
1431  instPtr->addPortReference(clonedRef);
1432  }
1433  instPtr->bindToMasterView(inInstance.getMaster());
1434  //THIS SHOULD BIND ALL THE CLONED PORTREFS TO THE MASTERS
1435  copyParams(inInstance, instPtr, inFactory);
1436 
1437  std::list < std::string > userData;
1438  inInstance.getUserData(userData);
1439  instPtr->setUserData(userData);
1440 
1441  std::map<std::string, PropertySharedPtr> outProperties;
1442  std::vector<PropertySharedPtr> properties;
1443  inInstance.getProperties(outProperties);
1444  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1445  it != outProperties.end(); ++it) {
1446  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1447  properties.push_back(clonedProperty);
1448  }
1449  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1450  it != properties.end(); ++it) {
1451  instPtr->setProperty((*it)->getName(), *it);
1452  }
1453 
1454  if(NULL != inInstance.getTiming()) {
1455  TimingSharedPtr clonedTiming = clone(inInstance.getTiming(), inFactory);
1456  instPtr->setTiming(clonedTiming);
1457  }
1458 
1459  outPointer = instPtr;
1460  } catch(Error& e) {
1461  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1462  throw;
1463  }
1464 }
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< PortReference > PortReferenceSharedPtr
void copyParams(const Instance &inOriginal, const InstanceSharedPtr &outCloned, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.cpp:21
boost::shared_ptr< Property > PropertySharedPtr
boost::shared_ptr< SingleInstance > SingleInstanceSharedPtr
boost::shared_ptr< Timing > TimingSharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( ScalarNet &  inNet,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1500 of file Cloning.hpp.

1501  {
1502  try {
1503  ScalarNetSharedPtr netPtr;
1504  inFactory->create(netPtr);
1505  netPtr->setComments(inNet.getComments());
1506  netPtr->setName(inNet.getName());
1507  netPtr->setParent(inNet.getParent());
1508  netPtr->setOriginalName(inNet.getOriginalName());
1509 
1510  std::list < std::string > userData;
1511  inNet.getUserData(userData);
1512  netPtr->setUserData(userData);
1513 
1514  std::map<std::string, PropertySharedPtr> outProperties;
1515  std::vector<PropertySharedPtr> properties;
1516  inNet.getProperties(outProperties);
1517  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1518  it != outProperties.end(); ++it) {
1519  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1520  properties.push_back(clonedProperty);
1521  }
1522  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1523  it != properties.end(); ++it) {
1524  netPtr->setProperty((*it)->getName(), *it);
1525  }
1526 
1527  std::vector<NetSharedPtr> outNets;
1528  inNet.getSubnets(outNets);
1529  std::vector<NetSharedPtr>::iterator netIt = outNets.begin();
1530  for(; netIt != outNets.end(); ++netIt) {
1531  NetSharedPtr childNet = clone(*netIt, inFactory);
1532  netPtr->addSubnet(childNet);
1533  }
1534  //DO NOT CONNECT
1535  outPointer = netPtr;
1536  } catch(Error& e) {
1537  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1538  throw;
1539  }
1540 }
boost::shared_ptr< ScalarNet > ScalarNetSharedPtr
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< Net > NetSharedPtr
boost::shared_ptr< Property > PropertySharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( NetBundle &  inNet,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1575 of file Cloning.hpp.

1576  {
1577  try {
1578  NetBundleSharedPtr netBundlePtr;
1579  inFactory->create(netBundlePtr);
1580  netBundlePtr->setComments(inNet.getComments());
1581  netBundlePtr->setName(inNet.getName());
1582  netBundlePtr->setParent(inNet.getParent());
1583  netBundlePtr->setOriginalName(inNet.getOriginalName());
1584 
1585  std::list < std::string > userData;
1586  inNet.getUserData(userData);
1587  netBundlePtr->setUserData(userData);
1588 
1589  std::map<std::string, PropertySharedPtr> outProperties;
1590  std::vector<PropertySharedPtr> properties;
1591  inNet.getProperties(outProperties);
1592  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1593  it != outProperties.end(); ++it) {
1594  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1595  properties.push_back(clonedProperty);
1596  }
1597  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1598  it != properties.end(); ++it) {
1599  netBundlePtr->setProperty((*it)->getName(), *it);
1600  }
1601 
1602  std::vector<NetSharedPtr> outChildren;
1603  inNet.getChildren(outChildren);
1604  std::vector<NetSharedPtr>::iterator it = outChildren.begin();
1605  for(; it != outChildren.end(); ++it) {
1606  NetSharedPtr clonedChild = clone(*it, inFactory);
1607  netBundlePtr->addChild(clonedChild);
1608  }
1609  std::vector<NetSharedPtr> outNets;
1610  inNet.getSubnets(outNets);
1611  std::vector<NetSharedPtr>::iterator netIt = outNets.begin();
1612  for(; netIt != outNets.end(); ++netIt) {
1613  NetSharedPtr childNet = clone(*netIt, inFactory);
1614  netBundlePtr->addSubnet(childNet);
1615  }
1616  outPointer = netBundlePtr;
1617  } catch(Error& e) {
1618  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1619  throw;
1620  }
1621 }
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< Net > NetSharedPtr
boost::shared_ptr< Property > PropertySharedPtr
boost::shared_ptr< NetBundle > NetBundleSharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( VectorNet &  inNet,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1656 of file Cloning.hpp.

1657  {
1658  try {
1659  VectorNetSharedPtr vectorNetPtr;
1660  inFactory->create(vectorNetPtr);
1661  vectorNetPtr->setComments(inNet.getComments());
1662  vectorNetPtr->setName(inNet.getName());
1663  vectorNetPtr->setParent(inNet.getParent());
1664  vectorNetPtr->setOriginalName(inNet.getOriginalName());
1665 
1666  std::list < std::string > userData;
1667  inNet.getUserData(userData);
1668  vectorNetPtr->setUserData(userData);
1669 
1670  std::map<std::string, PropertySharedPtr> outProperties;
1671  std::vector<PropertySharedPtr> properties;
1672  inNet.getProperties(outProperties);
1673  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1674  it != outProperties.end(); ++it) {
1675  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1676  properties.push_back(clonedProperty);
1677  }
1678  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1679  it != properties.end(); ++it) {
1680  vectorNetPtr->setProperty((*it)->getName(), *it);
1681  }
1682 
1683  //CREATE AND POPULATE CHILDREN
1684  std::vector < size_t > outLimits;
1685  inNet.getLimits(outLimits);
1686  vectorNetPtr->constructChildren(inFactory, outLimits);
1687  VectorNet::BaseType::List children;
1688  inNet.getCreatedChildren(children);
1689  for(VectorNet::BaseType::List::iterator it = children.begin(); it != children.end(); ++it) {
1690  NetSharedPtr child = *it;
1691  NetSharedPtr clonedChild = vectorNetPtr->get(IndexFinder<Net, VectorNetBit>()(child));
1692  clonedChild->setComments(child->getComments());
1693  clonedChild->setName(child->getName());
1694  clonedChild->setParent(child->getParent());
1695  clonedChild->setOriginalName(child->getOriginalName());
1696 
1697  std::map < std::string, PropertySharedPtr > outProperties;
1698  std::vector < PropertySharedPtr > properties;
1699  child->getProperties(outProperties);
1700  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1701  it != outProperties.end(); ++it) {
1702  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1703  properties.push_back(clonedProperty);
1704  }
1705  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1706  it != properties.end(); ++it) {
1707  clonedChild->setProperty((*it)->getName(), *it);
1708  }
1709 
1710  std::vector<NetSharedPtr> outNets;
1711  child->getSubnets(outNets);
1712  std::vector<NetSharedPtr>::iterator netIt = outNets.begin();
1713  for(; netIt != outNets.end(); ++netIt) {
1714  NetSharedPtr clonedChildNet = clone(*netIt, inFactory);
1715  clonedChild->addSubnet(clonedChildNet);
1716  }
1717  }
1718  //CONNECTIONS ARE NOT COPIED
1719  std::vector<NetSharedPtr> outNets;
1720  inNet.getSubnets(outNets);
1721  std::vector<NetSharedPtr>::iterator netIt = outNets.begin();
1722  for(; netIt != outNets.end(); ++netIt) {
1723  NetSharedPtr childNet = clone(*netIt, inFactory);
1724  vectorNetPtr->addSubnet(childNet);
1725  }
1726 
1727  outPointer = vectorNetPtr;
1728  } catch(Error& e) {
1729  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1730  throw;
1731  }
1732 }
boost::shared_ptr< VectorNet > VectorNetSharedPtr
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< Net > NetSharedPtr
boost::shared_ptr< Property > PropertySharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( InstanceArray &  inInstanceArray,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1767 of file Cloning.hpp.

1768  {
1769  try {
1770  InstanceArraySharedPtr instArrayPtr;
1771  inFactory->create(instArrayPtr);
1772  instArrayPtr->setComments(inInstanceArray.getComments());
1773  instArrayPtr->setName(inInstanceArray.getName());
1774  instArrayPtr->setParent(inInstanceArray.getParent());
1775  instArrayPtr->setOriginalName(inInstanceArray.getOriginalName());
1776 
1777  std::list < std::string > userData;
1778  inInstanceArray.getUserData(userData);
1779  instArrayPtr->setUserData(userData);
1780 
1781  std::map<std::string, PropertySharedPtr> outProperties;
1782  std::vector<PropertySharedPtr> properties;
1783  inInstanceArray.getProperties(outProperties);
1784  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1785  it != outProperties.end(); ++it) {
1786  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1787  properties.push_back(clonedProperty);
1788  }
1789  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1790  it != properties.end(); ++it) {
1791  instArrayPtr->setProperty((*it)->getName(), *it);
1792  }
1793 
1794  //WE intentionally bind here
1795  //This will help when children are bound to different masters
1796  //The actual child binding will be done later
1797  instArrayPtr->bindToMasterView(inInstanceArray.getMaster());
1798  copyParams(inInstanceArray, instArrayPtr, inFactory);
1799 
1800  //CREATE AND POPULATE CHILDREN
1801  std::vector < size_t > outLimits;
1802  inInstanceArray.getLimits(outLimits);
1803  instArrayPtr->constructChildren(inFactory, outLimits);
1804  InstanceArray::BaseVectorType::List children;
1805  inInstanceArray.getChildren(children);
1806  for(InstanceArray::BaseVectorType::List::iterator it = children.begin();
1807  it != children.end(); ++it) {
1808  InstanceSharedPtr orig = *it;
1809  InstanceSharedPtr cloned = instArrayPtr->get(
1810  IndexFinder<Instance, InstanceArrayMember>()(orig));
1811  cloned->setComments(orig->getComments());
1812  cloned->setName(orig->getName());
1813  cloned->setOriginalName(orig->getOriginalName());
1814  cloned->setParent(orig->getParent());
1815 
1816  std::list < std::string > userData;
1817  orig->getUserData(userData);
1818  cloned->setUserData(userData);
1819 
1820  std::map < std::string, PropertySharedPtr > outProperties;
1821  std::vector < PropertySharedPtr > properties;
1822  orig->getProperties(outProperties);
1823  for(std::map<std::string, PropertySharedPtr>::iterator it = outProperties.begin();
1824  it != outProperties.end(); ++it) {
1825  PropertySharedPtr clonedProperty = clone((*it).second, inFactory);
1826  properties.push_back(clonedProperty);
1827  }
1828  for(std::vector<PropertySharedPtr>::iterator it = properties.begin();
1829  it != properties.end(); ++it) {
1830  cloned->setProperty((*it)->getName(), *it);
1831  }
1832 
1833  std::vector<PortReferenceSharedPtr> outPortRefs;
1834  orig->getPortReferences(outPortRefs);
1835  for(std::vector<PortReferenceSharedPtr>::iterator pit = outPortRefs.begin();
1836  pit != outPortRefs.end(); ++pit) {
1837  PortReferenceSharedPtr clonedRef = clone(*pit, inFactory);
1838  cloned->addPortReference(clonedRef);
1839  }
1840  cloned->bindToMasterView(orig->getMaster());
1841  copyParams(*orig, cloned, inFactory);
1842  }
1843  outPointer = instArrayPtr;
1844  } catch(Error& e) {
1845  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1846  throw;
1847  }
1848 }
boost::shared_ptr< Instance > InstanceSharedPtr
boost::shared_ptr< InstanceArray > InstanceArraySharedPtr
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< PortReference > PortReferenceSharedPtr
void copyParams(const Instance &inOriginal, const InstanceSharedPtr &outCloned, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.cpp:21
boost::shared_ptr< Property > PropertySharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( SingleParameter &  inSingleParameter,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1883 of file Cloning.hpp.

1884  {
1885  try {
1886  SingleParameterSharedPtr singleParameterPtr;
1887  inFactory->create(singleParameterPtr);
1888  singleParameterPtr->setName(inSingleParameter.getName());
1889  singleParameterPtr->setUnit(inSingleParameter.getUnit());
1890  singleParameterPtr->setValue(inSingleParameter.getValue());
1891  singleParameterPtr->setOriginalName(inSingleParameter.getOriginalName());
1892  outPointer = singleParameterPtr;
1893  } catch(Error& e) {
1894  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1895  throw;
1896  }
1897 }
boost::shared_ptr< SingleParameter > SingleParameterSharedPtr

+ Here is the call graph for this function:

template<typename _PointerType >
void torc::generic::_impl::copyObject ( ParameterArray &  inParamArray,
ObjectFactorySharedPtr &  inFactory,
_PointerType &  outPointer 
)
throw (Error
)

Definition at line 1932 of file Cloning.hpp.

1933  {
1934  try {
1935  ParameterArraySharedPtr paramArrayPtr;
1936  inFactory->create(paramArrayPtr);
1937  paramArrayPtr->setName(inParamArray.getName());
1938  paramArrayPtr->setOriginalName(inParamArray.getOriginalName());
1939 
1940  std::vector < size_t > outLimits;
1941  inParamArray.getLimits(outLimits);
1942  paramArrayPtr->constructChildren(inFactory, outLimits);
1943  ParameterArray::BaseVectorType::List children;
1944  inParamArray.getChildren(children);
1945  ParameterArray::BaseVectorType::List::iterator it = children.begin();
1946  for(; it != children.end(); ++it) {
1947  ParameterSharedPtr orig = *it;
1948  ParameterSharedPtr cloned = paramArrayPtr->get(
1949  IndexFinder<Parameter, ParameterArrayElement>()(orig));
1950  cloned->setName(orig->getName());
1951  cloned->setUnit(orig->getUnit());
1952  cloned->setValue(orig->getValue());
1953  }
1954  outPointer = paramArrayPtr;
1955  } catch(Error& e) {
1956  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1957  throw;
1958  }
1959 }
boost::shared_ptr< ParameterArray > ParameterArraySharedPtr
boost::shared_ptr< Parameter > ParameterSharedPtr

+ Here is the call graph for this function: