Tide 0.1.0

string_element.h

Go to the documentation of this file.
00001 /* Tide
00002  *
00003  * Header file for the string 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_STRING_ELEMENT_H_)
00029 #define TIDE_STRING_ELEMENT_H_
00030 
00031 #include <tide/prim_element.h>
00032 #include <tide/win_dll.h>
00033 
00034 #include <string>
00035 
00038 
00039 namespace tide
00040 {
00046     class TIDE_EXPORT StringElement : public PrimitiveElement<std::string>
00047     {
00048         public:
00055             StringElement(uint32_t id, std::string value);
00056 
00064             StringElement(uint32_t id, std::string value,
00065                     std::string default_value);
00066 
00068             virtual StringElement& operator=(std::string const& rhs);
00069 
00071             virtual uint64_t padding() const { return padding_; }
00082             virtual void padding(uint64_t padding) { padding_ = padding; }
00083 
00085             virtual std::streamsize write_body(std::ostream& output);
00086 
00087         protected:
00088             uint64_t padding_;
00089 
00091             virtual std::streamsize body_size() const;
00092 
00094             virtual std::streamsize read_body(std::istream& input,
00095                     std::streamsize size);
00096     }; // class StringElement
00097 }; // namespace tide
00098 
00100 // group implementations
00101 
00102 #endif // TIDE_STRING_ELEMENT_H_
00103 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines