OpenSDN source code
contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ > Class Template Reference

#include <TVirtualTransport.h>

Inheritance diagram for contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >:
Collaboration diagram for contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >:

Public Member Functions

virtual int32_t read_virt (uint8_t *buf, uint32_t len)
 
virtual int32_t readAll_virt (uint8_t *buf, uint32_t len)
 
virtual int write_virt (const uint8_t *buf, uint32_t len)
 
virtual const uint8_t * borrow_virt (uint8_t *buf, uint32_t *len)
 
virtual void consume_virt (uint32_t len)
 
uint32_t readAll (uint8_t *buf, uint32_t len)
 
- Public Member Functions inherited from contrail::sandesh::transport::TTransportDefaults
uint32_t read (uint8_t *buf, uint32_t len)
 
uint32_t readAll (uint8_t *buf, uint32_t len)
 
int write (const uint8_t *buf, uint32_t len)
 
const uint8_t * borrow (uint8_t *buf, uint32_t *len)
 
void consume (uint32_t len)
 
- Public Member Functions inherited from contrail::sandesh::transport::TTransport
virtual ~TTransport ()
 
virtual bool isOpen ()
 
virtual bool peek ()
 
virtual void open ()
 
virtual void close ()
 
int32_t read (uint8_t *buf, uint32_t len)
 
int32_t readAll (uint8_t *buf, uint32_t len)
 
virtual uint32_t readEnd ()
 
int write (const uint8_t *buf, uint32_t len)
 
virtual uint32_t writeEnd ()
 
virtual void flush ()
 
const uint8_t * borrow (uint8_t *buf, uint32_t *len)
 
void consume (uint32_t len)
 

Protected Member Functions

 TVirtualTransport ()
 
template<typename Arg_ >
 TVirtualTransport (Arg_ const &arg)
 
template<typename Arg1_ , typename Arg2_ >
 TVirtualTransport (Arg1_ const &a1, Arg2_ const &a2)
 
- Protected Member Functions inherited from contrail::sandesh::transport::TTransportDefaults
 TTransportDefaults ()
 
- Protected Member Functions inherited from contrail::sandesh::transport::TTransport
 TTransport ()
 

Detailed Description

template<class Transport_, class Super_ = TTransportDefaults>
class contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >

Helper class to provide polymorphism for subclasses of TTransport.

This class implements *_virt() methods of TTransport, to call the non-virtual versions of these functions in the proper subclass.

To define your own transport class using TVirtualTransport: 1) Derive your subclass from TVirtualTransport<your class> e.g: class MyTransport : public TVirtualTransport<MyTransport> { 2) Provide your own implementations of read(), readAll(), etc. These methods should be non-virtual.

Transport implementations that need to use virtual inheritance when inheriting from TTransport cannot use TVirtualTransport.

Author
Chad Walters chad@.nosp@m.powe.nosp@m.rset..nosp@m.com

Definition at line 88 of file TVirtualTransport.h.

Constructor & Destructor Documentation

◆ TVirtualTransport() [1/3]

template<class Transport_ , class Super_ = TTransportDefaults>
contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::TVirtualTransport ( )
inlineprotected

Definition at line 130 of file TVirtualTransport.h.

◆ TVirtualTransport() [2/3]

template<class Transport_ , class Super_ = TTransportDefaults>
template<typename Arg_ >
contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::TVirtualTransport ( Arg_ const &  arg)
inlineprotected

Definition at line 138 of file TVirtualTransport.h.

◆ TVirtualTransport() [3/3]

template<class Transport_ , class Super_ = TTransportDefaults>
template<typename Arg1_ , typename Arg2_ >
contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::TVirtualTransport ( Arg1_ const &  a1,
Arg2_ const &  a2 
)
inlineprotected

Definition at line 141 of file TVirtualTransport.h.

Member Function Documentation

◆ borrow_virt()

template<class Transport_ , class Super_ = TTransportDefaults>
virtual const uint8_t* contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::borrow_virt ( uint8_t *  buf,
uint32_t *  len 
)
inlinevirtual

Reimplemented from contrail::sandesh::transport::TTransport.

Reimplemented in contrail::sandesh::transport::TVirtualTransport< TMemoryBuffer, TBufferBase >.

Definition at line 106 of file TVirtualTransport.h.

Here is the call graph for this function:

◆ consume_virt()

template<class Transport_ , class Super_ = TTransportDefaults>
virtual void contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::consume_virt ( uint32_t  len)
inlinevirtual

Reimplemented from contrail::sandesh::transport::TTransport.

Reimplemented in contrail::sandesh::transport::TVirtualTransport< TMemoryBuffer, TBufferBase >.

Definition at line 110 of file TVirtualTransport.h.

Here is the call graph for this function:

◆ read_virt()

template<class Transport_ , class Super_ = TTransportDefaults>
virtual int32_t contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::read_virt ( uint8_t *  buf,
uint32_t  len 
)
inlinevirtual

Reimplemented from contrail::sandesh::transport::TTransport.

Reimplemented in contrail::sandesh::transport::TVirtualTransport< TMemoryBuffer, TBufferBase >.

Definition at line 94 of file TVirtualTransport.h.

Here is the call graph for this function:

◆ readAll()

template<class Transport_ , class Super_ = TTransportDefaults>
uint32_t contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::readAll ( uint8_t *  buf,
uint32_t  len 
)
inline

Definition at line 124 of file TVirtualTransport.h.

Here is the call graph for this function:

◆ readAll_virt()

template<class Transport_ , class Super_ = TTransportDefaults>
virtual int32_t contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::readAll_virt ( uint8_t *  buf,
uint32_t  len 
)
inlinevirtual

Reimplemented from contrail::sandesh::transport::TTransport.

Reimplemented in contrail::sandesh::transport::TVirtualTransport< TMemoryBuffer, TBufferBase >.

Definition at line 98 of file TVirtualTransport.h.

Here is the call graph for this function:

◆ write_virt()

template<class Transport_ , class Super_ = TTransportDefaults>
virtual int contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::write_virt ( const uint8_t *  buf,
uint32_t  len 
)
inlinevirtual

Reimplemented from contrail::sandesh::transport::TTransport.

Reimplemented in contrail::sandesh::transport::TVirtualTransport< TMemoryBuffer, TBufferBase >.

Definition at line 102 of file TVirtualTransport.h.

Here is the call graph for this function:

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