NSCL DDAS  12.1-001
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 (RingItemFactoryBase *pFactory)
 Constructor. More...
 
virtual ~DataSource ()
 Destructor. More...
 
virtual CRingItem * getItem ()=0
 Pure-virtual method to access a ring item from the data source. Must be implemented in derived classes. More...
 
void setFactory (RingItemFactoryBase *pFactory)
 Set a new factory. More...
 

Protected Attributes

RingItemFactoryBase * m_pFactory
 Pointer 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 ( RingItemFactoryBase *  pFactory)

Constructor.

Just saves the factory pointer - note that we gain ownershp of the factory and, therefore, it's deleted on our destruction.

◆ ~DataSource()

DataSource::~DataSource ( )
virtual

Destructor.

Destroys the factory.

Member Function Documentation

◆ getItem()

virtual 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 StreamDataSource, and FdDataSource.

◆ setFactory()

void DataSource::setFactory ( RingItemFactoryBase *  pFactory)

Set a new factory.

Pretty simple:

  • Delete the current factory.
  • Set a new factory e.g. if the format changes.

Member Data Documentation

◆ m_pFactory

RingItemFactoryBase* DataSource::m_pFactory
protected

Pointer to our ring item factory.


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