MCPcopy Create free account
hub / github.com/apache/mesos / toCapabilityBitset

Function toCapabilityBitset

src/linux/capabilities.cpp:124–135  ·  view source on GitHub ↗

Helper function to convert capability set to bitset.

Source from the content-addressed store, hash-verified

122
123// Helper function to convert capability set to bitset.
124static uint64_t toCapabilityBitset(const std::set<Capability>& capabilities)
125{
126 uint64_t result = 0;
127
128 for (int i = 0; i < MAX_CAPABILITY; i++) {
129 if (capabilities.count(static_cast<Capability>(i)) > 0) {
130 result |= (1ULL << i);
131 }
132 }
133
134 return result;
135}
136
137
138// Helper function to convert capability bitset to std::set.

Callers 1

setMethod · 0.85

Calls 1

countMethod · 0.45

Tested by

no test coverage detected