Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ShRecord.hpp

Go to the documentation of this file.
00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2005 Serious Hack Inc.
00004 // 
00005 // This software is provided 'as-is', without any express or implied
00006 // warranty. In no event will the authors be held liable for any damages
00007 // arising from the use of this software.
00008 // 
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it
00011 // freely, subject to the following restrictions:
00012 // 
00013 // 1. The origin of this software must not be misrepresented; you must
00014 // not claim that you wrote the original software. If you use this
00015 // software in a product, an acknowledgment in the product documentation
00016 // would be appreciated but is not required.
00017 // 
00018 // 2. Altered source versions must be plainly marked as such, and must
00019 // not be misrepresented as being the original software.
00020 // 
00021 // 3. This notice may not be removed or altered from any source
00022 // distribution.
00024 #ifndef SHRECORD_HPP
00025 #define SHRECORD_HPP
00026 
00027 #include <list>
00028 #include "ShDllExport.hpp"
00029 #include "ShVariable.hpp"
00030 
00034 namespace SH {
00035 
00041 class
00042 SH_DLLEXPORT ShRecord {
00043 public:
00044   typedef std::list<ShVariable> VarList; 
00045   typedef VarList::iterator iterator;
00046   typedef VarList::const_iterator const_iterator;
00047 
00048   ShRecord();
00049   ShRecord(const ShVariable &var);
00050   
00051   const_iterator begin() const;
00052   const_iterator end() const;
00053   iterator begin();
00054   iterator end();
00055   size_t size() const;
00056 
00057   void append(const ShVariable& variable);
00058   void prepend(const ShVariable& variable);
00059 
00060   void append(const ShRecord& rec);
00061   void prepend(const ShRecord& rec);
00062 
00063   // Assigns one record to another.
00064   // In retained mode, this inserts assignment statements into the current
00065   // ShProgram.  
00066   ShRecord& operator=(const ShRecord &other);
00067 
00068   // Execute fully bound record program and place results in record.
00069   ShRecord& operator=(const ShProgram& program);
00070 
00071   // Converts a ShRecord containing only uniforms into a stream
00072   // (Must be unswizzled uniforms (and not constants), as this uses the variable's
00073   // variant arrays directly as the channel memory
00074   //
00075   // If you change any of the values here, you must call 
00076   // update_all on the nodes
00077   //ShStream toStream();
00078   
00079 private:
00080   VarList m_vars;
00081 };
00082 
00086 SH_DLLEXPORT
00087 ShRecord combine(const ShVariable &left, const ShVariable &right);
00088 
00093 SH_DLLEXPORT
00094 ShRecord combine(const ShRecord& left, const ShVariable& right);
00095 
00100 SH_DLLEXPORT
00101 ShRecord combine(const ShVariable& left, const ShRecord& right);
00102 
00103 SH_DLLEXPORT
00104 ShRecord combine(const ShRecord& left, const ShRecord& right);
00105 
00108 SH_DLLEXPORT
00109 ShRecord operator&(const ShVariable& left, const ShVariable& right);
00110 
00113 SH_DLLEXPORT
00114 ShRecord operator&(const ShRecord& left, const ShVariable& right);
00115 
00118 SH_DLLEXPORT
00119 ShRecord operator&(const ShVariable& left, const ShRecord& right);
00120 
00123 SH_DLLEXPORT
00124 ShRecord operator&(const ShRecord& left, const ShRecord& right);
00125 
00130 SH_DLLEXPORT
00131 ShProgram connect(const ShRecord& rec, const ShProgram& program);
00132 
00135 SH_DLLEXPORT
00136 ShProgram operator<<(const ShProgram& program, const ShRecord& rec);
00137 
00142 SH_DLLEXPORT
00143 ShProgram connect(const ShProgram& program, const ShRecord& rec);
00144 
00147 SH_DLLEXPORT
00148 ShProgram operator<<(const ShRecord& rec, const ShProgram& program);
00149 
00150 }
00151 
00152 #endif

Generated on Thu Apr 21 17:32:48 2005 for Sh by  doxygen 1.4.2