JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Public Types | Public Member Functions | Protected Attributes
IReader< R_FLAGS, P_FLAGS > Class Template Referenceabstract

#include <IReader.h>

Inheritance diagram for IReader< R_FLAGS, P_FLAGS >:
[legend]
Collaboration diagram for IReader< R_FLAGS, P_FLAGS >:
[legend]

Public Types

typedef JODA_READER_QUEUE< R_FLAGS >::queue_t RQueue
 
typedef JODA_PARSER_QUEUE< P_FLAGS >::queue_t PQueue
 
typedef JODA_READER_QUEUE< R_FLAGS >::payload_t RPayload
 
typedef JODA_PARSER_QUEUE< P_FLAGS >::payload_t PPayload
 
typedef JODA_READER_QUEUE< R_FLAGS > RQueueFactory
 
typedef JODA_PARSER_QUEUE< P_FLAGS > PQueueFactory
 

Public Member Functions

 IReader (std::unique_ptr< RQueue > &rqueue, std::unique_ptr< PQueue > &pqueue)
 
 IReader (std::unique_ptr< RQueue > &rqueue, std::unique_ptr< PQueue > &pqueue, unsigned int maxThreads)
 
virtual ~IReader ()=default
 
virtual void read ()
 
virtual void read (double sample)=0
 
virtual bool finishedReading () const =0
 
- Public Member Functions inherited from IThreadUser
 IThreadUser (size_t maxThreads)
 
virtual ~IThreadUser ()=default
 
virtual void forceThreads (size_t threads)=0
 
virtual size_t getUsedThreads () const =0
 
virtual size_t getMaxThreads () const
 
virtual void setMaxThreads (size_t maxThreads)
 
virtual size_t recommendedThreads () const =0
 

Protected Attributes

std::unique_ptr< RQueue > & rqueue
 
std::unique_ptr< PQueue > & pqueue
 
- Protected Attributes inherited from IThreadUser
size_t maxThreads
 

Detailed Description

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
class IReader< R_FLAGS, P_FLAGS >

Interface for classes reading documents and commiting their contents into a queue The reader and parser flags describe which kind of data can be read and what is returned.

Template Parameters
R_FLAGSFlags representing the source from which this class reads
P_FLAGSFlags representing the output of this reader

Member Typedef Documentation

◆ PPayload

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
typedef JODA_PARSER_QUEUE<P_FLAGS>::payload_t IReader< R_FLAGS, P_FLAGS >::PPayload

◆ PQueue

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
typedef JODA_PARSER_QUEUE<P_FLAGS>::queue_t IReader< R_FLAGS, P_FLAGS >::PQueue

◆ PQueueFactory

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
typedef JODA_PARSER_QUEUE<P_FLAGS> IReader< R_FLAGS, P_FLAGS >::PQueueFactory

◆ RPayload

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
typedef JODA_READER_QUEUE<R_FLAGS>::payload_t IReader< R_FLAGS, P_FLAGS >::RPayload

◆ RQueue

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
typedef JODA_READER_QUEUE<R_FLAGS>::queue_t IReader< R_FLAGS, P_FLAGS >::RQueue

◆ RQueueFactory

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
typedef JODA_READER_QUEUE<R_FLAGS> IReader< R_FLAGS, P_FLAGS >::RQueueFactory

Constructor & Destructor Documentation

◆ IReader() [1/2]

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
IReader< R_FLAGS, P_FLAGS >::IReader ( std::unique_ptr< RQueue > &  rqueue,
std::unique_ptr< PQueue > &  pqueue 
)

Creates a new reader with the given input and output queue

Parameters
rqueueInput queue
pqueueOutput queue

◆ IReader() [2/2]

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
IReader< R_FLAGS, P_FLAGS >::IReader ( std::unique_ptr< RQueue > &  rqueue,
std::unique_ptr< PQueue > &  pqueue,
unsigned int  maxThreads 
)

Creates a new reader with the given input and output queue and a maximum number of threads to use during reading

Parameters
rqueueInput queue
pqueueOutput queue
maxThreadsmaximum number of threads to use during reading

◆ ~IReader()

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
virtual IReader< R_FLAGS, P_FLAGS >::~IReader ( )
virtualdefault

Member Function Documentation

◆ finishedReading()

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
virtual bool IReader< R_FLAGS, P_FLAGS >::finishedReading ( ) const
pure virtual

Checks whether the reader is finished.

Returns

◆ read() [1/2]

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
virtual void IReader< R_FLAGS, P_FLAGS >::read ( )
inlinevirtual

Reads everything that is passed through the queue, and outputs it into the output queue

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read() [2/2]

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
virtual void IReader< R_FLAGS, P_FLAGS >::read ( double  sample)
pure virtual

Reads a sample of everything that is passed through the queue, and outputs it into the output queue

Parameters
sampleThe sample size to take in [0,1]

Field Documentation

◆ pqueue

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
std::unique_ptr<PQueue>& IReader< R_FLAGS, P_FLAGS >::pqueue
protected

◆ rqueue

template<ReaderFlag R_FLAGS, ParserFlag P_FLAGS>
std::unique_ptr<RQueue>& IReader< R_FLAGS, P_FLAGS >::rqueue
protected

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