Max OS 0.3
Loading...
Searching...
No Matches
MaxOS::common::InputStreamEventHandler< Type > Class Template Reference

Handles read and end of stream events from a set of streams. More...

#include <inputStream.h>

Inheritance diagram for MaxOS::common::InputStreamEventHandler< Type >:
MaxOS::common::InputStreamProcessor< Type, Type > MaxOS::common::InputStreamProcessor< Type, Type * > MaxOS::common::InputStreamProcessor< string, string > MaxOS::common::InputStreamProcessor< Type, ProcessorType > MaxOS::common::GenericOutputStream< Type > MaxOS::common::InputStreamSocket< Type > MaxOS::common::InputStreamBuffer< Type > MaxOS::common::GenericOutputStream< string > MaxOS::common::OutputStream MaxOS::Logger MaxOS::drivers::SerialConsole MaxOS::drivers::console::ConsoleStream

Public Member Functions

 InputStreamEventHandler ()
 _______________________________________________TEMPLATES_________________________________________________________________///
 
 ~InputStreamEventHandler ()
 Destroys the InputStreamProcessor and disconnects it from all streams.
 
virtual void on_stream_read (Type)
 Called when data is read from a stream (overridden by subclasses)
 
virtual void on_end_of_stream (GenericInputStream< Type > *)
 Called when a stream has finished. Removes the stream from the array of streams.
 

Protected Attributes

common::Vector< GenericInputStream< Type > * > m_generic_input_streams
 List of streams being observed by this handler.
 

Friends

class GenericInputStream< Type >
 

Detailed Description

template<class Type>
class MaxOS::common::InputStreamEventHandler< Type >

Handles read and end of stream events from a set of streams.

Template Parameters
TypeThe type of data the stream is handling

Definition at line 29 of file inputStream.h.

Constructor & Destructor Documentation

◆ InputStreamEventHandler()

template<class Type >
MaxOS::common::InputStreamEventHandler< Type >::InputStreamEventHandler ( )
default

_______________________________________________TEMPLATES_________________________________________________________________///

Creates a new InputStreamProcessor

Template Parameters
Typethe type of data the stream is handling

◆ ~InputStreamEventHandler()

Destroys the InputStreamProcessor and disconnects it from all streams.

Template Parameters
Typethe type of data the stream is handling

Definition at line 161 of file inputStream.h.

161 {
162
163 // Disconnect the handler from all streams
164 while(!m_generic_input_streams.empty())
165 (*m_generic_input_streams.begin())->disconnect_input_stream_event_handler(this);
166
167 }
common::Vector< GenericInputStream< Type > * > m_generic_input_streams
List of streams being observed by this handler.
Definition inputStream.h:33

Member Function Documentation

◆ on_end_of_stream()

◆ on_stream_read()

template<class Type >
void MaxOS::common::InputStreamEventHandler< Type >::on_stream_read ( Type  )
virtual

Called when data is read from a stream (overridden by subclasses)

Template Parameters
Typethe type of data the stream is handling

Reimplemented in MaxOS::common::GenericOutputStream< string >, MaxOS::common::InputStreamSocket< Type >, MaxOS::common::InputStreamBuffer< Type >, and MaxOS::common::GenericOutputStream< Type >.

Definition at line 174 of file inputStream.h.

174 {
175
176 }

Referenced by MaxOS::common::InputStreamBuffer< Type >::flush(), and MaxOS::common::InputStreamSocket< Type >::on_stream_read().

Friends And Related Symbol Documentation

◆ GenericInputStream< Type >

template<class Type >
friend class GenericInputStream< Type >
friend

Definition at line 416 of file inputStream.h.

Member Data Documentation

◆ m_generic_input_streams

template<class Type >
common::Vector<GenericInputStream<Type>*> MaxOS::common::InputStreamEventHandler< Type >::m_generic_input_streams
protected

List of streams being observed by this handler.

Definition at line 33 of file inputStream.h.


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