objreader.h

Go to the documentation of this file.
00001 
00003 
00004 //
00005 // Copyright (c) 2005-2007 University of Southern California
00006 // Rob Peters <rjpeters at usc dot edu>
00007 //
00008 // created: Tue Nov  8 15:37:35 2005
00009 // commit: $Id: objreader.h 10065 2007-04-12 05:54:56Z rjpeters $
00010 // $HeadURL: file:///lab/rjpeters/svnrepo/code/trunk/groovx/src/tcl-io/objreader.h $
00011 //
00012 // --------------------------------------------------------------------
00013 //
00014 // This file is part of GroovX.
00015 //   [http://www.klab.caltech.edu/rjpeters/groovx/]
00016 //
00017 // GroovX is free software; you can redistribute it and/or modify it
00018 // under the terms of the GNU General Public License as published by
00019 // the Free Software Foundation; either version 2 of the License, or
00020 // (at your option) any later version.
00021 //
00022 // GroovX is distributed in the hope that it will be useful, but
00023 // WITHOUT ANY WARRANTY; without even the implied warranty of
00024 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00025 // General Public License for more details.
00026 //
00027 // You should have received a copy of the GNU General Public License
00028 // along with GroovX; if not, write to the Free Software Foundation,
00029 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00030 //
00032 
00033 #ifndef GROOVX_TCL_IO_OBJREADER_H_UTC20051108233735_DEFINED
00034 #define GROOVX_TCL_IO_OBJREADER_H_UTC20051108233735_DEFINED
00035 
00036 #include "io/reader.h"
00037 #include "tcl/obj.h"
00038 
00039 namespace tcl
00040 {
00041   class obj_reader;
00042 }
00043 
00044 class tcl::obj_reader : public io::reader
00045 {
00046 public:
00047 
00049   obj_reader(tcl::obj x);
00050 
00052   virtual ~obj_reader() throw();
00053 
00056   virtual io::version_id input_version_id();
00057 
00059   virtual char read_char(const rutz::fstring& name);
00060 
00062   virtual int read_int(const rutz::fstring& name);
00063 
00065   virtual bool read_bool(const rutz::fstring& name);
00066 
00068   virtual double read_double(const rutz::fstring& name);
00069 
00071   virtual void read_value_obj(const rutz::fstring& name,
00072                             rutz::value& v);
00073 
00075   virtual void read_byte_array(const rutz::fstring& name,
00076                            rutz::byte_array& data);
00077 
00081   virtual nub::ref<io::serializable> read_object(const rutz::fstring& name);
00082 
00087   virtual nub::soft_ref<io::serializable> read_weak_object(const rutz::fstring& name);
00088 
00092   virtual void read_owned_object(const rutz::fstring& name,
00093                                  nub::ref<io::serializable> obj);
00094 
00100   virtual void read_base_class(const rutz::fstring& base_class_name,
00101                                nub::ref<io::serializable> base_part);
00102 
00108   virtual nub::ref<io::serializable> read_root(io::serializable* root=0);
00109 
00110 protected:
00112   virtual rutz::fstring read_string_impl(const rutz::fstring& name);
00113 
00114 private:
00115   const tcl::obj m_obj;
00116 };
00117 
00118 static const char __attribute__((used)) vcid_groovx_tcl_io_objreader_h_utc20051108233735[] = "$Id: objreader.h 10065 2007-04-12 05:54:56Z rjpeters $ $HeadURL: file:
00119 #endif // !GROOVX_TCL_IO_OBJREADER_H_UTC20051108233735DEFINED

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:49:41 2008 by Doxygen version 1.5.5.