DDS4CCM  1.0.8
Public Member Functions | Private Member Functions | Private Attributes
CIAO::DDS4CCM::ConditionManager Class Reference

Helper class. More...

#include <ConditionManager.h>

Collaboration diagram for CIAO::DDS4CCM::ConditionManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ConditionManager (void)
 Constructor.
 ~ConditionManager (void)
 Destructor.
::DDS::ReadCondition_ptr get_readcondition (void)
 Returns the read condition in general.
::DDS::QueryCondition_ptr get_querycondition_getter (void)
 Returns the query condition for the getter.
::DDS::QueryCondition_ptr get_querycondition_reader (void)
 Returns the query condition for the reader.
::DDS::QueryCondition_ptr get_querycondition_listener (void)
 Returns the query condition for the listener.
::DDS::InstanceHandle_t check_handle (DDS_INSTANCE_HANDLE_T_IN instance_handle, DDS_INSTANCE_HANDLE_T_IN lookup_handle)
bool check_condition (::DDS::Condition_ptr condition)
void init_readcondition (void)
bool wait (::DDS::ConditionSeq &active_conditions,::DDS::Duration_t &time_out)
::CCM_DDS::QueryFilterquery (void)
void query (const ::CCM_DDS::QueryFilter &filter)
void set_dds_entity (::DDS::DataReader_ptr dr)
::DDS::DataReader_ptr get_dds_entity (void)
void passivate (void)

Private Member Functions

::DDS::DataReader_ptr dds_entity (void)
void remove_condition (::DDS::QueryCondition_ptr qc, const char *type)
void remove_conditions (void)
void attach_querycondition (void)
void set_parameters (const ::CCM_DDS::QueryFilter &filter,::DDS::QueryCondition_ptr qc)

Private Attributes

::DDS::DataReader_var dr_
::DDS::QueryCondition_var qc_reader_
::DDS::QueryCondition_var qc_getter_
::DDS::QueryCondition_var qc_listener_
::DDS::ReadCondition_var rd_condition_

Detailed Description

Helper class.

Manages the read and query conditions for the Getter, Reader and listeners.


Constructor & Destructor Documentation

CIAO::DDS4CCM::ConditionManager::ConditionManager ( void  )

Constructor.

CIAO::DDS4CCM::ConditionManager::~ConditionManager ( void  )

Destructor.


Member Function Documentation

void CIAO::DDS4CCM::ConditionManager::attach_querycondition ( void  ) [private]

Getter functionality.

Attaches the query condition for the getter to the waitset. It the waitset doesn't exist, it will be created.

bool CIAO::DDS4CCM::ConditionManager::check_condition ( ::DDS::Condition_ptr  condition)

Proxy method. See WaitSet::check_condition in ndds/WaitSet.h for more information on this.

DDS::InstanceHandle_t CIAO::DDS4CCM::ConditionManager::check_handle ( DDS_INSTANCE_HANDLE_T_IN  instance_handle,
DDS_INSTANCE_HANDLE_T_IN  lookup_handle 
)

Proxy method. See WaitSet::check_handle in ndds/WaitSet.h for more information on this.

If WaitSet::check_handle set 'error' to true, a CCM_DDS::InternalError exception is called. Error will be DDS::RETCODE_ERROR

If WaitSet::check_handle set 'non_existent' to true, a CCM_DDS::NonExistent exception is thrown.

DDS::DataReader_ptr CIAO::DDS4CCM::ConditionManager::dds_entity ( void  ) [private]

Internal getter for the DataReader. If the internal dds_entity is not set before this method is called, a CORBA::BAD_INV_ORDER exception is thrown.

DDS::DataReader_ptr CIAO::DDS4CCM::ConditionManager::get_dds_entity ( void  )

Retrieves the internal datareader.

DDS::QueryCondition_ptr CIAO::DDS4CCM::ConditionManager::get_querycondition_getter ( void  )

Returns the query condition for the getter.

DDS::QueryCondition_ptr CIAO::DDS4CCM::ConditionManager::get_querycondition_listener ( void  )

Returns the query condition for the listener.

DDS::QueryCondition_ptr CIAO::DDS4CCM::ConditionManager::get_querycondition_reader ( void  )

Returns the query condition for the reader.

DDS::ReadCondition_ptr CIAO::DDS4CCM::ConditionManager::get_readcondition ( void  )

Returns the read condition in general.

void CIAO::DDS4CCM::ConditionManager::init_readcondition ( void  )

Getter functionality. Creates a read_condition for the getter. It'll also initialize the waitset and attaches the read_condition to the waitset.

void CIAO::DDS4CCM::ConditionManager::passivate ( void  )

Detaches conditions from the waitset and removes all conditions by calling delete_readcondition on the DataReader.

CCM_DDS::QueryFilter * CIAO::DDS4CCM::ConditionManager::query ( void  )

Returns the internal filter. This is the DDS4CCM QueryFilter (a representive of the DDS query).

If the QueryFilter hasn't been initialized, a CCM_DDS::InternalError exception with error code DDS::RETCODE_ERROR is thrown.

void CIAO::DDS4CCM::ConditionManager::query ( const ::CCM_DDS::QueryFilter filter)

Sets the DDS4CCM query filter. The following rules apply when a filter is set:

If there's a read condition set, this will be removed. The read condition is replaced by a query condition.

If there're no query conditions yet (i.e. the filter hasn't been set before), three query conditions are created: 1. One for the Getter 2. One for the Reader 3. One for the Listener Each query condition has it's own sample_state, instance_state and view_state set but the filters are the same.

Off course the query condition for the getter will be attached to the waitset.

If the internal filter has already been set, this method sets the new parameters for this filter on all three query conditions.

If the filter expression (the actual query) is empty, all three query conditions will be removed (the query condition for the getter will be detached from the waitset first) and the initial read condition will created (see init_readcondition).

void CIAO::DDS4CCM::ConditionManager::remove_condition ( ::DDS::QueryCondition_ptr  qc,
const char *  type 
) [private]

Removes the internal (read/query) condition by invoking delete_condition on the DataReader.

void CIAO::DDS4CCM::ConditionManager::remove_conditions ( void  ) [private]

Calling 'remove_condition' for each query and read condition.

The query condition for the getter will be detached from the waitset first.

void CIAO::DDS4CCM::ConditionManager::set_dds_entity ( ::DDS::DataReader_ptr  dr)

Sets the internal datareader. Applies to Getter, Reader and Listener

void CIAO::DDS4CCM::ConditionManager::set_parameters ( const ::CCM_DDS::QueryFilter filter,
::DDS::QueryCondition_ptr  qc 
) [private]

Generic method which sets the parameters of the given filter on the given query condition.

bool CIAO::DDS4CCM::ConditionManager::wait ( ::DDS::ConditionSeq active_conditions,
::DDS::Duration_t time_out 
)

Getter functionality waits for the attached conditions. If a condition is triggered, DDS has filled active_conditions with the triggered conditions. See WaitSet::wait in ndds/WaitSet.h for more information.


Member Data Documentation

Different QueryConditions since the sample mask differs for all entities.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines