From ce9a9dff175daddfa99c3a7f08c0632e93352c17 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 23 Jul 2012 18:48:12 +0000 Subject: Mon Jul 23 18:47:26 UTC 2012 Johnny Willemsen * connectors/dds4ccm/impl/ConditionManager.h: Doxygen improvements * connectors/dds4ccm/impl/ConditionManager.cpp (query): Check if qc_reader is nil before using it --- CIAO/connectors/dds4ccm/impl/ConditionManager.cpp | 18 ++++++++++++++---- CIAO/connectors/dds4ccm/impl/ConditionManager.h | 12 +++++------- 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'CIAO/connectors/dds4ccm/impl') diff --git a/CIAO/connectors/dds4ccm/impl/ConditionManager.cpp b/CIAO/connectors/dds4ccm/impl/ConditionManager.cpp index 03ad8866bbb..75331402be5 100644 --- a/CIAO/connectors/dds4ccm/impl/ConditionManager.cpp +++ b/CIAO/connectors/dds4ccm/impl/ConditionManager.cpp @@ -132,15 +132,24 @@ namespace CIAO // and therefor nil. DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO ACE_TEXT ("ConditionManager::query - ") - ACE_TEXT ("Error: No QueryCondition set yet. ") - ACE_TEXT ("First set a filter.\n"))); + ACE_TEXT ("Error: No QueryCondition set yet, ") + ACE_TEXT ("first set a filter.\n"))); + throw ::CCM_DDS::InternalError (::DDS::RETCODE_ERROR, 0); + } + if (::CORBA::is_nil (this->qc_reader_.in ())) + { + // qc reader is nil + DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO + ACE_TEXT ("ConditionManager::query - ") + ACE_TEXT ("Error: qc reader is nil, ") + ACE_TEXT ("first set a filter.\n"))); throw ::CCM_DDS::InternalError (::DDS::RETCODE_ERROR, 0); } ::CCM_DDS::QueryFilter_var filter; ACE_NEW_THROW_EX (filter, ::CCM_DDS::QueryFilter(), ::CORBA::NO_MEMORY ()); - filter->expression= this->qc_reader_->get_query_expression (); + filter->expression = this->qc_reader_->get_query_expression (); this->qc_reader_->get_query_parameters (filter->parameters); return filter._retn (); } @@ -155,7 +164,8 @@ namespace CIAO // this should be removed first. Instead of a readcondition, there should // be a QueryCondition attached to the waitset if (! ::CORBA::is_nil (this->rd_condition_.in ())) - { // Getter functionality + { + // Getter functionality // First remove the existing conditions from the waitset // Than create a new (query) condition and attach it to the waitset // instead of the readcondition diff --git a/CIAO/connectors/dds4ccm/impl/ConditionManager.h b/CIAO/connectors/dds4ccm/impl/ConditionManager.h index b584a5a0a04..469b6b96407 100644 --- a/CIAO/connectors/dds4ccm/impl/ConditionManager.h +++ b/CIAO/connectors/dds4ccm/impl/ConditionManager.h @@ -69,7 +69,7 @@ namespace CIAO /** * Getter functionality. * Creates a read_condition for the getter. - * It'll also initialize the waitset and attaches the + * It will also initialize the waitset and attaches the * read_condition to the waitset. */ void init_readcondition (void); @@ -82,13 +82,11 @@ namespace CIAO bool wait (const ::DDS::Duration_t & time_out); /** - * Returns the internal filter. This is the - * DDS4CCM QueryFilter (a representive of the - * DDS query). + * Returns the internal filter. This is the DDS4CCM QueryFilter + * (a representation of the DDS query). * - * If the QueryFilter hasn't been initialized, - * a ::CCM_DDS::InternalError exception with - * error code ::DDS::RETCODE_ERROR is thrown. + * If the QueryFilter hasn't been initialized, a ::CCM_DDS::InternalError + * exception with error code ::DDS::RETCODE_ERROR is thrown. */ ::CCM_DDS::QueryFilter * query (void); -- cgit v1.2.1