ShProgramSet.hpp

00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2006 Serious Hack Inc.
00004 // 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00018 // MA  02110-1301, USA
00020 #ifndef SHPROGRAMSET_HPP
00021 #define SHPROGRAMSET_HPP
00022 
00023 #include <list>
00024 #include <map>
00025 #include "ShProgramNode.hpp"
00026 
00027 namespace SH {
00028 
00029 class ShBackend;
00030 class ShBackendSet;
00031 class ShProgram;
00032 
00033 class
00034 SH_DLLEXPORT ShProgramSet : public ShRefCountable {
00035 public:
00036   ShProgramSet(); // empty set
00037   explicit ShProgramSet(const ShProgram& a);
00038   ShProgramSet(const ShProgram& a, const ShProgram& b);
00039 
00040   typedef std::list<ShProgramNodePtr> NodeList;
00041   typedef NodeList::iterator iterator;
00042   typedef NodeList::const_iterator const_iterator;
00043 
00044   // Program sets are immutable
00045   NodeList::const_iterator begin() const { return m_nodes.begin(); }
00046   NodeList::const_iterator end() const { return m_nodes.end(); }
00047 
00048   ShPointer<ShBackendSet> backend_set(const ShPointer<ShBackend>&) const;
00049   
00050 private:
00051   NodeList m_nodes;
00052 
00053   typedef std::map<ShPointer<ShBackend>, ShPointer<ShBackendSet> > BackendMap;
00054   mutable BackendMap m_backend_sets;
00055 
00056   // NOT IMPLEMENTED (but maybe they should be)
00057   ShProgramSet(const ShProgramSet& other);
00058   ShProgramSet& operator=(const ShProgramSet& other);
00059 };
00060 
00061 typedef ShPointer<ShProgramSet> ShProgramSetPtr;
00062 typedef ShPointer<const ShProgramSet> ShProgramSetCPtr;
00063 
00064 }
00065 
00066 #endif

Generated on Thu Feb 16 14:51:37 2006 for Sh by  doxygen 1.4.6