本文整理汇总了C++中DeviceName::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ DeviceName::begin方法的具体用法?C++ DeviceName::begin怎么用?C++ DeviceName::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeviceName
的用法示例。
在下文中一共展示了DeviceName::begin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: equal
bool DeviceName::operator==(const DeviceName& other) const {
if (type() != other.type()) {
return false;
}
if (size() != other.size()) {
return false;
}
return std::equal(begin(), end(), other.begin());
}
示例2: lexicographical_compare
bool DeviceName::operator<(const DeviceName& other) const {
if (type() < other.type()) {
return true;
}
if (type() == other.type()) {
return lexicographical_compare(begin(), end(),
other.begin(), other.end());
}
return false;
}
示例3: runtime_error
void DeviceDenicer::setup(const DeviceName& original) {
debug(LOG_DEBUG, DEBUG_LOG, 0, "denice '%s'",
original.toString().c_str());
if (original.modulename() != "nice") {
throw std::runtime_error("cannot denice device names for "
"other modules");
}
if (original.size() < 2) {
throw std::runtime_error("bad nice device name: too short");
}
std::vector<std::string> components;
std::vector<std::string>::const_iterator i = original.begin();
i++; // skip the name nice
_service = *i;
i++; // skip the service name
copy(i, original.end(), std::back_inserter(components));
_devicename = std::shared_ptr<DeviceName>(new DeviceName(original.type(),
components));
debug(LOG_DEBUG, DEBUG_LOG, 0, "deniced service name: %s",
_devicename->toString().c_str());
}
示例4:
DeviceName::DeviceName(const DeviceName& name, const device_type& type,
const std::string& unitname) : _type(type) {
std::copy(name.begin(), name.end(), back_inserter(*this));
debug(LOG_DEBUG, DEBUG_LOG, 0, "unit name = %s", unitname.c_str());
push_back(unitname);
}