TAO_RTEvent  2.0.8
Classes | Public Types | Public Member Functions | Protected Attributes
TAO_EC_Basic_ObserverStrategy Class Reference

A simple observer strategy. More...

#include <EC_ObserverStrategy.h>

Inheritance diagram for TAO_EC_Basic_ObserverStrategy:
Inheritance graph
[legend]
Collaboration diagram for TAO_EC_Basic_ObserverStrategy:
Collaboration graph
[legend]

List of all members.

Classes

struct  Header_Compare
struct  Observer_Entry
 The data kept for each observer. More...

Public Types

typedef ACE_Map_Manager
< RtecEventChannelAdmin::Observer_Handle,
Observer_Entry, ACE_Null_Mutex
Observer_Map
typedef ACE_Map_Iterator
< RtecEventChannelAdmin::Observer_Handle,
Observer_Entry, ACE_Null_Mutex
Observer_Map_Iterator
typedef ACE_RB_Tree
< RtecEventComm::EventHeader,
int, Header_Compare,
ACE_Null_Mutex
Headers
typedef ACE_RB_Tree_Iterator
< RtecEventComm::EventHeader,
int, Header_Compare,
ACE_Null_Mutex
HeadersIterator

Public Member Functions

 TAO_EC_Basic_ObserverStrategy (TAO_EC_Event_Channel_Base *ec, ACE_Lock *lock)
 Constructor.
virtual ~TAO_EC_Basic_ObserverStrategy (void)
 Destructor.
virtual
RtecEventChannelAdmin::Observer_Handle 
append_observer (RtecEventChannelAdmin::Observer_ptr)
 The basic methods to support the EC strategies.
virtual void remove_observer (RtecEventChannelAdmin::Observer_Handle)
virtual void connected (TAO_EC_ProxyPushConsumer *)
virtual void disconnected (TAO_EC_ProxyPushConsumer *)
virtual void connected (TAO_EC_ProxyPushSupplier *)
virtual void disconnected (TAO_EC_ProxyPushSupplier *)

Protected Member Functions

virtual void consumer_qos_update (TAO_EC_ProxyPushSupplier *supplier)
 Helpers.
virtual void supplier_qos_update (TAO_EC_ProxyPushConsumer *consumer)
 Recompute EC supplier publications and send them out to all observers.
void fill_qos (RtecEventChannelAdmin::ConsumerQOS &qos)
 Compute consumer QOS.
void fill_qos (RtecEventChannelAdmin::SupplierQOS &qos)
 Compute supplier QOS.
int create_observer_list (RtecEventChannelAdmin::Observer_var *&lst)

Protected Attributes

TAO_EC_Event_Channel_Baseevent_channel_
 The event channel.
ACE_Locklock_
 The lock.
RtecEventChannelAdmin::Observer_Handle handle_generator_
Observer_Map observers_
 Keep the set of Observers.

Detailed Description

A simple observer strategy.

This class simply keeps the information about the current list of observers, whenever the list of consumers and/or suppliers changes in queries the EC, computes the global subscription and/or publication list and sends the update message to all the observers.

Memory Management

It assumes ownership of the lock, but not of the Event_Channel.


Member Typedef Documentation


Constructor & Destructor Documentation

TAO_EC_Basic_ObserverStrategy::TAO_EC_Basic_ObserverStrategy ( TAO_EC_Event_Channel_Base ec,
ACE_Lock lock 
)

Constructor.

TAO_EC_Basic_ObserverStrategy::~TAO_EC_Basic_ObserverStrategy ( void  ) [virtual]

Destructor.


Member Function Documentation

RtecEventChannelAdmin::Observer_Handle TAO_EC_Basic_ObserverStrategy::append_observer ( RtecEventChannelAdmin::Observer_ptr  ) [virtual]

The basic methods to support the EC strategies.

Implements TAO_EC_ObserverStrategy.

void TAO_EC_Basic_ObserverStrategy::connected ( TAO_EC_ProxyPushConsumer ) [virtual]

Used by the EC to inform the ObserverStrategy that a Consumer has connected or disconnected from it.

Implements TAO_EC_ObserverStrategy.

void TAO_EC_Basic_ObserverStrategy::connected ( TAO_EC_ProxyPushSupplier ) [virtual]

Used by the EC to inform the ObserverStrategy that a Supplier has connected or disconnected from it.

Implements TAO_EC_ObserverStrategy.

void TAO_EC_Basic_ObserverStrategy::consumer_qos_update ( TAO_EC_ProxyPushSupplier supplier) [protected, virtual]

Helpers.

Recompute EC consumer subscriptions and send them out to all observers.

Reimplemented in TAO_EC_Reactive_ObserverStrategy.

int TAO_EC_Basic_ObserverStrategy::create_observer_list ( RtecEventChannelAdmin::Observer_var *&  lst) [protected]

Copies all current observers into an array and passes it back to the caller through lst. Returns the size of the array.

void TAO_EC_Basic_ObserverStrategy::disconnected ( TAO_EC_ProxyPushConsumer consumer) [virtual]
void TAO_EC_Basic_ObserverStrategy::disconnected ( TAO_EC_ProxyPushSupplier supplier) [virtual]
void TAO_EC_Basic_ObserverStrategy::fill_qos ( RtecEventChannelAdmin::ConsumerQOS qos) [protected]

Compute consumer QOS.

void TAO_EC_Basic_ObserverStrategy::fill_qos ( RtecEventChannelAdmin::SupplierQOS qos) [protected]

Compute supplier QOS.

void TAO_EC_Basic_ObserverStrategy::remove_observer ( RtecEventChannelAdmin::Observer_Handle  handle) [virtual]
void TAO_EC_Basic_ObserverStrategy::supplier_qos_update ( TAO_EC_ProxyPushConsumer consumer) [protected, virtual]

Recompute EC supplier publications and send them out to all observers.

Reimplemented in TAO_EC_Reactive_ObserverStrategy.


Member Data Documentation

The event channel.

The handles are generated in sequential order, but are opaque to the client.

The lock.

Keep the set of Observers.


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