AbstractInput
class AbstractInput : public std::enable_shared_from_this<AbstractInput>
@bried The AbstractInput class is the base for input classes in Karabo
Their specific implementation defines how the input acquires data. This can be either through a network or in memory connection, or through a data source accessing persited data.
Functions
| Name | Description |
|---|---|
| reconfigure | Reconfigure the input, e.g. to use a different data source input : |
| setInstanceId | Register a SignalSlotable instance to this input instanceId : |
| getInstanceId | Get the registered SignalSlotable instance Return : |
| setInputHandlerType | Set language handling input parsing language : may be C++ or PYTHOn inputType : type of input |
| getInputHandler | Get the registered input Handler Return : |
| registerIOEventHandler | Register a handler to be called for I/O events |
| registerEndOfStreamEventHandler | Register a handler to be called for end of stream events. |
| needsDeviceConnection | Return if this input needs to used in the context of a device Return : |
| getConnectedOutputChannels | Get the output channels connected to this input Return : |
| connect | Connect this input to an output channel as specified by its configuration. |
| disconnect | Disconnect the output channel specified by its configuration outputChannelInfo : |
| canCompute | Should return true if the input can handle more data Return : |
| update | Update the input to an receiving state |
| respondsToEndOfStream | Check if the input responds to end of stream events, e.g. by calling the registered handler. Return : |
| triggerIOEvent | Trigger an I/O event in the event handler |
| triggerEndOfStreamEvent | Trigger an end of stream event in the event handler. |
Function Details
canCompute
virtual bool canCompute() const
Should return true if the input can handle more data
Return :
connect
virtual void connect(const karabo::data::Hash& outputChannelInfo)
Connect this input to an output channel as specified by its configuration.
outputChannelInfo
:
disconnect
virtual void disconnect(const karabo::data::Hash& outputChannelInfo)
Disconnect the output channel specified by its configuration
outputChannelInfo
:
getConnectedOutputChannels
virtual std::vector<karabo::data::Hash> getConnectedOutputChannels()
Get the output channels connected to this input
Return :
getInputHandler
InputHandler::Pointer getInputHandler()
Get the registered input Handler
Return :
getInstanceId
const std::string& getInstanceId() const
Get the registered SignalSlotable instance
Return :
needsDeviceConnection
virtual bool needsDeviceConnection() const
Return if this input needs to used in the context of a device
Return :
reconfigure
virtual void reconfigure(const karabo::data::Hash& input)
Reconfigure the input, e.g. to use a different data source
input
:
registerEndOfStreamEventHandler
void registerEndOfStreamEventHandler(const std::any& endOfStreamEventHandler)
Register a handler to be called for end of stream events. End of stream event are used to signify that a group of related data tokens is complete and that a new group of data token follow
endOfStreamEventHandler
:
registerIOEventHandler
void registerIOEventHandler(const std::any& ioEventHandler)
Register a handler to be called for I/O events
respondsToEndOfStream
virtual bool respondsToEndOfStream()
Check if the input responds to end of stream events, e.g. by calling the registered handler.
Return :
setInputHandlerType
void setInputHandlerType(const std::string& language, const std::string& inputType)
Set language handling input parsing
language
: may be C++ or PYTHOn
inputType
: type of input
setInstanceId
void setInstanceId(const std::string& instanceId)
Register a SignalSlotable instance to this input
instanceId
:
triggerEndOfStreamEvent
void triggerEndOfStreamEvent()
Trigger an end of stream event in the event handler.
triggerIOEvent
void triggerIOEvent()
Trigger an I/O event in the event handler
update
virtual void update()
Update the input to an receiving state