35 create(newPermutable);
36 newPermutable->setPorts(inPorts);
37 if(inParentPermutable) {
38 inParentPermutable->addChildPermutable(newPermutable);
39 }
else if(inViewPtr) {
40 inViewPtr->addPermutable(newPermutable);
57 std::vector<PortSharedPtr>::const_iterator port = inSource.begin();
58 std::vector<PortSharedPtr>::const_iterator end = inSource.end();
59 for(; port != end; ++port) {
86 mPorts.push_back(inPort);
96 std::vector<PermutableSharedPtr>::const_iterator entry = inSource.begin();
97 std::vector<PermutableSharedPtr>::const_iterator end = inSource.end();
98 for(; entry != end; ++entry) {
100 addChildPermutable(*entry);
117 e.
saveContextData(
"Pointer to the permutable object does not exist", inPermutable);
121 mChildren.push_back(inPermutable);
151 std::vector<PermutableSharedPtr> outPermutables;
153 std::vector<PermutableSharedPtr>::iterator permutableIt = outPermutables.begin();
155 std::vector<PortSharedPtr> outPorts;
157 std::vector<PortSharedPtr>::iterator portIt = outPorts.begin();
160 if(!outPorts.empty()) {
161 pSize = (*portIt)->getSize();
162 }
else if(!outPermutables.empty()) {
163 for(; permutableIt != outPermutables.end(); permutableIt++) {
164 pSize += (*permutableIt)->getSize();
165 for(; portIt != outPorts.end(); portIt++) {
166 pSize += (*portIt)->getSize();
173 if(!outPorts.empty()) {
174 for(; portIt != outPorts.end(); portIt++) {
175 cSize += (*portIt)->getSize();
178 if(!outPermutables.empty()) {
179 for(; permutableIt != outPermutables.end(); permutableIt++) {
180 cSize += (*permutableIt)->getSize();
184 size = pSize + cSize;
198 mIsNonPermutable(false), mPermutableType() {}
virtual PermutableSharedPtr newPermutablePtr(const std::vector< PortSharedPtr > &inPorts, const ViewSharedPtr &inViewPtr, const PermutableSharedPtr &inParentPermutable=PermutableSharedPtr())
void addPort(const PortSharedPtr &inPort)
boost::shared_ptr< Permutable > PermutableSharedPtr
void setPorts(const std::vector< PortSharedPtr > &inSource)
Permutable is used to describe a relationship in which ports are interchangeable. ...
void setPermutableType(const PermutableType &inSource)
void runVisitor(_Tp &inoutVisited, BaseVisitor &inoutVisitor)
The Error object thrown by different methods of EdifOM.
A base class for Visitor.
virtual void accept(BaseVisitor &visitor)
const PermutableType getPermutableType() const
void saveContextData(const std::string &inName, const boost::any &inSource)
PermutableType mPermutableType
void setIsNonPermutable(const bool &value)
void getChildren(std::vector< PermutableSharedPtr > &outPermutables) const
void getPorts(std::vector< PortSharedPtr > &outPorts) const
void setChildren(const std::vector< PermutableSharedPtr > &inSource)
boost::shared_ptr< View > ViewSharedPtr
boost::shared_ptr< Port > PortSharedPtr
bool addChildPermutable(const PermutableSharedPtr &inPermutable)
An object that receives an inoutVisitor.
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)