QueryConditionImpl.cpp

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #include "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/
00009 
00010 #ifndef OPENDDS_NO_QUERY_CONDITION
00011 #include "QueryConditionImpl.h"
00012 #include "DataReaderImpl.h"
00013 
00014 namespace OpenDDS {
00015 namespace DCPS {
00016 
00017 char* QueryConditionImpl::get_query_expression()
00018 {
00019   return CORBA::string_dup(query_expression_);
00020 }
00021 
00022 DDS::ReturnCode_t
00023 QueryConditionImpl::get_query_parameters(DDS::StringSeq& query_parameters)
00024 {
00025   ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, lock_, false);
00026   query_parameters = query_parameters_;
00027   return DDS::RETCODE_OK;
00028 }
00029 
00030 DDS::ReturnCode_t
00031 QueryConditionImpl::set_query_parameters(const DDS::StringSeq& query_parameters)
00032 {
00033   ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, lock_, false);
00034   query_parameters_ = query_parameters;
00035   return DDS::RETCODE_OK;
00036 }
00037 
00038 std::vector<OPENDDS_STRING>
00039 QueryConditionImpl::getOrderBys() const
00040 {
00041   return evaluator_.getOrderBys();
00042 }
00043 
00044 bool
00045 QueryConditionImpl::hasFilter() const
00046 {
00047   return evaluator_.hasFilter();
00048 }
00049 
00050 CORBA::Boolean
00051 QueryConditionImpl::get_trigger_value()
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 }
00062 
00063 } // namespace DCPS
00064 } // namespace OpenDDS
00065 
00066 #endif // OPENDDS_NO_QUERY_CONDITION

Generated on Fri Feb 12 20:05:25 2016 for OpenDDS by  doxygen 1.4.7