1 #ifndef OMG_DDS_TOPIC_DETAIL_MULTI_TOPIC_HPP_ 2 #define OMG_DDS_TOPIC_DETAIL_MULTI_TOPIC_HPP_ 28 #include <dds/core/Query.hpp> 30 #ifdef OMG_DDS_MULTI_TOPIC_SUPPORT 32 namespace dds {
namespace topic {
namespace detail {
36 class MultiTopic :
public org::opensplice::topic::TopicDescriptionDelegate
41 const std::string& name,
42 const std::string expression,
43 const FWDIterator& params_begin,
44 const FWDIterator& params_end)
45 : ::
dds::core::Reference< DELEGATE<T> >(
46 new
dds::topic::detail::MultiTopic<T>(dp, name, expression, params_begin, params_end))
48 ISOCPP_REPORT_STACK_DELEGATE_BEGIN();
50 dds::topic::detail::TopicDescription<T>::myTypeName = org::opensplice::topic::TopicTraits<T>::getTypeName();
61 void validate_filter()
65 std::vector<c_value> params;
67 length = myFilter.parameters_length();
69 expr = q_parse(myFilter.expression().c_str());
71 ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
72 "filter_expression '%s' is invalid", myFilter.expression().c_str());
75 ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
76 "Invalid number of filter_parameters '%d', maximum is 99", length);
79 params = reader_parameters();
81 if (!u_topicMultiExprValidate(dp.delegate()->get_user_handle(), myFilter.expression().c_str(), ¶ms[0], params.size())) {
82 ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR,
83 "filter_expression '%s' is invalid.", myFilter.expression().c_str());
91 std::string reader_expression()
const 93 ISOCPP_REPORT_STACK_DELEGATE_BEGIN();
94 return myFilter.expression();
97 c_value *reader_parameters()
const 99 ISOCPP_REPORT_STACK_DELEGATE_BEGIN();
100 c_value *params = NULL;
102 org::opensplice::topic::FilterDelegate::const_iterator paramIterator;
104 length = myFilter.parameters_length();
106 params = (c_value *)os_malloc(length *
sizeof(
struct c_value));
107 for (n = 0, paramIterator = myFilter.begin(); n < length; n++, paramIterator++) {
108 params[n] = c_stringValue(const_cast<char *>(paramIterator->c_str()));
114 const std::string expression()
const 116 ISOCPP_REPORT_STACK_DELEGATE_BEGIN();
117 return myFilter.expression();
120 template <
typename FWIterator>
121 void expression_parameters(
const FWIterator& params_begin,
const FWIterator& params_end)
123 ISOCPP_REPORT_STACK_DELEGATE_BEGIN();
124 myFilter.parameters(begin, end);
130 ISOCPP_REPORT_STACK_DELEGATE_BEGIN();
Filter objects contain SQL expressions that allow the application to specify a filter on the locally ...
A DomainParticipant represents the local membership of the application in a Domain.
std::vector< std::string > StringSeq