Commit 1dc2efd9 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[ADD #103] added operator[] for WSubject and WDataHadnler.

parent e29be52e
......@@ -41,6 +41,10 @@ boost::shared_ptr< const WSubject > WDataHandler::getSubject( const unsigned int
return m_subjects.at( subjectId );
}
boost::shared_ptr< const WSubject > WDataHandler::operator[]( size_t subjectId ) const
{
return getSubject( subjectId );
}
void WDataHandler::addSubject( boost::shared_ptr< WSubject > newSubject )
{
......
......@@ -57,6 +57,12 @@ public:
*/
boost::shared_ptr< const WSubject > getSubject( const unsigned int subjectId ) const;
/**
* Returns a to the i'th WSubject. The return type is const since we
* want to ensure that each subject cannot modified after retrival.
*/
boost::shared_ptr< const WSubject > operator[]( size_t subjectId ) const;
/**
* Insert a new WSubject referenced by a pointer.
*/
......
......@@ -36,6 +36,11 @@ boost::shared_ptr< const WDataSet > WSubject::getDataSet( const unsigned int dat
return m_dataSets.at( dataSetId );
}
boost::shared_ptr< const WDataSet > WSubject::operator[]( const unsigned int dataSetId ) const
{
return getDataSet( dataSetId );
}
void WSubject::addDataSet( boost::shared_ptr< WDataSet > newDataSet )
{
......
......@@ -46,7 +46,13 @@ public:
* Get the pointer to the i'th WDataSet. The return type is const since we
* want to ensure that each DataSet cannot modified after retrival.
*/
boost::shared_ptr< const WDataSet > getDataSet( const unsigned int subjectId ) const;
boost::shared_ptr< const WDataSet > getDataSet( const unsigned int dataSetId ) const;
/**
* Returns a to the i'th WSubject. The return type is const since we
* want to ensure that each subject cannot modified after retrival.
*/
boost::shared_ptr< const WDataSet > operator[]( const unsigned int dataSetId ) const;
/**
* Insert a new DataSet referenced by a pointer.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment