| 37 | } |
| 38 | |
| 39 | MultiTopicImpl::MultiTopicImpl(const char* name, |
| 40 | const char* type_name, const char* subscription_expression, |
| 41 | const DDS::StringSeq& expression_parameters, |
| 42 | DomainParticipantImpl* participant) |
| 43 | : TopicDescriptionImpl(name, type_name, |
| 44 | findTypeSupport(participant, type_name), |
| 45 | participant) |
| 46 | , subscription_expression_(subscription_expression) |
| 47 | , expression_parameters_(expression_parameters) |
| 48 | { |
| 49 | const char* out = subscription_expression |
| 50 | + std::strlen(subscription_expression); |
| 51 | yard::SimpleTextParser parser(subscription_expression, out); |
| 52 | if (!parser.Parse<TopicExpressionGrammar::TopicCompleteInput>()) { |
| 53 | reportErrors(parser, subscription_expression); |
| 54 | } |
| 55 | |
| 56 | for (AstNode* iter = parser.GetAstRoot()->GetFirstChild(); iter; |
| 57 | iter = iter->GetSibling()) { |
| 58 | if (iter->TypeMatches<TopicExpressionGrammar::SubjectFieldSpec>()) { |
| 59 | AstNode* fieldName = iter->GetFirstChild(); |
| 60 | aggregation_.push_back(SubjectFieldSpec(toString(fieldName), |
| 61 | toString(fieldName->GetSibling()))); |
| 62 | } else if (iter->TypeMatches<TopicExpressionGrammar::TopicName>()) { |
| 63 | selection_.push_back(toString(iter)); |
| 64 | } else { |
| 65 | filter_eval_.reset(new FilterEvaluator(iter)); |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | MultiTopicImpl::~MultiTopicImpl() |
| 71 | { |
nothing calls this directly
no test coverage detected