Field3D
FieldIO.h
Go to the documentation of this file.
00001 //----------------------------------------------------------------------------//
00002 
00003 /*
00004  * Copyright (c) 2009 Sony Pictures Imageworks Inc
00005  *
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  *
00012  * Redistributions of source code must retain the above copyright
00013  * notice, this list of conditions and the following disclaimer.
00014  * Redistributions in binary form must reproduce the above copyright
00015  * notice, this list of conditions and the following disclaimer in the
00016  * documentation and/or other materials provided with the
00017  * distribution.  Neither the name of Sony Pictures Imageworks nor the
00018  * names of its contributors may be used to endorse or promote
00019  * products derived from this software without specific prior written
00020  * permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
00026  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00028  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00030  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00031  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00032  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
00033  * OF THE POSSIBILITY OF SUCH DAMAGE.
00034  */
00035 
00036 //----------------------------------------------------------------------------//
00037 
00042 //----------------------------------------------------------------------------//
00043 
00044 #ifndef _INCLUDED_Field3D_FieldIO_H_
00045 #define _INCLUDED_Field3D_FieldIO_H_
00046 
00047 //----------------------------------------------------------------------------//
00048 
00049 #include <boost/intrusive_ptr.hpp>
00050 
00051 #include <string>
00052 #include <map>
00053 #include <list>
00054 
00055 #include <hdf5.h>
00056 #include <typeinfo>
00057 
00058 #include "Field.h"
00059 #include "Log.h"
00060 
00061 //----------------------------------------------------------------------------//
00062 
00063 #include "ns.h"
00064 
00065 FIELD3D_NAMESPACE_OPEN
00066 
00067 //----------------------------------------------------------------------------//
00068 // FieldIO
00069 //----------------------------------------------------------------------------//
00070 
00081 //----------------------------------------------------------------------------//
00082 
00083 class FieldIO : public RefBase
00084 {
00085 
00086 public:
00087 
00088   // Typedefs ------------------------------------------------------------------
00089 
00090   typedef boost::intrusive_ptr<FieldIO> Ptr;
00091 
00092   // Ctors, dtor ---------------------------------------------------------------
00093 
00095   FieldIO() : RefBase() {}
00096   
00098   virtual ~FieldIO() {}
00099 
00100   // Methods to be implemented by subclasses -----------------------------------
00101 
00105   virtual FieldBase::Ptr read(hid_t layerGroup, const std::string &filename, 
00106                               const std::string &layerPath,
00107                               DataTypeEnum typeEnum) = 0;
00108 
00111   virtual bool write(hid_t layerGroup, FieldBase::Ptr field) = 0;
00112 
00115   virtual std::string className() const = 0;
00116 
00117   // Strings used when reading/writing -----------------------------------------
00118 
00119  private:
00120 
00121 
00122 };
00123 
00124 
00125 
00126 //----------------------------------------------------------------------------//
00127 
00128 FIELD3D_NAMESPACE_HEADER_CLOSE
00129 
00130 //----------------------------------------------------------------------------//
00131 
00132 #endif