X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fblockiter.cpp;h=e662a92ad2020337088d1055d8850c5c0cc93620;hb=1c072afdb1866ba397ee8e6155f5f68c6c7ab4da;hp=db052ac5e059da47a50e6b3945e01817928596c2;hpb=1ff06c5bc46a677fa389ef86c6b26664368f1653;p=r2c2.git diff --git a/source/libr2c2/blockiter.cpp b/source/libr2c2/blockiter.cpp index db052ac..e662a92 100644 --- a/source/libr2c2/blockiter.cpp +++ b/source/libr2c2/blockiter.cpp @@ -1,11 +1,3 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - -#include #include "block.h" #include "blockiter.h" #include "route.h" @@ -26,7 +18,7 @@ BlockIter::BlockIter(Block *b, unsigned e): _entry(b ? e : 0) { if(_block && _entry>_block->get_endpoints().size()) - throw InvalidParameterValue("Endpoint index not valid for block"); + throw out_of_range("BlockIter::BlockIter"); } TrackIter BlockIter::track_iter() const @@ -41,7 +33,7 @@ TrackIter BlockIter::track_iter() const const Block::Endpoint &BlockIter::endpoint() const { if(!_block) - throw InvalidState("BlockIter is null"); + throw logic_error("null block"); return _block->get_endpoint(_entry); } @@ -54,7 +46,7 @@ int BlockIter::get_exit(const Route *route) const while(t_iter) { if(!_block->has_track(*t_iter)) - throw LogicError("Block traversal strayed out of the block"); + throw logic_error("internal error (block traversal escaped the block)"); unsigned path = (route ? route->get_path(*t_iter) : t_iter->get_active_path()); TrackIter t_exit = t_iter.reverse(path); @@ -112,7 +104,7 @@ BlockIter BlockIter::flip() const Block &BlockIter::operator*() const { if(!_block) - throw InvalidState("BlockIter is null"); + throw logic_error("null block"); return *_block; }