OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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)
 

Protected Member Functions

 TVirtualTransport ()
 
template<typename Arg_ >
 TVirtualTransport (Arg_ const &arg)
 
template<typename Arg1_ , typename Arg2_ >
 TVirtualTransport (Arg1_ const &a1, Arg2_ const &a2)
 

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

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

Definition at line 130 of file TVirtualTransport.h.

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.

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

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
template<class Transport_, class Super_ = TTransportDefaults>
virtual void contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::consume_virt ( uint32_t  len)
inlinevirtual
template<class Transport_, class Super_ = TTransportDefaults>
virtual int32_t contrail::sandesh::transport::TVirtualTransport< Transport_, Super_ >::read_virt ( uint8_t *  buf,
uint32_t  len 
)
inlinevirtual
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.

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

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