/** * \file BaseDataSource.h * \brief The base class for all data sources * \author M. T * * * */ #ifndef _ASGARD_BASEDATASOURCE_H #define _ASGARD_BASEDATASOURCE_H using namespace std; namespace asgard { /** @brief The base class for all data sources. */ class BaseDataSource { protected: //! the number of instances unsigned long numberOfInstances; //! the number of dimensions unsigned long numberOfDimensions; public: /** * \brief Base Data Source constructor * \param ni the number of instances * \param nd the number of dimensions */ BaseDataSource(unsigned long ni = 0, unsigned long nd = 0): numberOfInstances(ni), numberOfDimensions(nd){} //! Base Data Source destructor virtual ~BaseDataSource(){} /** * \brief Sets the number of instances of the data source. * \param n the number of instances to be set */ void setNumberOfInstances(unsigned long n){ numberOfInstances=n; } /** * \brief Retrieves the number of instances of the data source. * \return the number of instances */ unsigned long getNumberOfInstances() const { return numberOfInstances; } /** * \brief Sets the number of dimensions of each instance of the data source. * \param n the number of dimensions */ void setNumberOfDimensions(unsigned long n){ numberOfDimensions=n; } /** * \brief Retrieves the number of dimensions of each instance of the data source. * \return the number of dimensions */ unsigned long getNumberOfDimensions() const{ return numberOfDimensions; } /** * \brief Retrieves the size of the data source. * \return the size of the data source */ unsigned long size() const { return numberOfInstances*numberOfDimensions; } }; } #endif