Libspinscale: Initial top-level SMO port to coroutine framework
We haven't ported everything. Just the top-level methods. We'll dig in to the leaf stuff later. Surprisingly, this all went without any real difficulties. Runs like a charm on first try.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#include <sstream>
|
||||
#include <user/deviceAttachmentSpec.h>
|
||||
#include <deviceManager/deviceRole.h>
|
||||
#include <spinscale/qutex.h>
|
||||
#include <spinscale/co/coQutex.h>
|
||||
|
||||
namespace smo {
|
||||
namespace device {
|
||||
@@ -15,25 +15,26 @@ namespace device {
|
||||
class Device
|
||||
{
|
||||
public:
|
||||
Device(const std::string& identifier)
|
||||
: deviceIdentifier(identifier), qutex("Device-" + identifier)
|
||||
explicit Device(const std::string& identifier)
|
||||
: deviceIdentifier(identifier),
|
||||
qutex("Device-" + identifier)
|
||||
{}
|
||||
|
||||
std::string stringify() const
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "Device Identifier: " << deviceIdentifier
|
||||
<< ", Device Roles: " << deviceRoles.size() << std::endl;
|
||||
for (const auto& deviceRole : deviceRoles) {
|
||||
os << " " << deviceRole->deviceAttachmentSpec->stringify();
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
std::string stringify() const
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "Device Identifier: " << deviceIdentifier
|
||||
<< ", Device Roles: " << deviceRoles.size() << std::endl;
|
||||
for (const auto& deviceRole : deviceRoles) {
|
||||
os << " " << deviceRole->deviceAttachmentSpec->stringify();
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
public:
|
||||
std::string deviceIdentifier;
|
||||
std::vector<std::shared_ptr<DeviceRole>> deviceRoles;
|
||||
sscl::Qutex qutex;
|
||||
sscl::co::CoQutex qutex;
|
||||
};
|
||||
|
||||
} // namespace device
|
||||
|
||||
Reference in New Issue
Block a user