コード例 #1
0
ファイル: Sie.cpp プロジェクト: Arafatk/trick
void Trick::Sie::class_attr_map_print_xml() {
    std::ofstream sie_out ;
    std::string file_name = std::string(command_line_args_get_default_dir()) + "/" + "S_sie_class.xml" ;
    sie_out.open(file_name.c_str()) ;
    sie_out << "<?xml version=\"1.0\"?>" << std::endl << std::endl ;
    sie_out << "<sie>" << std::endl ;
    class_attr_map->print_xml(sie_out) ;
    sie_out << "</sie>" << std::endl ;
    sie_out.close() ;
}
コード例 #2
0
ファイル: Sie.cpp プロジェクト: Arafatk/trick
void Trick::Sie::top_level_objects_print_xml() {
    std::ofstream sie_out ;
    std::string file_name = std::string(command_line_args_get_default_dir()) + "/" + "S_sie_top_level_objects.xml" ;
    sie_out.open(file_name.c_str()) ;
    sie_out << "<?xml version=\"1.0\"?>" << std::endl << std::endl ;
    sie_out << "<sie>" << std::endl ;
    top_level_objects_print(sie_out) ;
    sie_out << "</sie>" << std::endl ;
    sie_out.close() ;
}
コード例 #3
0
void Trick::MonteCarlo::default_slave_dispatch_pre_text(Trick::MonteSlave* slave_to_init, std::string &buffer) {
    /** <ul><li> If the slave is running locally, use a local shell. */
    if (!localhost_as_remote &&
        (equals_ignore_case(slave_to_init->machine_name, machine_name) ||
         equals_ignore_case(slave_to_init->machine_name, std::string("localhost")))) {
        buffer = "/bin/sh -c '";
    /** <li> Otherwise, use the appropriate remote shell. */
    } else {
        switch (slave_to_init->remote_shell) {
            case TRICK_RSH:
                buffer = unix_rsh;
            break;
            case TRICK_USER_REMOTE_SH:
                if (slave_to_init->user_remote_shell.empty()) {
                    slave_to_init->user_remote_shell = unix_ssh;
                    if (verbosity >= ERROR) {
                        message_publish(MSG_WARNING, "Monte: TRICK_USER_REMOTE_SH specified for Slave %s:%d, but no shell given.\n"
                                                     "Defaulting to %s.\n",
                                        machine_name.c_str(), slave_to_init->id, slave_to_init->user_remote_shell.c_str()) ;
                    }
                }
                buffer = slave_to_init->user_remote_shell;
            break;
            default:
                buffer = unix_ssh;
            break;
        }
        /** <ul><li> Add the user-specified remote shell arguments and the remote machine name. </ul> */
        buffer += " " + slave_to_init->remote_shell_args + " " + slave_to_init->machine_name + " '";
    }

    /** <li> Add the user command string to allow passing
     * of environment variables and such to the slave.
     */
    if (!user_cmd_string.empty()) {
        buffer += user_cmd_string + "; ";
    }

    /** <li> Add the command to switch to the appropriate directory. */
    if (slave_to_init->remote_shell != TRICK_USER_REMOTE_SH) {
        buffer += "cd ";
        if (!slave_to_init->sim_path.empty()) {
            buffer += slave_to_init->sim_path;
        } else {
            buffer += std::string(command_line_args_get_default_dir());
        }
        buffer += std::string("; ");
    }
}
コード例 #4
0
int Trick::VariableServerThread::send_sie_top_level_objects() {
    sie_top_level_objects_print_xml() ;
    return transmit_file(std::string(command_line_args_get_default_dir()) + "/" + "S_sie_top_level_objects.xml") ;
}
コード例 #5
0
int Trick::VariableServerThread::send_sie_enum() {
    sie_enum_attr_map_print_xml() ;
    return transmit_file(std::string(command_line_args_get_default_dir()) + "/" + "S_sie_enum.xml") ;
}
コード例 #6
0
int Trick::VariableServerThread::send_sie_resource() {
    sie_print_xml() ;
    return transmit_file(std::string(command_line_args_get_default_dir()) + "/S_sie.resource") ;
}