From: Jens Thiele Date: Tue, 21 Nov 2006 16:05:25 +0000 (+0000) Subject: added test using own class as argument X-Git-Tag: v0.2~100 X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=commitdiff_plain;h=fb5c13c6a58254295bc0b6f18e618f18b4c318e5 added test using own class as argument --- diff --git a/codegen/main.cpp b/codegen/main.cpp index f8a2e23..f0c6ad4 100644 --- a/codegen/main.cpp +++ b/codegen/main.cpp @@ -152,8 +152,14 @@ type_info get_type(const xmlpp::Element* root, const std::string &id) assert(element->get_attribute("name")); type_info ret; - if (element->get_attribute("context")) - ret.name=get_namespace(root, element->get_attribute("context")->get_value())+"::"; + if (element->get_attribute("context")) { + ret.name=get_namespace(root, element->get_attribute("context")->get_value()); + if (ret.name!="::") + ret.name+="::"; + else + // do not explicitely add :: + ret.name=""; + } ret.name+=element->get_attribute("name")->get_value(); return ret; } @@ -301,7 +307,7 @@ void output_common_hpp(std::ostream &o, const std::list &procs) { << "private:\n" << " friend class boost::serialization::access;\n" << " template\n" - << " void serialize(Archive & ar, const unsigned int version)\n" + << " void serialize(Archive & ar, const unsigned int /* version */)\n" << " {ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(libt2n::command);}\n" << "};\n"; } @@ -313,7 +319,7 @@ void output_common_hpp(std::ostream &o, const std::list &procs) { << " " << it->ret_type << " res;\n" << " friend class boost::serialization::access;\n" << " template\n" - << " void serialize(Archive & ar, const unsigned int version)\n" + << " void serialize(Archive & ar, const unsigned int /* version */)\n" << " {\n" << " ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(libt2n::result);\n" << " ar & BOOST_SERIALIZATION_NVP(res);\n" @@ -333,7 +339,7 @@ void output_common_hpp(std::ostream &o, const std::list &procs) { } o << " friend class boost::serialization::access;\n" << " template\n" - << " void serialize(Archive & ar, const unsigned int version)\n" + << " void serialize(Archive & ar, const unsigned int /* version */)\n" << " {\n" << " ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(cmd_group_" << it->group << ");\n"; for (t2n_procedure::Args::const_iterator ait=it->args.begin();ait!=it->args.end();++ait) { @@ -553,9 +559,9 @@ main(int argc, char* argv[]) output_common_cpp(common_cpp, procedures, common_hpp_fname); header_file client_hpp(client_hpp_fname.c_str()); + client_hpp << "#include \"codegen-stubhead.hxx\"\n"; // we can't paste the includes before codegen-stubhead.hxx was included - // but we also do not want to include codegen-stubhead.hxx in this file - // paste_includes(client_hpp, includes); + paste_includes(client_hpp, includes); output_client_hpp(client_hpp, procedures); cpp_file client_cpp(client_cpp_fname.c_str());