Tide 0.1.0
|
00001 /* Tide 00002 * 00003 * Header file for the Seek element, a child of SeekHead. 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_SEEK_ELEMENT_H_) 00029 #define TIDE_SEEK_ELEMENT_H_ 00030 00031 #include <ios> 00032 #include <tide/binary_element.h> 00033 #include <tide/el_ids.h> 00034 #include <tide/master_element.h> 00035 #include <tide/uint_element.h> 00036 #include <tide/win_dll.h> 00037 00040 00041 namespace tide 00042 { 00051 class TIDE_EXPORT SeekElement : public MasterElement 00052 { 00053 public: 00061 SeekElement(ids::ID id, std::streampos offset); 00062 00064 virtual ~SeekElement() {} 00065 00067 ids::ID indexed_id() const; 00069 void indexed_id(ids::ID id); 00070 00072 std::streamsize offset() const { return offset_.value(); } 00074 void offset(std::streamsize offset) { offset_.value(offset); } 00075 00077 virtual std::streamsize write_body(std::ostream& output); 00078 00079 protected: 00080 BinaryElement indexed_id_; 00081 UIntElement offset_; 00082 00084 virtual std::streamsize body_size() const; 00085 00087 virtual std::streamsize read_body(std::istream& input, 00088 std::streamsize size); 00089 }; // class SeekElement 00090 }; // namespace tide 00091 00093 00094 #endif // TIDE_SEEK_ELEMENT_H_ 00095