looks a bad idea to have asymmetrical const/nonconst 'at's

This commit is contained in:
Caolán McNamara 2011-08-26 21:33:36 +01:00
parent 67785b7449
commit aaae59cbf2
2 changed files with 21 additions and 35 deletions

View file

@ -371,24 +371,6 @@ void BreakPointList::ResetHitCount()
}
}
size_t BreakPointList::size() const
{
return maBreakPoints.size();
}
BreakPoint* BreakPointList::at( size_t i )
{
if ( i < maBreakPoints.size() )
return maBreakPoints[ i ];
else
return NULL;
}
const BreakPoint* BreakPointList::at( size_t i ) const
{
return maBreakPoints[ i ];
}
BreakPoint* BreakPointList::remove( BreakPoint* ptr )
{
for ( vector< BreakPoint* >::iterator i = maBreakPoints.begin(); i < maBreakPoints.end(); ++i )
@ -402,17 +384,6 @@ BreakPoint* BreakPointList::remove( BreakPoint* ptr )
return NULL;
}
void BreakPointList::push_back( BreakPoint* item )
{
maBreakPoints.push_back( item );
}
void BreakPointList::clear()
{
maBreakPoints.clear();
}
void IDEBaseWindow::Deactivating()
{
}

View file

@ -128,12 +128,27 @@ public:
void SetBreakPointsInBasic( SbModule* pModule );
void ResetHitCount();
size_t size() const;
BreakPoint* at( size_t i );
const BreakPoint* at( size_t i ) const;
BreakPoint* remove( BreakPoint* ptr );
void push_back( BreakPoint* item );
void clear();
size_t size() const
{
return maBreakPoints.size();
}
BreakPoint* at( size_t i )
{
return i < maBreakPoints.size() ? maBreakPoints[ i ] : NULL;
}
const BreakPoint* at( size_t i ) const
{
return i < maBreakPoints.size() ? maBreakPoints[ i ] : NULL;
}
void push_back( BreakPoint* item )
{
maBreakPoints.push_back( item );
}
void clear()
{
maBreakPoints.clear();
}
BreakPoint* remove( BreakPoint* ptr );
};
// helper class for sorting TabBar