summaryrefslogtreecommitdiff
path: root/src/CommonAPI/Address.cpp
diff options
context:
space:
mode:
authorDirk Huss <dirk_huss@mentor.com>2015-11-25 14:38:28 +0100
committerDirk Huss <dirk_huss@mentor.com>2015-11-25 14:38:28 +0100
commitb6f81b22fcf8d9cf8ee9248408b7d2a72fbff1d9 (patch)
tree8b0b1438ccaa9450ca4b21221eb9cd74f14b10f5 /src/CommonAPI/Address.cpp
parent3d2fb21d0e93b6b595610285e910ac80c099a174 (diff)
downloadgenivi-common-api-runtime-b6f81b22fcf8d9cf8ee9248408b7d2a72fbff1d9.tar.gz
CommonAPI 3.1.4
Diffstat (limited to 'src/CommonAPI/Address.cpp')
-rw-r--r--src/CommonAPI/Address.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/src/CommonAPI/Address.cpp b/src/CommonAPI/Address.cpp
index 2315a9c..0a7344a 100644
--- a/src/CommonAPI/Address.cpp
+++ b/src/CommonAPI/Address.cpp
@@ -10,22 +10,22 @@
namespace CommonAPI {
Address::Address(const std::string &_address) {
- // TODO: handle error situation (_address is no valid CommonAPI address)
- setAddress(_address);
+ // TODO: handle error situation (_address is no valid CommonAPI address)
+ setAddress(_address);
}
Address::Address(const std::string &_domain,
- const std::string &_interface,
- const std::string &_instance)
- : domain_(_domain),
- interface_(_interface),
- instance_(_instance) {
+ const std::string &_interface,
+ const std::string &_instance)
+ : domain_(_domain),
+ interface_(_interface),
+ instance_(_instance) {
}
Address::Address(const Address &_source)
- : domain_(_source.domain_),
- interface_(_source.interface_),
- instance_(_source.instance_) {
+ : domain_(_source.domain_),
+ interface_(_source.interface_),
+ instance_(_source.instance_) {
}
Address::~Address() {
@@ -33,90 +33,90 @@ Address::~Address() {
bool
Address::operator ==(const Address &_other) const {
- return (domain_ == _other.domain_ &&
- interface_ == _other.interface_ &&
- instance_ == _other.instance_);
+ return (domain_ == _other.domain_ &&
+ interface_ == _other.interface_ &&
+ instance_ == _other.instance_);
}
bool
Address::operator !=(const Address &_other) const {
- return (domain_ != _other.domain_ ||
- interface_ != _other.interface_ ||
- instance_ != _other.instance_);
+ return (domain_ != _other.domain_ ||
+ interface_ != _other.interface_ ||
+ instance_ != _other.instance_);
}
bool
Address::operator<(const Address &_other) const {
- if (domain_ < _other.domain_)
- return true;
+ if (domain_ < _other.domain_)
+ return true;
- if (domain_ == _other.domain_) {
- if (interface_ < _other.interface_)
- return true;
+ if (domain_ == _other.domain_) {
+ if (interface_ < _other.interface_)
+ return true;
- if (interface_ == _other.interface_) {
- if (instance_ < _other.instance_)
- return true;
- }
- }
+ if (interface_ == _other.interface_) {
+ if (instance_ < _other.instance_)
+ return true;
+ }
+ }
- return false;
+ return false;
}
std::string
Address::getAddress() const {
- return (domain_ + ":" + interface_ + ":" + instance_);
+ return (domain_ + ":" + interface_ + ":" + instance_);
}
void
Address::setAddress(const std::string &_address) {
- std::istringstream addressStream(_address);
+ std::istringstream addressStream(_address);
if (std::getline(addressStream, domain_, ':')) {
- if (std::getline(addressStream, interface_, ':')) {
- if(!std::getline(addressStream, instance_, ':')) {
- if(std::getline(addressStream, instance_)) {
- }
- }
- }
+ if (std::getline(addressStream, interface_, ':')) {
+ if(!std::getline(addressStream, instance_, ':')) {
+ if(std::getline(addressStream, instance_)) {
+ }
+ }
+ }
}
}
const std::string &
Address::getDomain() const {
- return domain_;
+ return domain_;
}
void
Address::setDomain(const std::string &_domain) {
- domain_ = _domain;
+ domain_ = _domain;
}
const std::string &
Address::getInterface() const {
- return interface_;
+ return interface_;
}
void
Address::setInterface(const std::string &_interface) {
- interface_ = _interface;
+ interface_ = _interface;
}
const std::string &
Address::getInstance() const {
- return instance_;
+ return instance_;
}
void
Address::setInstance(const std::string &_instance) {
- instance_ = _instance;
+ instance_ = _instance;
}
std::ostream &
operator<<(std::ostream &_out, const Address &_address) {
- _out << _address.domain_
- << ":" << _address.interface_
- << ":" << _address.instance_;
- return _out;
+ _out << _address.domain_
+ << ":" << _address.interface_
+ << ":" << _address.instance_;
+ return _out;
}
} // namespace CommonAPI