Put this function first so we can reference the code in doxygen using @skip ! @brief Check whether CompressedVectorReader class invariant is true @details This function checks at least the assertions in the documented class invariant description (see class reference page for this object). Other internal invariants that are implementation-dependent may also be checked. If any invariant clause is v
| 47 | @post No visible state is modified. |
| 48 | */ |
| 49 | void CompressedVectorReader::checkInvariant( bool /*doRecurse*/ ) |
| 50 | { |
| 51 | // If this CompressedVectorReader is not open, can't test invariant (almost |
| 52 | // every call would throw) |
| 53 | if ( !isOpen() ) |
| 54 | { |
| 55 | return; |
| 56 | } |
| 57 | |
| 58 | CompressedVectorNode cv = compressedVectorNode(); |
| 59 | ImageFile imf = cv.destImageFile(); |
| 60 | |
| 61 | // If destImageFile not open, can't test invariant (almost every call would |
| 62 | // throw) |
| 63 | if ( !imf.isOpen() ) |
| 64 | { |
| 65 | return; |
| 66 | } |
| 67 | |
| 68 | // Associated CompressedVectorNode must be attached to ImageFile |
| 69 | if ( !cv.isAttached() ) |
| 70 | { |
| 71 | throw E57_EXCEPTION1( ErrorInvarianceViolation ); |
| 72 | } |
| 73 | |
| 74 | // Dest ImageFile must have at least 1 reader (this one) |
| 75 | if ( imf.readerCount() < 1 ) |
| 76 | { |
| 77 | throw E57_EXCEPTION1( ErrorInvarianceViolation ); |
| 78 | } |
| 79 | |
| 80 | // Dest ImageFile can't have any writers |
| 81 | if ( imf.writerCount() != 0 ) |
| 82 | { |
| 83 | throw E57_EXCEPTION1( ErrorInvarianceViolation ); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | /*! |
| 88 | @class e57::CompressedVectorReader |
nothing calls this directly
no test coverage detected