Tide 0.1.0

block.h

Go to the documentation of this file.
00001 /* Tide
00002  *
00003  * Header file for the Block interface.
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_BLOCK_H_)
00029 #define TIDE_BLOCK_H_
00030 
00031 #include <boost/operators.hpp>
00032 #include <boost/shared_ptr.hpp>
00033 #include <stdint.h>
00034 #include <tide/win_dll.h>
00035 #include <vector>
00036 
00039 
00040 namespace tide
00041 {
00048     class TIDE_EXPORT Block :
00049         public boost::equality_comparable<Block>
00050     {
00051         public:
00053             typedef boost::shared_ptr<Block> Ptr;
00055             typedef boost::shared_ptr<Block const> ConstPtr;
00056 
00058             enum LacingType
00059             {
00061                 LACING_NONE,
00063                 LACING_EBML,
00065                 LACING_FIXED
00066             };
00068             typedef std::vector<char> Frame;
00070             typedef boost::shared_ptr<Frame> FramePtr;
00072             typedef std::vector<FramePtr>::value_type value_type;
00074             typedef std::vector<FramePtr>::size_type size_type;
00076             typedef std::vector<FramePtr>::reference reference;
00078             typedef std::vector<FramePtr>::const_reference const_reference;
00080             typedef std::vector<FramePtr>::iterator iterator;
00082             typedef std::vector<FramePtr>::const_iterator const_iterator;
00084             typedef std::vector<FramePtr>::reverse_iterator reverse_iterator;
00086             typedef std::vector<FramePtr>::const_reverse_iterator
00087                 const_reverse_iterator;
00088 
00095             Block(uint64_t track_number, int16_t timecode,
00096                     LacingType lacing=LACING_NONE)
00097             {}
00098 
00100             virtual ~Block() = 0;
00101 
00108             virtual uint64_t track_number() const = 0;
00110             virtual void track_number(uint64_t track_number) = 0;
00111 
00118             virtual int16_t timecode() const = 0;
00120             virtual void timecode(int16_t timecode) = 0;
00121 
00127             virtual bool invisible() const = 0;
00129             virtual void invisible(bool invisible) = 0;
00130 
00140             virtual LacingType lacing() const = 0;
00142             virtual void lacing(LacingType lacing) = 0;
00143 
00150             virtual value_type& at(size_type pos) = 0;
00157             virtual value_type const& at(size_type pos) const = 0;
00158 
00165             virtual value_type& operator[](size_type pos) = 0;
00172             virtual value_type const& operator[](size_type pos) const = 0;
00173 
00175             virtual iterator begin() = 0;
00177             virtual const_iterator begin() const = 0;
00179             virtual iterator end() = 0;
00181             virtual const_iterator end() const = 0;
00183             virtual reverse_iterator rbegin() = 0;
00185             virtual const_reverse_iterator rbegin() const = 0;
00189             virtual reverse_iterator rend() = 0;
00193             virtual const_reverse_iterator rend() const = 0;
00194 
00200             virtual bool empty() const = 0;
00202             virtual size_type count() const = 0;
00210             virtual size_type max_count() const = 0;
00211 
00213             virtual void clear() = 0;
00214 
00219             virtual void erase(iterator position) = 0;
00225             virtual void erase(iterator first, iterator last) = 0;
00226 
00239             virtual void push_back(value_type const& value) = 0;
00240 
00256             virtual void resize(size_type count) = 0;
00257 
00262             virtual void swap(Block& other) {}
00263     }; // class Block
00264 }; // namespace tide
00265 
00267 // group interfaces
00268 
00269 #endif // TIDE_BLOCK_H_
00270 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines