Common message for single slave selections.

This commit is contained in:
Florian Pose
2008-07-28 08:45:28 +00:00
parent 2d63291b35
commit 68fda22e00
7 changed files with 21 additions and 15 deletions
+14 -2
View File
@@ -80,20 +80,32 @@ string Command::numericInfo()
/*****************************************************************************/
void Command::throwInvalidUsageException(const stringstream &s)
void Command::throwInvalidUsageException(const stringstream &s) const
{
throw InvalidUsageException(s);
}
/*****************************************************************************/
void Command::throwCommandException(const stringstream &s)
void Command::throwCommandException(const stringstream &s) const
{
throw CommandException(s);
}
/*****************************************************************************/
void Command::throwSingleSlaveRequired(unsigned int size) const
{
stringstream err;
err << "The slave selection matches " << size << "slaves. '"
<< name << "' requires a single slave.";
throwInvalidUsageException(err);
}
/*****************************************************************************/
Command::SlaveList Command::selectedSlaves(MasterDevice &m)
{
unsigned int numSlaves = m.slaveCount(), i, aliasIndex;