Tide 0.1.0

exceptions.h

Go to the documentation of this file.
00001 /* Tide
00002  *
00003  * Exceptions header file.
00004  *
00005  * Copyright 2011 Geoffrey Biggs geoffrey.biggs@aist.go.jp
00006  *     RT-Synthesis Research Group
00007  *     Intelligent Systems Research Institute,
00008  *     National Institute of Advanced Industrial Science and Technology (AIST),
00009  *     Japan
00010  *     All rights reserved.
00011  *
00012  * This file is part of Tide.
00013  *
00014  * Tide is free software; you can redistribute it and/or modify it under
00015  * the terms of the GNU Lesser General Public License as published by
00016  * the Free Software Foundation; either version 2.1 of the License, or
00017  * (at your option) any later version.
00018  *
00019  * Tide is distributed in the hope that it will be useful, but WITHOUT
00020  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00021  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00022  * License for more details.
00023  *
00024  * You should have received a copy of the GNU Lesser General Public
00025  * License along with Tide. If not, see <http://www.gnu.org/licenses/>.
00026  */
00027 
00028 #if !defined(TIDE_EXCEPTIONS_H_)
00029 #define TIDE_EXCEPTIONS_H_
00030 
00031 #include <tide/el_ids.h>
00032 #include <tide/win_dll.h>
00033 
00034 #include <boost/exception/all.hpp>
00035 #include <exception>
00036 #include <stdint.h>
00037 #include <vector>
00038 
00041 
00042 namespace tide
00043 {
00045     struct TideError : virtual std::exception, virtual boost::exception {};
00046 
00048 // Error types
00050 
00052     struct NotImplemented : virtual TideError {};
00053 
00059     struct NotEBML : virtual TideError {};
00060 
00067     struct NotTide : virtual TideError {};
00068 
00076     struct BadReadVersion : virtual TideError {};
00077 
00085     struct BadDocReadVersion : virtual TideError {};
00086 
00099     struct InvalidEBMLID : virtual TideError {};
00100 
00110     struct InvalidVarInt : virtual TideError {};
00111 
00124     struct VarIntTooBig : virtual TideError {};
00125 
00142     struct SpecSizeTooSmall : virtual TideError {};
00143 
00154     struct BufferTooSmall : virtual TideError {};
00155 
00170     struct ReadError : virtual TideError {};
00171 
00183     struct WriteError : virtual TideError {};
00184 
00192     struct InvalidElementID : virtual TideError {};
00193 
00213     struct BadElementLength : virtual TideError {};
00214 
00223     struct BadBodySize : virtual TideError {};
00224 
00238     struct InvalidChildID : virtual TideError {};
00239 
00253     struct MissingChild : virtual TideError{};
00254 
00270     struct ValueOutOfRange : virtual TideError{};
00271 
00284     struct ValueSizeOutOfRange : virtual TideError{};
00285 
00295     struct EmptyTracksElement : virtual TideError{};
00296 
00309     struct DuplicateTrackNumber : virtual TideError{};
00310 
00311 
00323     struct DuplicateUID : virtual TideError{};
00324 
00330     struct EmptyBlock : virtual TideError{};
00331 
00340     struct EmptyFrame : virtual TideError{};
00341 
00356     struct MaxLaceSizeExceeded : virtual TideError{};
00357 
00371     struct BadLacedFrameSize : virtual TideError{};
00372 
00382     struct EmptyBlockAdditionsElement : virtual TideError{};
00383 
00392     struct MultipleSeekHeads : virtual TideError{};
00393 
00402     struct NoSegmentInfo : virtual TideError{};
00403 
00412     struct NoTracks : virtual TideError{};
00413 
00422     struct NoClusters : virtual TideError{};
00423 
00430     struct NotWriting : virtual TideError{};
00431 
00439     struct VoidTooSmall : virtual TideError{};
00440 
00441 
00443 // Error information tags
00445 
00447     typedef boost::error_info<struct tag_ver, std::streamsize> err_ver;
00448 
00450     typedef boost::error_info<struct tag_pos, std::streamsize> err_pos;
00451 
00453     typedef boost::error_info<struct tag_varint, uint64_t> err_varint;
00454 
00456     typedef boost::error_info<struct tag_bufsize, std::streamsize> err_bufsize;
00457 
00459     typedef boost::error_info<struct tag_reqsize, std::streamsize> err_reqsize;
00460 
00462     typedef boost::error_info<struct tag_specsize, std::streamsize>
00463         err_specsize;
00464 
00466     typedef boost::error_info<struct tag_id, ids::ID> err_id;
00467 
00469     typedef boost::error_info<struct tag_par_id, uint32_t> err_par_id;
00470 
00472     typedef boost::error_info<struct tag_valid_sizes,
00473             std::vector<std::streamsize> > err_valid_sizes;
00474 
00476     typedef boost::error_info<struct tag_el_size, std::streamsize> err_el_size;
00477 
00479     typedef boost::error_info<struct tag_track_num, uint64_t> err_track_num;
00480 
00482     typedef boost::error_info<struct tag_int_uid, uint64_t> err_int_uid;
00483 
00485     typedef boost::error_info<struct tag_max_lace, unsigned int> err_max_lace;
00486 
00488     typedef boost::error_info<struct tag_req_lace, unsigned int> err_req_lace;
00489 
00491     typedef boost::error_info<struct tag_frame_size, std::streamsize>
00492         err_frame_size;
00493 }; // namespace tide
00494 
00496 // group exceptions
00497 
00498 #endif // TIDE_EXCEPTIONS_H_
00499 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines