Tide 0.1.0
|
00001 /* Tide 00002 * 00003 * Header file for the void element object. 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_INT_ELEMENT_H_) 00029 #define TIDE_INT_ELEMENT_H_ 00030 00031 #include <tide/el_ids.h> 00032 #include <tide/prim_element.h> 00033 #include <tide/win_dll.h> 00034 00035 #include <stdint.h> 00036 00039 00040 namespace tide 00041 { 00049 class TIDE_EXPORT VoidElement : public Element 00050 { 00051 public: 00060 VoidElement(std::streamsize tgt_size, bool fill=false); 00061 00072 VoidElement(Element const& element, bool fill=false); 00073 00081 void set_size(std::streamsize tgt_size); 00082 00084 std::streamsize size() const; 00085 00087 bool fill() const { return fill_; } 00102 void fill(bool fill) { fill_ = fill; } 00103 00105 virtual std::streamsize write(std::ostream& output); 00106 00120 virtual std::streamsize write_body(std::ostream& output); 00121 00123 std::streamsize read(std::istream& input); 00124 00125 private: 00127 std::streamsize size_; 00129 bool fill_; 00131 std::streamsize extra_size_; 00132 00134 virtual std::streamsize body_size() const { return size_; } 00135 00148 virtual std::streamsize read_body(std::istream& input, 00149 std::streamsize size); 00150 }; // class VoidElement 00151 }; // namespace tide 00152 00154 // group implementations 00155 00156 #endif // TIDE_INT_ELEMENT_H_ 00157