Commit dc19df5d authored by JP Dinger's avatar JP Dinger

Skins2: Use typedefs for internal template-derived types, and rectify an...

Skins2: Use typedefs for internal template-derived types, and rectify an accidental skip while removing.
parent bebef5dc
......@@ -89,22 +89,22 @@ void AsyncQueue::push( const CmdGenericPtr &rcCommand, bool removePrev )
void AsyncQueue::remove( const string &rType, const CmdGenericPtr &rcCommand )
{
list<CmdGenericPtr>::iterator it;
for( it = m_cmdList.begin(); it != m_cmdList.end(); it++ )
cmdList_t::iterator it;
for( it = m_cmdList.begin(); it != m_cmdList.end(); /* nothing */ )
{
// Remove the command if it is of the given type
if( (*it).get()->getType() == rType )
// Remove the command if it is of the given type and the command
// doesn't disagree. Note trickery to avoid skipping entries
// while maintaining iterator validity.
if( (*it).get()->getType() == rType &&
rcCommand.get()->checkRemove( (*it).get() ) )
{
// Maybe the command wants to check if it must really be
// removed
if( rcCommand.get()->checkRemove( (*it).get() ) == true )
{
list<CmdGenericPtr>::iterator itNew = it;
itNew++;
m_cmdList.erase( it );
it = itNew;
}
cmdList_t::iterator itNew = it;
++itNew;
m_cmdList.erase( it );
it = itNew;
}
else ++it;
}
}
......
......@@ -56,7 +56,8 @@ public:
private:
/// Command queue
list<CmdGenericPtr> m_cmdList;
typedef std::list<CmdGenericPtr> cmdList_t;
cmdList_t m_cmdList;
/// Timer
OSTimer *m_pTimer;
/// Mutex
......
......@@ -26,8 +26,8 @@
void CmdMuxer::execute()
{
list<CmdGeneric*>::const_iterator it;
for( it = m_list.begin(); it != m_list.end(); it++ )
cmdList_t::const_iterator it;
for( it = m_list.begin(); it != m_list.end(); ++it )
{
(*it)->execute();
}
......
......@@ -40,7 +40,8 @@ public:
private:
/// List of commands we will execute sequentially
list<CmdGeneric*> m_list;
typedef std::list<CmdGeneric*> cmdList_t;
cmdList_t m_list;
};
#endif
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