Here's the code with the errors...
And here are the errors... theres on "fatal" error that it can't recover from, I have never seen this before...Code:#ifndef DATABASE_H #define DATABASE_H #include "Object.h" #include <map> #include <iostream> #include <boost/shared_ptr.hpp> #include <string> #include <vector> class Database { public: std::map<std::string name, std::vector<boost::shared_ptr<T>> Data; typedef boost::weak_ptr<Data> Data_Observer; // Function to access a specific manager within the map Data_Observer Access_Manager(std::string Filename) { Manager_Map::iterator it = Database_Manager.find(Filename); // check if the manager exists in the map if (it == Database_Manager.end()) { // if not throw an error std::cout << "Manager does not exist!" << std::endl; } else { // if so return a pointer to the manager return Data_Observer(it->second); } } //Save a manager completely to a file void Save_to_File(std::string Filename, std::map<std::string name, std::vector<boost::shared_ptr<T_>>) { std::ofstream ofs(Filename.c_str()); boost::archive::text_oarchive oa(ofs); // write class instance to archive oa << Data; Data.~Object_Manager(); // archive and stream closed when destructors are called } // Load a manager from a file and add it to the list of managers void Read_File(std::string Filename, Object_Manager * Data) { // create and open an archive for input std::ifstream ifs(Filename.c_str(), std::ios::binary); boost::archive::text_iarchive ia(ifs); // read class state from archive ia >> Data; // create a pointer to the data Manager_Ptr Raw_Manager(Data); // pair the filename with the manager typ for easy access Database_Manager.insert(std::make_pair(Filename, Raw_Manager)); // archive and stream closed when destructors are called } private: Manager_Map Database_Manager; }; #endif
So yeah, any ideas? as far as I know I initialized everything right, except maybe the template portion for the shared pointers....Code:------ Build started: Project: TextGame, Configuration: Debug Win32 ------ Compiling... Main.cpp c:\documents and settings\home\my documents\visual studio 2005\projects\textgame\textgame\database.h(15) : error C2146: syntax error : missing ',' before identifier 'name' c:\documents and settings\home\my documents\visual studio 2005\projects\textgame\textgame\database.h(15) : error C2065: 'name' : undeclared identifier c:\documents and settings\home\my documents\visual studio 2005\projects\textgame\textgame\database.h(15) : error C2065: 'T' : undeclared identifier c:\documents and settings\home\my documents\visual studio 2005\projects\textgame\textgame\database.h(15) : error C3203: 'shared_ptr' : unspecialized class template can't be used as a template argument for template parameter '_Ty', expected a real type c:\documents and settings\home\my documents\visual studio 2005\projects\textgame\textgame\database.h(15) : error C2146: syntax error : missing ',' before identifier 'Data' c:\documents and settings\home\my documents\visual studio 2005\projects\textgame\textgame\database.h(15) : error C2065: 'Data' : undeclared identifier c:\documents and settings\home\my documents\visual studio 2005\projects\textgame\textgame\database.h(15) : error C2143: syntax error : missing '>' before ';' c:\documents and settings\home\my documents\visual studio 2005\projects\textgame\textgame\database.h(15) : error C2208: 'std::map' : no members defined using this type c:\documents and settings\home\my documents\visual studio 2005\projects\textgame\textgame\database.h(15) : fatal error C1903: unable to recover from previous error(s); stopping compilation Build log was saved at "file://c:\Documents and Settings\Home\My Documents\Visual Studio 2005\Projects\TextGame\TextGame\Debug\BuildLog.htm" TextGame - 9 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thanks for the help already![]()



LinkBack URL
About LinkBacks






