00001 //------------------------------------------------------------------------ 00002 // 00003 // Joe Kniss 00004 // 3-20-03 00005 // ________ ____ ___ 00006 // | \ / | / / 00007 // +---+ \/ |/ / 00008 // +--+| |\ /| < 00009 // | || | \ / | |\ \ 00010 // | | \/ | | \ \ 00011 // \_____| |__| \__\ 00012 // Copyright 2003 00013 // Joe Michael Kniss 00014 // <<< jmk@cs.utah.edu >>> 00015 // "All Your Base are Belong to Us" 00016 //------------------------------------------------------------------------- 00017 00018 ///Tape.h 00019 00020 /// Stuff the grinder needs to play. 00021 /// The "music" is a partial fragment/vertex program (meta-program :) 00022 00023 #ifndef __GRINDER_TAPE_DOT_H 00024 #define __GRINDER_TAPE_DOT_H 00025 00026 #include <simBase/simBase.h> 00027 #include <string> 00028 #include <vector> 00029 #include "GrinderKeys.h" 00030 00031 /////////////////////////////////////////////////////////////////////////// 00032 /// Tape class. A base class for partial fragment/vertex programs. 00033 //// (a base class for "meta-shader" Intermediate Representation.) 00034 /////////////////////////////////////////////////////////////////////////// 00035 class Tape : 00036 public SimBase, 00037 public gutz::Counted 00038 { 00039 public: 00040 Tape(); 00041 virtual ~Tape(); 00042 00043 virtual std::string getText() {return _text;} 00044 virtual void setText(const std::string &text) {_text = text;} 00045 00046 /// get the scope used to create the Tape IR 00047 GrinderKeysSP getScope() const {return _keys;} 00048 /// deep copy of keys, saves current scope. 00049 void setScope(GrinderKeysSP keys) { _keys = new GrinderKeys(*keys);} 00050 00051 protected: 00052 std::string _text; 00053 GrinderKeysSP _keys; 00054 00055 }; 00056 00057 typedef gutz::SmartPtr<Tape> TapeSP; 00058 typedef std::vector<TapeSP> TapeSPVec; 00059 typedef TapeSPVec::iterator TapeSPVecIter; 00060 00061 00062 00063 #endif 00064