Apama  10.15.3.4
com::softwareag::connectivity::HostSide Class Referenceabstract

An interface to the next component (plugin or host) towards the host. More...

#include <sag_connectivity_plugins.hpp>

Inheritance diagram for com::softwareag::connectivity::HostSide:
com::softwareag::connectivity::AbstractCodec com::softwareag::connectivity::AbstractSimpleCodec

Public Types

typedef std::unique_ptr< HostSideptr_t
 Pointers to HostSides should always be this ptr_t type, which is a std::unique_ptr. More...
 

Public Member Functions

virtual ~HostSide ()
 Ensure virtual destruction. More...
 
virtual void sendBatchTowardsHost (Message *start, Message *end)=0
 Abstract method that must be implemented to handle delivery of a batch of messages heading towards the host. More...
 
void sendBatchTowardsHost (Message &&message)
 Overload for sending a batch containing a single message. More...
 
template<typename IT >
auto sendBatchTowardsHost (const IT &begin, const IT &end) -> typename std::enable_if< !std::is_const< ampl::remove_ref_t< decltype(*begin)>>::value &&ampl::is_same< Message, ampl::remove_const_t< ampl::remove_ref_t< decltype(*begin)>>>::value, void >::type
 Overload for sending messages using an iterator range. More...
 

Detailed Description

An interface to the next component (plugin or host) towards the host.

Contains the method to send messages towards the host.

Member Typedef Documentation

◆ ptr_t

Pointers to HostSides should always be this ptr_t type, which is a std::unique_ptr.

Constructor & Destructor Documentation

◆ ~HostSide()

virtual com::softwareag::connectivity::HostSide::~HostSide ( )
inlinevirtual

Ensure virtual destruction.

Member Function Documentation

◆ sendBatchTowardsHost() [1/3]

virtual void com::softwareag::connectivity::HostSide::sendBatchTowardsHost ( Message start,
Message end 
)
pure virtual

Abstract method that must be implemented to handle delivery of a batch of messages heading towards the host.

Messages should be processed and passed to the next connectivity plug-in in the chain, which is typically provided by the Transport's or Codec's hostSide pointer.

Implementors of this method are permitted to modify the contents of the messages (for example a codec may apply transformations to messages sent from a transport or host), though not to delete them.

The ability to handle messages in batches is provided to allow amortising the costs of delivering messages. The batch is defined as all Messages from start up to but excluding end. The callee may modify the messages, typically by moving their contents elsewhere.

Threading: Plug-ins are required to ensure that they do not call into the next plug-in in their chain from more than one thread concurrently (although it does not have to be the same thread each time). Plug-ins may therefore assume that no additional locking is required in this method to protect access to the plug-in's state. The plug-in should be as responsive as possible to the Plugin.shutdown() method, which may be called at any time on any thread, and should result in any calls into this unblocking and returning promptly. If this method throws then the exception will be logged and the batch of messages dropped.

Implemented in com::softwareag::connectivity::AbstractSimpleCodec.

◆ sendBatchTowardsHost() [2/3]

void com::softwareag::connectivity::HostSide::sendBatchTowardsHost ( Message &&  message)
inline

Overload for sending a batch containing a single message.

As sendBatchTowardsHost(Message*, Message*), but allows a single message to be sent.

Since
10.2

◆ sendBatchTowardsHost() [3/3]

template<typename IT >
auto com::softwareag::connectivity::HostSide::sendBatchTowardsHost ( const IT &  begin,
const IT &  end 
) -> typename std::enable_if< !std::is_const<ampl::remove_ref_t<decltype(*begin)>>::value && ampl::is_same<Message, ampl::remove_const_t<ampl::remove_ref_t<decltype(*begin)>>>::value , void>::type
inline

Overload for sending messages using an iterator range.

As sendBatchTowardsHost(Message*, Message*), but allows bidirectional iterators over Messages to be used.

Thus, can use std::vector<Message> msgs; sendBatchTowardsHost(msgs.begin(), msgs.end());

Since
10.2

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