Converts the class name list to a mask list
| 111 | |
| 112 | // Converts the class name list to a mask list |
| 113 | void SetExcludableClasses(const ExtractorCallbacks::ClassesMap &classes_map, |
| 114 | const std::vector<std::vector<std::string>> &excludable_classes, |
| 115 | ProfileProperties &profile_properties) |
| 116 | { |
| 117 | if (excludable_classes.size() > MAX_EXCLUDABLE_CLASSES) |
| 118 | { |
| 119 | throw util::exception("Only " + std::to_string(MAX_EXCLUDABLE_CLASSES) + |
| 120 | " excludable combinations allowed."); |
| 121 | } |
| 122 | |
| 123 | // The exclude index 0 is reserve for not excludeing anything |
| 124 | profile_properties.SetExcludableClasses(0, 0); |
| 125 | |
| 126 | std::size_t combination_index = 1; |
| 127 | for (const auto &combination : excludable_classes) |
| 128 | { |
| 129 | ClassData mask = 0; |
| 130 | for (const auto &name : combination) |
| 131 | { |
| 132 | auto iter = classes_map.find(name); |
| 133 | if (iter == classes_map.end()) |
| 134 | { |
| 135 | util::Log(logWARNING) |
| 136 | << "Unknown class name " + name + " in excludable combination. Ignoring."; |
| 137 | } |
| 138 | else |
| 139 | { |
| 140 | mask |= iter->second; |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | if (mask > 0) |
| 145 | { |
| 146 | profile_properties.SetExcludableClasses(combination_index++, mask); |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | std::vector<CompressedNodeBasedGraphEdge> toEdgeList(const util::NodeBasedDynamicGraph &graph) |
| 152 | { |
no test coverage detected