Tide 0.1.0

simple_block.h

Go to the documentation of this file.
00001 /* Tide
00002  *
00003  * Header for the SimpleBlock element.
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_SIMPLE_BLOCK_H_)
00029 #define TIDE_SIMPLE_BLOCK_H_
00030 
00031 #include <tide/block_element.h>
00032 #include <tide/block_impl.h>
00033 #include <tide/win_dll.h>
00034 
00037 
00038 namespace tide
00039 {
00048     class TIDE_EXPORT SimpleBlock : public BlockElement,
00049         public boost::equality_comparable<SimpleBlock>
00050     {
00051         public:
00058             SimpleBlock(uint64_t track_number, int16_t timecode,
00059                     LacingType lacing=LACING_NONE);
00060 
00062             bool keyframe() const { return keyframe_; }
00076             void keyframe(bool keyframe) { keyframe_ = keyframe; }
00077 
00079             bool discardable() const { return discardable_; }
00091             void discardable(bool discardable) { discardable_ = discardable; }
00092 
00094             // Block interface
00096 
00103             virtual uint64_t track_number() const
00104                 { return block_.track_number(); }
00106             virtual void track_number(uint64_t track_number)
00107                 { block_.track_number(track_number); }
00108 
00115             virtual int16_t timecode() const { return block_.timecode(); }
00117             virtual void timecode(int16_t timecode)
00118                 { block_.timecode(timecode); }
00119 
00125             virtual bool invisible() const { return block_.invisible(); }
00127             virtual void invisible(bool invisible)
00128                 { block_.invisible(invisible); }
00129 
00139             virtual LacingType lacing() const { return block_.lacing(); }
00141             virtual void lacing(LacingType lacing)
00142                 { block_.lacing(lacing); }
00143 
00150             virtual value_type& at(size_type pos) { return block_.at(pos); }
00157             virtual value_type const& at(size_type pos) const
00158                 { return block_.at(pos); }
00159 
00166             virtual value_type& operator[](size_type pos)
00167                 { return block_[pos]; }
00174             virtual value_type const& operator[](size_type pos) const
00175                 { return block_[pos]; }
00176 
00178             virtual iterator begin() { return block_.begin(); }
00180             virtual const_iterator begin() const { return block_.begin(); }
00182             virtual iterator end() { return block_.end(); }
00184             virtual const_iterator end() const { return block_.end(); }
00186             virtual reverse_iterator rbegin() { return block_.rbegin(); }
00188             virtual const_reverse_iterator rbegin() const
00189                 { return block_.rbegin(); }
00193             virtual reverse_iterator rend() { return block_.rend(); }
00197             virtual const_reverse_iterator rend() const
00198                 { return block_.rend(); }
00199 
00205             virtual bool empty() const { return block_.empty(); }
00207             virtual size_type count() const { return block_.count(); }
00215             virtual size_type max_count() const { return block_.max_count(); }
00216 
00218             virtual void clear() { block_.clear(); }
00219 
00224             virtual void erase(iterator position) { block_.erase(position); }
00230             virtual void erase(iterator first, iterator last)
00231                 { block_.erase(first, last); }
00232 
00245             virtual void push_back(value_type const& value)
00246                 { block_.push_back(value); }
00247 
00263             virtual void resize(size_type count) { block_.resize(count); }
00264 
00269             virtual void swap(SimpleBlock& other);
00270 
00272             friend bool operator==(SimpleBlock const& lhs,
00273                     SimpleBlock const& rhs);
00274 
00275         private:
00276             bool keyframe_;
00277             bool discardable_;
00278             BlockImpl block_;
00279 
00281             // Element interface
00283 
00285             virtual std::streamsize body_size() const;
00286 
00288             virtual std::streamsize read_body(std::istream& input,
00289                     std::streamsize size);
00290 
00292             virtual std::streamsize write_body(std::ostream& output);
00293     }; // class SimpleBlock
00294 
00296     bool operator==(SimpleBlock const& lhs, SimpleBlock const& rhs);
00297 }; // namespace tide
00298 
00300 // group elements
00301 
00302 #endif // TIDE_SIMPLE_BLOCK_H_
00303 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines