Put this function first so we can reference the code in doxygen using @skip ! @brief Check whether CompressedVectorWriter class invariant is true @copydetails CompressedVectorReader::checkInvariant */
| 40 | @copydetails CompressedVectorReader::checkInvariant |
| 41 | */ |
| 42 | void CompressedVectorWriter::checkInvariant( bool /*doRecurse*/ ) |
| 43 | { |
| 44 | // If this CompressedVectorWriter is not open, can't test invariant (almost |
| 45 | // every call would throw) |
| 46 | if ( !isOpen() ) |
| 47 | { |
| 48 | return; |
| 49 | } |
| 50 | |
| 51 | CompressedVectorNode cv = compressedVectorNode(); |
| 52 | ImageFile imf = cv.destImageFile(); |
| 53 | |
| 54 | // If destImageFile not open, can't test invariant (almost every call would |
| 55 | // throw) |
| 56 | if ( !imf.isOpen() ) |
| 57 | { |
| 58 | return; |
| 59 | } |
| 60 | |
| 61 | // Associated CompressedVectorNode must be attached to ImageFile |
| 62 | if ( !cv.isAttached() ) |
| 63 | { |
| 64 | throw E57_EXCEPTION1( ErrorInvarianceViolation ); |
| 65 | } |
| 66 | |
| 67 | // Dest ImageFile must be writable |
| 68 | if ( !imf.isWritable() ) |
| 69 | { |
| 70 | throw E57_EXCEPTION1( ErrorInvarianceViolation ); |
| 71 | } |
| 72 | |
| 73 | // Dest ImageFile must have exactly 1 writer (this one) |
| 74 | if ( imf.writerCount() != 1 ) |
| 75 | { |
| 76 | throw E57_EXCEPTION1( ErrorInvarianceViolation ); |
| 77 | } |
| 78 | |
| 79 | // Dest ImageFile can't have any readers |
| 80 | if ( imf.readerCount() != 0 ) |
| 81 | { |
| 82 | throw E57_EXCEPTION1( ErrorInvarianceViolation ); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | /*! |
| 87 | @class e57::CompressedVectorWriter |
nothing calls this directly
no test coverage detected