/** * @module cmem * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) * @brief class for providing 256 registers. * @date 11.05.2009 */ #ifndef CMEM_H #define CMEM_H #include #include #include #ifdef DEBUG # include #endif #include "cdat.h" #define MAX_REGISTER 256; /** * @class CMem * * Parses a simple line based scriptfile with some limitations: * first function (starting a block) must be a read-command, * last must be a write-command (ending this block). * * read- and write-commands have hard coded parameters, number#1 being a filetype. * Classes handling certain filetypes must be of type CFile. * Custom functions will be passed to CFile::callFunc(). * * On error ParserError will be thrown. */ class CMem { public: /** * @method CMem * @brief Default ctor * @param memoryfile filename * @return - * @globalvars none * @exception bad_alloc * @conditions none */ CMem(const std::string& memfile); /** * @method ~CMem * @brief Default dtor * @param - * @return - * @globalvars none * @exception none * @conditions none */ ~CMem(); CDat& getRegister(const std::string reg); CDat& getMem(const std::string addr) { getRegister("R255") = 10; return getRegister("R255"); } void setMem(const std::string addr, const CDat& value) {} #ifdef DEBUG /** * @method dump * @brief Dumps the resgister contnent to ostream * @param out output stream * @return - * @globalvars * @exception * @conditions */ void dump(std::ostream& out); #endif private: /* members */ std::string m_memfile; std::vector m_registers; }; #endif /* vim: set et sw=2 ts=2: */