in activemq-cpp/src/main/activemq/commands/ConnectionInfo.cpp [152:211]
bool ConnectionInfo::equals(const DataStructure* value) const {
if (this == value) {
return true;
}
const ConnectionInfo* valuePtr = dynamic_cast<const ConnectionInfo*>(value);
if (valuePtr == NULL || value == NULL) {
return false;
}
if (this->getConnectionId() != NULL) {
if (!this->getConnectionId()->equals(valuePtr->getConnectionId().get())) {
return false;
}
} else if (valuePtr->getConnectionId() != NULL) {
return false;
}
if (this->getClientId() != valuePtr->getClientId()) {
return false;
}
if (this->getPassword() != valuePtr->getPassword()) {
return false;
}
if (this->getUserName() != valuePtr->getUserName()) {
return false;
}
for (size_t ibrokerPath = 0; ibrokerPath < this->getBrokerPath().size(); ++ibrokerPath) {
if (this->getBrokerPath()[ibrokerPath] != NULL ) {
if (!this->getBrokerPath()[ibrokerPath]->equals(valuePtr->getBrokerPath()[ibrokerPath].get())) {
return false;
}
} else if (valuePtr->getBrokerPath()[ibrokerPath] != NULL) {
return false;
}
}
if (this->isBrokerMasterConnector() != valuePtr->isBrokerMasterConnector()) {
return false;
}
if (this->isManageable() != valuePtr->isManageable()) {
return false;
}
if (this->isClientMaster() != valuePtr->isClientMaster()) {
return false;
}
if (this->isFaultTolerant() != valuePtr->isFaultTolerant()) {
return false;
}
if (this->isFailoverReconnect() != valuePtr->isFailoverReconnect()) {
return false;
}
if (this->getClientIp() != valuePtr->getClientIp()) {
return false;
}
if (!BaseCommand::equals(value)) {
return false;
}
return true;
}