Apama  10.15.3.4
com::softwareag::connectivity::AbstractCodec Class Reference

Base class for codec plug-ins. More...

#include <sag_connectivity_plugins.hpp>

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

Public Member Functions

 AbstractCodec (const PluginConstructorParameters::CodecConstructorParameters &params)
 Constructor. More...
 
- Public Member Functions inherited from com::softwareag::connectivity::Plugin
virtual ~Plugin ()
 This destructor must be virtual. More...
 
virtual void start ()
 Called when an entire chain has been created and the plugin is allowed to start up (after all plugins are connected together). More...
 
virtual void hostReady ()
 Called some time after start(), when the host is ready to start receiving input (sends will be queued until this point). More...
 
virtual void shutdown ()
 Stop processing messages and terminate and join any background threads. More...
 
const std::string & getName () const
 The name used for this plug-in in the configuration file. More...
 
- Public Member Functions inherited from com::softwareag::connectivity::HostSide
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...
 
- Public Member Functions inherited from com::softwareag::connectivity::TransportSide
virtual ~TransportSide ()
 Ensure virtual destruction. More...
 
virtual void sendBatchTowardsTransport (Message *start, Message *end)=0
 Abstract method that must be implemented to handle delivery of a batch of messages heading towards the transport. More...
 
void sendBatchTowardsTransport (Message &&message)
 Overload for sending a batch containing a single message. More...
 
template<typename IT >
auto sendBatchTowardsTransport (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...
 

Protected Attributes

HostSide::ptr_t hostSide
 The next plug-in in the chain towards host. More...
 
TransportSide::ptr_t transportSide
 The next plug-in in the chain towards transport. More...
 
- Protected Attributes inherited from com::softwareag::connectivity::Plugin
const std::string pluginName
 The name used for this plug-in in the configuration file. More...
 
const std::string chainId
 The identifier used for the chain this plug-in is part of. More...
 
map_t config
 The configuration of this plug-in. More...
 
const PluginHost::ptr_t host
 Interface to support miscellaneous requests from this plug-in to the host system. More...
 

Additional Inherited Members

- Public Types inherited from com::softwareag::connectivity::HostSide
typedef std::unique_ptr< HostSideptr_t
 Pointers to HostSides should always be this ptr_t type, which is a std::unique_ptr. More...
 
- Public Types inherited from com::softwareag::connectivity::TransportSide
typedef std::unique_ptr< TransportSideptr_t
 Pointers to TransportSides should always be this ptr_t type, which is a std::unique_ptr. More...
 
- Public Attributes inherited from com::softwareag::connectivity::Plugin
Logger logger
 Logging for writing to the host log file. More...
 
- Protected Member Functions inherited from com::softwareag::connectivity::Plugin
StatusReportergetStatusReporter ()
 Allows reporting status information from this plug-in, such as online or failed status and number of messages sent/received in each direction. More...
 

Detailed Description

Base class for codec plug-ins.

Implementors may derive directly from this class, providing an implementation of its abstract methods to provide any required transformation of Message objects as they are sent towards the transport or host side. For many codecs, inheriting from AbstractSimpleCodec may be more convenient than using this class directly, as it deals with batching of messages and ignoring messages with null payloads.

To export a codec class for use in the host you should use the SAG_DECLARE_CONNECTIVITY_CODEC_CLASS(Class) macro, and provide a public constructor with the same signature as AbstractCodec(const PluginConstructorParameters::CodecConstructorParameters &).

MapExtractor can be used to extract the content of the message.

Derives from Plugin, which provides Plugin::pluginName, Plugin::chainId, Plugin::config and Plugin::logger members. Derives from HostSide, requiring derived classes to implement sendBatchTowardsHost(Message*, Message*) Derives from TransportSide, requiring derived classes to implement sendBatchTowardsTransport(Message*, Message*)

Constructor & Destructor Documentation

◆ AbstractCodec()

com::softwareag::connectivity::AbstractCodec::AbstractCodec ( const PluginConstructorParameters::CodecConstructorParameters params)
inline

Constructor.

A subclass should provide its own constructor with the same signature as this one.

A plug-in should throw an exception from the constructor if there is a problem with the configuration or any other error that will prevent the plug-in from working correctly.

Parameters
paramsProvides access to the configuration for this plug-in, and other capabilities.
Since
9.12.0.1

Member Data Documentation

◆ hostSide

HostSide::ptr_t com::softwareag::connectivity::AbstractCodec::hostSide
protected

The next plug-in in the chain towards host.

This field will be given a valid value before the start() method is called.

◆ transportSide

TransportSide::ptr_t com::softwareag::connectivity::AbstractCodec::transportSide
protected

The next plug-in in the chain towards transport.

This field will be given a valid value before the start() method is called.


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