obby::jupiter_algorithm< Document > Class Template Reference

#include <jupiter_algorithm.hpp>

List of all members.

Public Types

typedef Document document_type
typedef operation< document_typeoperation_type
typedef record< document_typerecord_type

Public Member Functions

 jupiter_algorithm ()
 ~jupiter_algorithm ()
std::auto_ptr< record_typelocal_op (const operation_type &op)
std::auto_ptr< operation_typeremote_op (const record_type &rec)

Protected Types

typedef std::list< operation_storage * > ack_list_type

Protected Member Functions

void discard_operations (const record_type &rec)
std::auto_ptr< operation_typetransform (const operation_type &op) const
void check_preconditions (const record_type &rec) const

Protected Attributes

vector_time m_time
ack_list_type m_ack_list

Classes

class  operation_storage


Detailed Description

template<typename Document>
class obby::jupiter_algorithm< Document >

Implementation of the Jupiter algorithm.

Definition at line 33 of file jupiter_algorithm.hpp.


Member Typedef Documentation

template<typename Document>
typedef Document obby::jupiter_algorithm< Document >::document_type

Definition at line 36 of file jupiter_algorithm.hpp.

template<typename Document>
typedef operation<document_type> obby::jupiter_algorithm< Document >::operation_type

Definition at line 37 of file jupiter_algorithm.hpp.

template<typename Document>
typedef record<document_type> obby::jupiter_algorithm< Document >::record_type

Definition at line 38 of file jupiter_algorithm.hpp.

template<typename Document>
typedef std::list<operation_storage*> obby::jupiter_algorithm< Document >::ack_list_type [protected]

Definition at line 102 of file jupiter_algorithm.hpp.


Constructor & Destructor Documentation

template<typename Document>
obby::jupiter_algorithm< Document >::jupiter_algorithm (  ) 

Definition at line 152 of file jupiter_algorithm.hpp.

template<typename Document>
obby::jupiter_algorithm< Document >::~jupiter_algorithm (  ) 

Definition at line 158 of file jupiter_algorithm.hpp.

References obby::jupiter_algorithm< Document >::m_ack_list.


Member Function Documentation

template<typename Document>
std::auto_ptr< typename jupiter_algorithm< Document >::record_type > obby::jupiter_algorithm< Document >::local_op ( const operation_type op  ) 

Returns a record the given local operation.

Definition at line 170 of file jupiter_algorithm.hpp.

References obby::jupiter_algorithm< Document >::m_ack_list, and obby::jupiter_algorithm< Document >::m_time.

Referenced by obby::jupiter_client< Document >::local_op(), and obby::jupiter_client< Document >::undo_op().

template<typename Document>
std::auto_ptr< typename jupiter_algorithm< Document >::operation_type > obby::jupiter_algorithm< Document >::remote_op ( const record_type rec  ) 

Returns a transformed operation after a remote host sent the given record.

Definition at line 180 of file jupiter_algorithm.hpp.

References obby::jupiter_algorithm< Document >::check_preconditions(), obby::jupiter_algorithm< Document >::discard_operations(), obby::record< Document >::get_operation(), obby::basic_vector_time< time_type >::inc_remote(), obby::jupiter_algorithm< Document >::m_time, and obby::jupiter_algorithm< Document >::transform().

Referenced by obby::jupiter_client< Document >::remote_op().

template<typename Document>
void obby::jupiter_algorithm< Document >::discard_operations ( const record_type rec  )  [protected]

Discard from the remote site acknowledged operations.

Definition at line 190 of file jupiter_algorithm.hpp.

References obby::basic_vector_time< time_type >::get_local(), obby::basic_vector_time< time_type >::get_remote(), obby::record< Document >::get_time(), obby::jupiter_algorithm< Document >::m_ack_list, and obby::jupiter_algorithm< Document >::m_time.

Referenced by obby::jupiter_algorithm< Document >::remote_op().

template<typename Document>
std::auto_ptr< typename jupiter_algorithm< Document >::operation_type > obby::jupiter_algorithm< Document >::transform ( const operation_type op  )  const [protected]

Transform the given operation by the local ones that have not been acknowledged by the remote site.

Definition at line 216 of file jupiter_algorithm.hpp.

References obby::operation< Document >::clone(), and obby::jupiter_algorithm< Document >::m_ack_list.

Referenced by obby::jupiter_algorithm< Document >::remote_op().

template<typename Document>
void obby::jupiter_algorithm< Document >::check_preconditions ( const record_type rec  )  const [protected]

Checks preconditions that have to be fulfilled before transforming.

Definition at line 243 of file jupiter_algorithm.hpp.

References obby::basic_vector_time< time_type >::get_local(), obby::basic_vector_time< time_type >::get_remote(), obby::record< Document >::get_time(), obby::jupiter_algorithm< Document >::m_ack_list, and obby::jupiter_algorithm< Document >::m_time.

Referenced by obby::jupiter_algorithm< Document >::remote_op().


Member Data Documentation

template<typename Document>
vector_time obby::jupiter_algorithm< Document >::m_time [protected]

Definition at line 104 of file jupiter_algorithm.hpp.

Referenced by obby::jupiter_algorithm< Document >::check_preconditions(), obby::jupiter_algorithm< Document >::discard_operations(), obby::jupiter_algorithm< Document >::local_op(), and obby::jupiter_algorithm< Document >::remote_op().

template<typename Document>
ack_list_type obby::jupiter_algorithm< Document >::m_ack_list [protected]

Definition at line 105 of file jupiter_algorithm.hpp.

Referenced by obby::jupiter_algorithm< Document >::check_preconditions(), obby::jupiter_algorithm< Document >::discard_operations(), obby::jupiter_algorithm< Document >::local_op(), obby::jupiter_algorithm< Document >::transform(), and obby::jupiter_algorithm< Document >::~jupiter_algorithm().


The documentation for this class was generated from the following file:
Generated on Fri Jan 11 10:01:33 2008 for obby by  doxygen 1.5.1