WDataHandler.cpp 1.45 KB
Newer Older
wiebel's avatar
wiebel committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
//---------------------------------------------------------------------------
//
// Project: OpenWalnut
//
// Copyright 2009 SomeCopyrightowner
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------

#include "WDataHandler.h"
#include "WDataSet.h"
#include "exceptions/WNoSuchDataSetException.h"

math's avatar
math committed
28
boost::shared_ptr< const WDataSet > WDataHandler::getDataSet( const unsigned int dataSetId ) const
wiebel's avatar
wiebel committed
29 30
{
    if( dataSetId >= m_dataSets.size() )
math's avatar
math committed
31 32
        throw WNoSuchDataSetException( "Index too large." );
    return m_dataSets.at(dataSetId);
wiebel's avatar
wiebel committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
}

void WDataHandler::addDataSet( boost::shared_ptr< WDataSet > newDataSet )
{
    m_dataSets.push_back( newDataSet );
}

unsigned int WDataHandler::getNumberOfDataSets() const
{
    return m_dataSets.size();
}