OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SandeshConnection Class Referenceabstract

#include <sandesh_connection.h>

Inheritance diagram for SandeshConnection:
Collaboration diagram for SandeshConnection:

Public Types

typedef
boost::asio::ip::tcp::endpoint 
Endpoint
 

Public Member Functions

 SandeshConnection (const char *prefix, TcpServer *server, Endpoint endpoint, int task_instance, int task_id)
 
virtual ~SandeshConnection ()
 
void AcceptSession (SandeshSession *session)
 
virtual bool ReceiveMsg (const std::string &msg, SandeshSession *session)
 
TcpServerserver ()
 
Endpoint endpoint ()
 
bool SendSandesh (Sandesh *snh)
 
void set_session (SandeshSession *session)
 
SandeshSessionsession () const
 
SandeshStateMachinestate_machine () const
 
std::string StateName () const
 
int GetTaskInstance () const
 
int GetTaskId () const
 
void Initialize ()
 
void Shutdown ()
 
bool MayDelete () const
 
void SetAdminState (bool down)
 
virtual bool ProcessResourceUpdate (bool res)
 
virtual bool ProcessSandeshMessage (const SandeshMessage *msg, bool resource)=0
 
virtual bool ProcessSandeshCtrlMessage (const std::string &msg, const SandeshHeader &header, const std::string sandesh_name, const uint32_t header_offset)=0
 
virtual void ProcessDisconnect (SandeshSession *sess)=0
 
virtual void ManagedDelete ()=0
 
virtual LifetimeActordeleter ()=0
 
virtual LifetimeManagerlifetime_manager ()=0
 
virtual void Destroy ()=0
 

Protected Attributes

bool is_deleted_
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (SandeshConnection)
 

Private Attributes

TcpServerserver_
 
Endpoint endpoint_
 
bool admin_down_
 
SandeshSessionsession_
 
int task_instance_
 
int task_id_
 
boost::scoped_ptr
< SandeshStateMachine
state_machine_
 

Friends

class SandeshServerStateMachineTest
 

Detailed Description

Definition at line 28 of file sandesh_connection.h.

Member Typedef Documentation

typedef boost::asio::ip::tcp::endpoint SandeshConnection::Endpoint

Definition at line 30 of file sandesh_connection.h.

Constructor & Destructor Documentation

SandeshConnection::SandeshConnection ( const char *  prefix,
TcpServer server,
Endpoint  endpoint,
int  task_instance,
int  task_id 
)

Definition at line 49 of file sandesh_connection.cc.

SandeshConnection::~SandeshConnection ( )
virtual

Definition at line 61 of file sandesh_connection.cc.

Member Function Documentation

void SandeshConnection::AcceptSession ( SandeshSession session)

Definition at line 92 of file sandesh_connection.cc.

Here is the call graph for this function:

virtual LifetimeActor* SandeshConnection::deleter ( )
pure virtual

Implemented in SandeshServerConnection.

virtual void SandeshConnection::Destroy ( )
pure virtual

Implemented in SandeshServerConnection.

SandeshConnection::DISALLOW_COPY_AND_ASSIGN ( SandeshConnection  )
private
Endpoint SandeshConnection::endpoint ( )
inline

Definition at line 41 of file sandesh_connection.h.

int SandeshConnection::GetTaskId ( ) const
inline

Definition at line 56 of file sandesh_connection.h.

int SandeshConnection::GetTaskInstance ( ) const
inline

Definition at line 51 of file sandesh_connection.h.

void SandeshConnection::Initialize ( )
inline

Definition at line 60 of file sandesh_connection.h.

virtual LifetimeManager* SandeshConnection::lifetime_manager ( )
pure virtual

Implemented in SandeshServerConnection.

virtual void SandeshConnection::ManagedDelete ( )
pure virtual

Implemented in SandeshServerConnection.

bool SandeshConnection::MayDelete ( ) const

Definition at line 114 of file sandesh_connection.cc.

virtual void SandeshConnection::ProcessDisconnect ( SandeshSession sess)
pure virtual

Implemented in SandeshServerConnection.

virtual bool SandeshConnection::ProcessResourceUpdate ( bool  res)
inlinevirtual

Reimplemented in SandeshServerConnection.

Definition at line 69 of file sandesh_connection.h.

virtual bool SandeshConnection::ProcessSandeshCtrlMessage ( const std::string &  msg,
const SandeshHeader &  header,
const std::string  sandesh_name,
const uint32_t  header_offset 
)
pure virtual

Implemented in SandeshServerConnection.

virtual bool SandeshConnection::ProcessSandeshMessage ( const SandeshMessage msg,
bool  resource 
)
pure virtual

Implemented in SandeshServerConnection.

bool SandeshConnection::ReceiveMsg ( const std::string &  msg,
SandeshSession session 
)
virtual

Definition at line 72 of file sandesh_connection.cc.

bool SandeshConnection::SendSandesh ( Sandesh snh)

Definition at line 76 of file sandesh_connection.cc.

Here is the call graph for this function:

TcpServer* SandeshConnection::server ( )
inline

Definition at line 39 of file sandesh_connection.h.

SandeshSession * SandeshConnection::session ( ) const

Definition at line 68 of file sandesh_connection.cc.

void SandeshConnection::set_session ( SandeshSession session)

Definition at line 64 of file sandesh_connection.cc.

Here is the call graph for this function:

void SandeshConnection::SetAdminState ( bool  down)

Definition at line 102 of file sandesh_connection.cc.

void SandeshConnection::Shutdown ( void  )

Definition at line 109 of file sandesh_connection.cc.

Here is the call graph for this function:

SandeshStateMachine * SandeshConnection::state_machine ( ) const

Definition at line 98 of file sandesh_connection.cc.

std::string SandeshConnection::StateName ( ) const
inline

Definition at line 49 of file sandesh_connection.h.

Friends And Related Function Documentation

friend class SandeshServerStateMachineTest
friend

Definition at line 86 of file sandesh_connection.h.

Member Data Documentation

bool SandeshConnection::admin_down_
private

Definition at line 90 of file sandesh_connection.h.

Endpoint SandeshConnection::endpoint_
private

Definition at line 89 of file sandesh_connection.h.

bool SandeshConnection::is_deleted_
protected

Definition at line 83 of file sandesh_connection.h.

TcpServer* SandeshConnection::server_
private

Definition at line 88 of file sandesh_connection.h.

SandeshSession* SandeshConnection::session_
private

Definition at line 91 of file sandesh_connection.h.

boost::scoped_ptr<SandeshStateMachine> SandeshConnection::state_machine_
private

Definition at line 94 of file sandesh_connection.h.

int SandeshConnection::task_id_
private

Definition at line 93 of file sandesh_connection.h.

int SandeshConnection::task_instance_
private

Definition at line 92 of file sandesh_connection.h.


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