NSCL DDAS 12.2-009
Support for XIA DDAS at FRIB
Public Member Functions | Protected Attributes | List of all members
DataSource Class Referenceabstract

Abstract base class for DDAS data sources. More...

#include <DataSource.h>

Inheritance diagram for DataSource:
Inheritance graph
[legend]

Public Member Functions

 DataSource (ufmt::RingItemFactoryBase *pFactory)
 Constructor. More...
 
virtual ~DataSource ()=default
 Destructor. More...
 
virtual ufmt::CRingItem * getItem ()=0
 Pure-virtual method to access a ring item from the data source. Must be implemented in derived classes. More...
 
void setFactory (ufmt::RingItemFactoryBase *pFactory)
 Set a new factory. More...
 

Protected Attributes

ufmt::RingItemFactoryBase * m_pFactory
 Ptr to our ring item factory. More...
 

Detailed Description

Abstract base class for DDAS data sources.

Pure abstract data source which uses a factory's ring item getters to provide ring items from a data source. Since the factory provides this, we'll need concrete classes:

Constructor & Destructor Documentation

◆ DataSource()

DataSource::DataSource ( ufmt::RingItemFactoryBase *  pFactory)

Constructor.

Parameters
pFactoryPointer to concrete ring item factory.

Just saves the factory pointer - note that the format factory selector maintains ownership of the factory.

◆ ~DataSource()

virtual DataSource::~DataSource ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getItem()

virtual ufmt::CRingItem * DataSource::getItem ( )
pure virtual

Pure-virtual method to access a ring item from the data source. Must be implemented in derived classes.

Returns
Pointer to the next ring item from the source.

Implemented in FdDataSource, and StreamDataSource.

◆ setFactory()

void DataSource::setFactory ( ufmt::RingItemFactoryBase *  pFactory)

Set a new factory.

Pretty simple: Set a new factory e.g., if the format changes. Note that since we do not own the factory we do not delete the old one.

Member Data Documentation

◆ m_pFactory

ufmt::RingItemFactoryBase* DataSource::m_pFactory
protected

Ptr to our ring item factory.


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