#include <QueryConditionImpl.h>
Inheritance diagram for OpenDDS::DCPS::QueryConditionImpl:
Public Member Functions | |
QueryConditionImpl (DataReaderImpl *dr, DDS::SampleStateMask sample_states, DDS::ViewStateMask view_states, DDS::InstanceStateMask instance_states, const char *query_expression, const DDS::StringSeq &query_parameters) | |
virtual | ~QueryConditionImpl () |
char * | get_query_expression () |
DDS::ReturnCode_t | get_query_parameters (DDS::StringSeq &query_parameters) |
DDS::ReturnCode_t | set_query_parameters (const DDS::StringSeq &query_parameters) |
CORBA::Boolean | get_trigger_value () |
std::vector< OPENDDS_STRING > | getOrderBys () const |
bool | hasFilter () const |
template<typename Sample> | |
bool | filter (const Sample &s) const |
Private Attributes | |
CORBA::String_var | query_expression_ |
DDS::StringSeq | query_parameters_ |
FilterEvaluator | evaluator_ |
ACE_Recursive_Thread_Mutex | lock_ |
Definition at line 29 of file QueryConditionImpl.h.
OpenDDS::DCPS::QueryConditionImpl::QueryConditionImpl | ( | DataReaderImpl * | dr, | |
DDS::SampleStateMask | sample_states, | |||
DDS::ViewStateMask | view_states, | |||
DDS::InstanceStateMask | instance_states, | |||
const char * | query_expression, | |||
const DDS::StringSeq & | query_parameters | |||
) | [inline] |
Definition at line 33 of file QueryConditionImpl.h.
00036 : ReadConditionImpl(dr, sample_states, view_states, instance_states) 00037 , query_expression_(query_expression) 00038 , query_parameters_(query_parameters) 00039 , evaluator_(query_expression, true) {}
virtual OpenDDS::DCPS::QueryConditionImpl::~QueryConditionImpl | ( | ) | [inline, virtual] |
bool OpenDDS::DCPS::QueryConditionImpl::filter | ( | const Sample & | s | ) | const [inline] |
Definition at line 57 of file QueryConditionImpl.h.
Referenced by OpenDDS::DCPS::RakeResults< SampleSeq >::insert_sample().
00058 { 00059 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, lock_, false); 00060 return evaluator_.eval(s, query_parameters_); 00061 }
char * OpenDDS::DCPS::QueryConditionImpl::get_query_expression | ( | ) |
Implements DDS::QueryCondition.
Definition at line 17 of file QueryConditionImpl.cpp.
References query_expression_, and CORBA::string_dup().
00018 { 00019 return CORBA::string_dup(query_expression_); 00020 }
DDS::ReturnCode_t OpenDDS::DCPS::QueryConditionImpl::get_query_parameters | ( | DDS::StringSeq & | query_parameters | ) |
Definition at line 23 of file QueryConditionImpl.cpp.
References lock_, query_parameters_, and DDS::RETCODE_OK.
00024 { 00025 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, lock_, false); 00026 query_parameters = query_parameters_; 00027 return DDS::RETCODE_OK; 00028 }
CORBA::Boolean OpenDDS::DCPS::QueryConditionImpl::get_trigger_value | ( | ) |
Reimplemented from OpenDDS::DCPS::ReadConditionImpl.
Definition at line 51 of file QueryConditionImpl.cpp.
References OpenDDS::DCPS::DataReaderImpl::contains_sample_filtered(), evaluator_, OpenDDS::DCPS::ReadConditionImpl::get_trigger_value(), hasFilter(), OpenDDS::DCPS::ReadConditionImpl::instance_states_, lock_, OpenDDS::DCPS::ReadConditionImpl::parent_, query_parameters_, OpenDDS::DCPS::DataReaderImpl::sample_lock_, OpenDDS::DCPS::ReadConditionImpl::sample_states_, and OpenDDS::DCPS::ReadConditionImpl::view_states_.
00052 { 00053 if (hasFilter()) { 00054 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard2, parent_->sample_lock_, false); 00055 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, lock_, false); 00056 return parent_->contains_sample_filtered(sample_states_, view_states_, 00057 instance_states_, evaluator_, query_parameters_); 00058 } else { 00059 return ReadConditionImpl::get_trigger_value(); 00060 } 00061 }
std::vector< OPENDDS_STRING > OpenDDS::DCPS::QueryConditionImpl::getOrderBys | ( | ) | const |
Definition at line 39 of file QueryConditionImpl.cpp.
References evaluator_.
Referenced by OpenDDS::DCPS::RakeResults< SampleSeq >::RakeResults().
00040 { 00041 return evaluator_.getOrderBys(); 00042 }
bool OpenDDS::DCPS::QueryConditionImpl::hasFilter | ( | ) | const |
Definition at line 45 of file QueryConditionImpl.cpp.
References evaluator_, and OpenDDS::DCPS::FilterEvaluator::hasFilter().
Referenced by get_trigger_value(), and OpenDDS::DCPS::RakeResults< SampleSeq >::RakeResults().
00046 { 00047 return evaluator_.hasFilter(); 00048 }
DDS::ReturnCode_t OpenDDS::DCPS::QueryConditionImpl::set_query_parameters | ( | const DDS::StringSeq & | query_parameters | ) |
Definition at line 31 of file QueryConditionImpl.cpp.
References lock_, query_parameters_, and DDS::RETCODE_OK.
00032 { 00033 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, lock_, false); 00034 query_parameters_ = query_parameters; 00035 return DDS::RETCODE_OK; 00036 }
Definition at line 66 of file QueryConditionImpl.h.
Referenced by get_trigger_value(), getOrderBys(), and hasFilter().
ACE_Recursive_Thread_Mutex OpenDDS::DCPS::QueryConditionImpl::lock_ [mutable, private] |
Reimplemented from OpenDDS::DCPS::ConditionImpl.
Definition at line 67 of file QueryConditionImpl.h.
Referenced by get_query_parameters(), get_trigger_value(), and set_query_parameters().
CORBA::String_var OpenDDS::DCPS::QueryConditionImpl::query_expression_ [private] |
Definition at line 65 of file QueryConditionImpl.h.
Referenced by get_query_parameters(), get_trigger_value(), and set_query_parameters().