19 #ifndef TORC_PACKER_PRIMITIVE_HPP
20 #define TORC_PACKER_PRIMITIVE_HPP
71 ElementSharedPtrVector::iterator e =
mElements.end();
72 ElementSharedPtrVector::iterator result =
findElement(inElementPtr->getName());
73 if(result == e)
mElements.push_back(inElementPtr);
82 ElementSharedPtrVector::iterator e =
mElements.end();
83 ElementSharedPtrVector::iterator result = std::find(
mElements.begin(), e, inElementPtr);
84 if(result == e)
return false;
102 for( cnIt = inElementPtr->connectionsBegin(); cnIt != inElementPtr->connectionsEnd(); ++cnIt){
103 if( (*cnIt)->getSource()->getElementName() == inElementPtr->getName() ){
104 pin = *(*cnIt)->getSink();
105 sinkPins.push_back(pin);
107 sinkElements.push_back(elemPtr);
108 for(cnIt2 = elemPtr->connectionsBegin(); cnIt2 != elemPtr->connectionsEnd(); ++cnIt2){
109 if( (*cnIt2)->getSink()->getPinName() == pin.
getPinName()){
110 sinkConnections.push_back(*cnIt2);
111 elemPtr->removeConnection(cnIt2);
117 pin = *(*cnIt)->getSource();
118 sourcePins.push_back(pin);
120 sourceElements.push_back(elemPtr);
121 for(cnIt2 = elemPtr->connectionsBegin(); cnIt2 != elemPtr->connectionsEnd(); ++cnIt2){
122 if( (*cnIt2)->getSource()->getPinName() == pin.
getPinName()){
123 sourceConnections.push_back(*cnIt2);
124 elemPtr->removeConnection(cnIt2);
130 for(
size_t i=0; i<sourcePins.size(); ++i){
131 for(
size_t j=0; j<sinkPins.size(); ++j){
134 connectionPtr->addConnectionPin(sourcePins[i]);
135 connectionPtr->addConnectionPin(sinkPins[j]);
136 sinkElements[j]->addConnection(connectionPtr);
138 connectionPtr1->addConnectionPin(sourcePins[i]);
139 connectionPtr1->addConnectionPin(sinkPins[j]);
140 sourceElements[i]->addConnection(connectionPtr1);
181 #endif // TORC_PACKER_PRIMITIVE_HPP
bool removeElement(ElementSharedPtr &inElementPtr)
Remove a element from the primitive.
bool addElement(ElementSharedPtr &inElementPtr)
Add a element to the primitive.
boost::shared_ptr< Primitive > PrimitiveSharedPtr
Shared pointer encapsulation of a Primitive.
bool operator==(const Primitive &rhs) const
Equality operator.
string mName
The name of the object.
boost::shared_ptr< Element > ElementSharedPtr
Shared pointer encapsulation of a element.
RcFactory class for physical netlist elements.
ElementSharedPtrIterator elementsEnd(void)
Returns the end non-constant iterator for elements.
Physical design connection-pin pair, suitable for specifying a net endpoint.
ElementSharedPtrVector::iterator ElementSharedPtrIterator
Non-constant iterator for Element shared pointers.
Comparator class to serve as a predicate when searching for names.
size_t getElementCount(void) const
std::vector< ConnectionSharedPtr > ConnectionSharedPtrVector
Vector of componenet shared pointers.
boost::shared_ptr< Connection > ConnectionSharedPtr
Shared pointer encapsulation of a componenet.
ElementSharedPtrConstIterator elementsBegin(void) const
Returns the begin constant iterator for elements.
ElementSharedPtrIterator findElement(const string &inName)
Find a primitive element by name.
const PinName & getPinName(void) const
Returns the pin name.
ElementSharedPtrVector mElements
Vector of element shared pointers.
ElementSharedPtrVector::const_iterator ElementSharedPtrConstIterator
Constant iterator for Element shared pointers.
std::vector< ElementSharedPtr > ElementSharedPtrVector
Vector of element shared pointers.
ConnectionSharedPtrVector::iterator ConnectionSharedPtrIterator
ConnectionPinVector::iterator ConnectionPinSharedPtrIterator
const string & getElementName(void) const
Returns the element pointer or NULL.
std::string string
Imported type name.
std::vector< PrimitiveSharedPtr > PrimitiveSharedPtrVector
Vector of Primitive shared pointers.
ElementSharedPtrIterator elementsBegin(void)
Returns the begin non-constant iterator for elements.
ElementSharedPtrConstIterator elementsEnd(void) const
Returns the end constant iterator for elements.
std::vector< ConnectionPin > ConnectionPinVector
Vector of connection pins.
Primitive(const string &inName)