本文整理汇总了C++中DeviceName::type方法的典型用法代码示例。如果您正苦于以下问题:C++ DeviceName::type方法的具体用法?C++ DeviceName::type怎么用?C++ DeviceName::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeviceName
的用法示例。
在下文中一共展示了DeviceName::type方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: DeviceName
/**
* \brief Name of the device
*
* For derived components, this only returns the device name of the
* parent device, it is the client's responsibilty to retrieve the
* correct subdevice of the parent device.
*/
DeviceName InstrumentComponentDerived::devicename() {
DeviceName name = _instrument.devicename(_derivedfrom);
if (type() != DeviceName::Ccd) {
name.type(type());
return name;
} else {
return DeviceName(name, type(), stringprintf("%d", unit()));
}
}
示例3: 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());
}
示例4: begin
DeviceName DeviceName::parent(const DeviceName::device_type& devicetype) const {
DeviceName result;
const_iterator i = begin();
size_type j = 1;
while (j++ < size()) {
result.push_back(*i);
i++;
}
result.type(devicetype);
return result;
}
示例5: 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());
}
示例6:
DeviceName::DeviceName(const DeviceName& other)
: std::vector<std::string>(other), _type(other.type()) {
}