OpenDDS::DCPS::DataDurabilityCache Class Reference

Underlying data cache for both OpenDDS TRANSIENT and PERSISTENT DURABILITY implementations.. More...

#include <DataDurabilityCache.h>

Collaboration diagram for OpenDDS::DCPS::DataDurabilityCache:

Collaboration graph
[legend]
List of all members.

Public Types

typedef DurabilityArray< DurabilityQueue<
sample_data_type > * > 
sample_list_type
typedef ACE_Hash_Map_With_Allocator<
key_type, sample_list_type * > 
sample_map_type
typedef std::list< long > timer_id_list_type

Public Member Functions

 DataDurabilityCache (::DDS::DurabilityQosPolicyKind kind)
 Constructor.
 ~DataDurabilityCache ()
 Destructor.
bool insert (::DDS::DomainId_t domain_id, char const *topic_name, char const *type_name, DataSampleList &the_data,::DDS::DurabilityServiceQosPolicy const &qos)
bool get_data (::DDS::DomainId_t domain_id, char const *topic_name, char const *type_name, DataWriterImpl *data_writer, ACE_Allocator *mb_allocator, ACE_Allocator *db_allocator,::DDS::LifespanQosPolicy const &)

Private Member Functions

 DataDurabilityCache (DataDurabilityCache const &)
DataDurabilityCacheoperator= (DataDurabilityCache const &)

Static Private Member Functions

static std::auto_ptr< ACE_Allocatormake_allocator (::DDS::DurabilityQosPolicyKind kind)

Private Attributes

std::auto_ptr< ACE_Allocator
> const 
allocator_
 Allocator used to allocate memory for sample map and lists.
sample_map_typesamples_
 Map of all data samples.
timer_id_list_type cleanup_timer_ids_
 Timer ID list.
ACE_SYNCH_MUTEX lock_
 Lock for synchronized access to the underlying map.
ACE_Reactor * reactor_
 Reactor with which cleanup timers will be registered.

Classes

class  key_type
 Key type for underlying maps. More...
class  sample_data_type
 Sample list data type for all samples. More...

Detailed Description

Underlying data cache for both OpenDDS TRANSIENT and PERSISTENT DURABILITY implementations..

This class implements a cache that outlives DataWriters.


Member Typedef Documentation

typedef DurabilityArray< DurabilityQueue<sample_data_type> *> OpenDDS::DCPS::DataDurabilityCache::sample_list_type

typedef ACE_Hash_Map_With_Allocator<key_type, sample_list_type *> OpenDDS::DCPS::DataDurabilityCache::sample_map_type

typedef std::list<long> OpenDDS::DCPS::DataDurabilityCache::timer_id_list_type


Constructor & Destructor Documentation

OpenDDS::DCPS::DataDurabilityCache::DataDurabilityCache ( ::DDS::DurabilityQosPolicyKind  kind  ) 

Constructor.

OpenDDS::DCPS::DataDurabilityCache::~DataDurabilityCache (  ) 

Destructor.

OpenDDS::DCPS::DataDurabilityCache::DataDurabilityCache ( DataDurabilityCache const &   )  [private]


Member Function Documentation

bool OpenDDS::DCPS::DataDurabilityCache::get_data ( ::DDS::DomainId_t  domain_id,
char const *  topic_name,
char const *  type_name,
DataWriterImpl data_writer,
ACE_Allocator mb_allocator,
ACE_Allocator db_allocator,
::DDS::LifespanQosPolicy const &   
)

Write cached data corresponding to given domain, topic and type to DataWriter.

Todo:
Is this going to cause problems for users that set a finite DDS::ResourceLimitsQosPolicy::max_instances value when OpenDDS supports that value?

Todo:
If we don't empty the queue, we'll end up with duplicate data since the data retrieved from the cache will be reinserted.

bool OpenDDS::DCPS::DataDurabilityCache::insert ( ::DDS::DomainId_t  domain_id,
char const *  topic_name,
char const *  type_name,
DataSampleList the_data,
::DDS::DurabilityServiceQosPolicy const &  qos 
)

Insert the samples corresponding to the given topic instance (uniquely identify by its domain, topic name and type name) into the data durability cache.

std::auto_ptr< ACE_Allocator > OpenDDS::DCPS::DataDurabilityCache::make_allocator ( ::DDS::DurabilityQosPolicyKind  kind  )  [static, private]

Make allocator suitable to support specified kind of DURABILITY.

DataDurabilityCache& OpenDDS::DCPS::DataDurabilityCache::operator= ( DataDurabilityCache const &   )  [private]


Member Data Documentation

std::auto_ptr<ACE_Allocator> const OpenDDS::DCPS::DataDurabilityCache::allocator_ [private]

Allocator used to allocate memory for sample map and lists.

This allocator will either be an ACE_New_Allocator for the TRANSIENT durability case or an mmap()-based allocator for PERSISTENT durability.

timer_id_list_type OpenDDS::DCPS::DataDurabilityCache::cleanup_timer_ids_ [private]

Timer ID list.

Keep track of cleanup timer IDs in case we need to cancel before they expire.

ACE_SYNCH_MUTEX OpenDDS::DCPS::DataDurabilityCache::lock_ [private]

Lock for synchronized access to the underlying map.

ACE_Reactor* OpenDDS::DCPS::DataDurabilityCache::reactor_ [private]

Reactor with which cleanup timers will be registered.

sample_map_type* OpenDDS::DCPS::DataDurabilityCache::samples_ [private]

Map of all data samples.


The documentation for this class was generated from the following files:
Generated on Fri Nov 7 09:37:32 2008 for OpenDDS by  doxygen 1.4.7