| 259 | |
| 260 | template <class TRule, class TProtoRule> |
| 261 | void AddRule(ClassifObject * p, int scale, TypeT type, TProtoRule const & rule, vector<string> const & apply_if) |
| 262 | { |
| 263 | unique_ptr<ISelector> selector; |
| 264 | if (!apply_if.empty()) |
| 265 | { |
| 266 | selector = ParseSelector(apply_if); |
| 267 | if (selector == nullptr) |
| 268 | { |
| 269 | LOG(LERROR, ("Runtime selector has not been created:", apply_if)); |
| 270 | return; |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | BaseRule * obj = new TRule(rule); |
| 275 | obj->SetSelector(std::move(selector)); |
| 276 | Key k = m_holder.AddRule(scale, type, obj); |
| 277 | p->SetVisibilityOnScale(true, scale); |
| 278 | k.SetPriority(rule.priority()); |
| 279 | p->AddDrawRule(k); |
| 280 | } |
| 281 | |
| 282 | static void DrawElementGetApplyIf(DrawElementProto const & de, vector<string> & apply_if) |
| 283 | { |
nothing calls this directly
no test coverage detected