Public Member Functions | Private Member Functions | Private Attributes

RealmConnection Class Reference

#include <RealmConnection.h>

List of all members.

Public Member Functions

 RealmConnection (const std::string &ca_file, const std::string &address, int port, bool tls, const std::string &cookie, UT_uint64 doc_id, bool master, const std::string &session_id, boost::function< void(boost::shared_ptr< RealmConnection >)> sig)
bool connect ()
void disconnect ()
bool isConnected ()
void addBuddy (RealmBuddyPtr buddy_ptr)
void removeBuddy (UT_uint8 realm_connection_id)
RealmBuddyPtr getBuddy (UT_uint8 realm_connection_id)
std::vector< RealmBuddyPtr > & getBuddies ()
UT_uint64 user_id ()
UT_uint8 connection_id ()
UT_uint64 doc_id ()
bool master ()
void promote ()
const std::string & session_id ()
PD_DocumentgetDocument ()
void setDocument (PD_Document *pDoc)
< realm::protocolv1::PacketPtr > & 
queue ()
asio::ip::tcp::socket & socket ()
void loadDocumentStart (AP_Dialog_GenericProgress *pDlg, PD_Document **pDoc_, XAP_Frame *pFrame_, const std::string &filename_, bool bLocallyOwned_)
< PendingDocumentProperties
getPendingDocProps ()
void loadDocumentEnd ()

Private Member Functions

void _disconnect ()
void _signal ()
bool _login ()
UserJoinedPacketPtr _receiveUserJoinedPacket ()
void _receive ()
void _message (const asio::error_code &e, std::size_t bytes_transferred, boost::shared_ptr< std::string > msg_ptr)
void _complete_packet (realm::protocolv1::PacketPtr packet_ptr)
void _complete (const asio::error_code &e, std::size_t bytes_transferred, realm::protocolv1::PacketPtr packet_ptr)

Private Attributes

asio::io_service m_io_service
std::string m_ca_file
std::string m_address
int m_port
int m_tls
asio::ip::tcp::socket m_socket
boost::shared_ptr< asio::thread > m_thread_ptr
std::string m_cookie
UT_uint64 m_user_id
UT_uint8 m_connection_id
UT_uint64 m_doc_id
bool m_master
std::string m_session_id
realm::GrowBuffer m_buf
< realm::protocolv1::PacketPtr
boost::function< void(boost::shared_ptr
< RealmConnection >)> 
std::vector< RealmBuddyPtrm_buddies
< PendingDocumentProperties
< tls_tunnel::ClientProxy
abicollab::mutex m_mutex

Constructor & Destructor Documentation

RealmConnection::RealmConnection ( const std::string &  ca_file,
const std::string &  address,
int  port,
bool  tls,
const std::string &  cookie,
UT_uint64  doc_id,
bool  master,
const std::string &  session_id,
boost::function< void(boost::shared_ptr< RealmConnection >)>  sig 

Member Function Documentation

void RealmConnection::_complete ( const asio::error_code &  e,
std::size_t  bytes_transferred,
realm::protocolv1::PacketPtr  packet_ptr 
) [private]
void RealmConnection::_complete_packet ( realm::protocolv1::PacketPtr  packet_ptr  )  [private]
void RealmConnection::_disconnect (  )  [private]
bool RealmConnection::_login (  )  [private]
void RealmConnection::_message ( const asio::error_code &  e,
std::size_t  bytes_transferred,
boost::shared_ptr< std::string >  msg_ptr 
) [private]
void RealmConnection::_receive (  )  [private]
UserJoinedPacketPtr RealmConnection::_receiveUserJoinedPacket (  )  [private]
void RealmConnection::_signal (  )  [private]

References m_sig.

void RealmConnection::addBuddy ( RealmBuddyPtr  buddy_ptr  ) 

References m_buddies.

bool RealmConnection::connect (  ) 
UT_uint8 RealmConnection::connection_id (  )  [inline]

References m_connection_id.

void RealmConnection::disconnect ( void   ) 

References m_mutex, m_socket, and UT_DEBUGMSG.

UT_uint64 RealmConnection::doc_id (  )  [inline]

References m_doc_id.

std::vector<RealmBuddyPtr>& RealmConnection::getBuddies (  )  [inline]

References m_buddies.

RealmBuddyPtr RealmConnection::getBuddy ( UT_uint8  realm_connection_id  ) 

References m_buddies, and UT_continue_if_fail.

PD_Document* RealmConnection::getDocument ( void   )  [inline]

References m_pDoc.

boost::shared_ptr<PendingDocumentProperties> RealmConnection::getPendingDocProps (  )  [inline]

References m_pdp_ptr.

bool RealmConnection::isConnected (  ) 

References m_socket.

void RealmConnection::loadDocumentEnd (  )  [inline]

References m_pdp_ptr.

void RealmConnection::loadDocumentStart ( AP_Dialog_GenericProgress pDlg,
PD_Document **  pDoc_,
XAP_Frame pFrame_,
const std::string &  filename_,
bool  bLocallyOwned_ 
) [inline]

References m_pdp_ptr, and UT_return_if_fail.

bool RealmConnection::master (  )  [inline]

References m_master.

void RealmConnection::promote (  ) 
SynchronizedQueue<realm::protocolv1::PacketPtr>& RealmConnection::queue (  )  [inline]

References m_packet_queue.

void RealmConnection::removeBuddy ( UT_uint8  realm_connection_id  ) 
const std::string& RealmConnection::session_id (  )  [inline]

References m_session_id.

void RealmConnection::setDocument ( PD_Document pDoc  )  [inline]

References m_pDoc.

asio::ip::tcp::socket& RealmConnection::socket (  )  [inline]

References m_socket.

UT_uint64 RealmConnection::user_id (  )  [inline]

References m_user_id.

Member Data Documentation

std::string RealmConnection::m_address [private]

Referenced by connect().

std::vector<RealmBuddyPtr> RealmConnection::m_buddies [private]
std::string RealmConnection::m_ca_file [private]

Referenced by connect().

Referenced by _login(), and connection_id().

std::string RealmConnection::m_cookie [private]

Referenced by _login().

Referenced by doc_id().

asio::io_service RealmConnection::m_io_service [private]

Referenced by _disconnect(), and connect().

bool RealmConnection::m_master [private]

Referenced by master(), and promote().

Referenced by _disconnect(), and disconnect().

Referenced by getDocument(), and setDocument().

int RealmConnection::m_port [private]

Referenced by connect().

std::string RealmConnection::m_session_id [private]

Referenced by session_id().

boost::function<void (boost::shared_ptr<RealmConnection>)> RealmConnection::m_sig [private]

Referenced by _signal().

asio::ip::tcp::socket RealmConnection::m_socket [private]
boost::shared_ptr<asio::thread> RealmConnection::m_thread_ptr [private]

Referenced by _disconnect(), and connect().

int RealmConnection::m_tls [private]

Referenced by connect().

Referenced by _disconnect(), and connect().

Referenced by _login(), and user_id().

The documentation for this class was generated from the following files: