forb
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
forb::base_stub Class Referenceabstract

The class from which any automatically generated stub will inherit. More...

#include <base_stub.hpp>

Public Types

using buffer_size_t = forb::streams::shared_memory::size_t
 The type of the buffer size.
 

Public Member Functions

virtual ~base_stub () noexcept=default
 Virtual destructor.
 
 base_stub (const base_stub &other)=delete
 This class does not support copy construction.
 
base_stuboperator= (const base_stub &other)=delete
 This class does not support copy assignment.
 
 base_stub (base_stub &&other)=delete
 This class does not support move construction.
 
base_stuboperator= (base_stub &&other)=delete
 This class does not support move assignment.
 
shared_memory::size_t buffer_size () const
 The size of the buffer within the shared memory (if shared memory is adopted as data exchange stream). More...
 

Protected Member Functions

 base_stub ()=default
 Default constructor, creates an empty stub handle. More...
 
void init_call (call_id_t code)
 Initializes a new call request.
 
void wait_return ()
 Waits the termination of the call request. More...
 
virtual bool _match (const std::string &type) const =0
 Returns true of the type string equals the fully qualified name of the given stub class.
 
virtual remote_var _create_empty () const =0
 Creates a new empty stub object of the current type.
 

Static Protected Member Functions

static std::vector< base_stub * > & _protos ()
 Returns a reference to the vector of prototypes of all known stub implementations.
 

Protected Attributes

std::mutex _mutex
 The mutex that avoids concurrent call requests using the same stub handle.
 
streamrpcstream = nullptr
 The pointer to the stream that will be used to make call requests. More...
 
streamdatastream = nullptr
 The pointer to the stream that will be used to exchange data. More...
 

Friends

class remote_registry
 The forb::remote_registry class will be able to call private methods of this class, to instantiate correctly new instances. More...
 

Detailed Description

The class from which any automatically generated stub will inherit.

Constructor & Destructor Documentation

§ base_stub()

forb::base_stub::base_stub ( )
explicitprotecteddefault

Default constructor, creates an empty stub handle.

The optional argument is the size of the buffer within the shared memory area (if shared memory is used).

Member Function Documentation

§ buffer_size()

shared_memory::size_t forb::base_stub::buffer_size ( ) const
inline

The size of the buffer within the shared memory (if shared memory is adopted as data exchange stream).

§ wait_return()

void forb::base_stub::wait_return ( )
protected

Waits the termination of the call request.

Actually this method waits the remote host to read all incoming parameters, not to actually perform the call. This way, signal-like paradigm calls are supported efficiently.

Friends And Related Function Documentation

§ remote_registry

friend class remote_registry
friend

The forb::remote_registry class will be able to call private methods of this class, to instantiate correctly new instances.

Member Data Documentation

§ datastream

stream* forb::base_stub::datastream = nullptr
protected

The pointer to the stream that will be used to exchange data.

This may point either to _socket or to _shmem attributes.

§ rpcstream

stream* forb::base_stub::rpcstream = nullptr
protected

The pointer to the stream that will be used to make call requests.

In this implementation this is always pointing to _socket attribute.


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