void RegisterModelIbin(std::ifstream& ifs, SP::Model& model) { boost::archive::binary_iarchive ar(ifs); siconos_io_register_Numerics(ar); siconos_io_register_Kernel(ar); ar >> NVP(model); }
void RegisterModelObin(std::ofstream& ofs, SP::Model& model) { boost::archive::binary_oarchive ar(ofs); siconos_io_register_Numerics(ar); siconos_io_register_Kernel(ar); ar << NVP(model); }
void RegisterSimulationObin(std::ofstream& ofs, SP::Simulation& sim) { boost::archive::binary_oarchive ar(ofs); siconos_io_register_Numerics(ar); siconos_io_register_Kernel(ar); siconos_io_register_Mechanics(ar); siconos_io_register_Control(ar); ar << NVP(sim); }
* Each type of attribute has a name/value pair in a table of these: */ typedef struct { unsigned value; const char *name; } p12NameValuePair; /* declare one entry in a table of p12NameValuePair */ #define NVP(attr) {attr, #attr} /* the NULL entry which terminates all p12NameValuePair tables */ #define NVP_END {0, NULL} static const p12NameValuePair p7CITypeNames[] = { NVP(CT_None), NVP(CT_Data), NVP(CT_SignedData), NVP(CT_EnvData), NVP(CT_SignedEnvData), NVP(CT_DigestData), NVP(CT_EncryptedData), NVP_END }; static const p12NameValuePair p12BagTypeNames[] = { NVP(BT_None), NVP(BT_KeyBag), NVP(BT_ShroudedKeyBag), NVP(BT_CertBag),
void config_lua_table::get_values(augs::lua_state_raii& lua) { auto set = [&](auto& c, const std::string& ss) { get_config_value(lua, replace_all(ss, ".", "_"), c); }; set(NVP(launch_mode)); set(NVP(input_recording_mode)); set(NVP(recording_replay_speed)); set(NVP(determinism_test_cloned_cosmoi_count)); set(NVP(enable_hrtf)); set(NVP(sound_effects_volume)); set(NVP(music_volume)); set(NVP(debug_disable_cursor_clipping)); set(NVP(mouse_sensitivity)); set(NVP(connect_address)); set(NVP(connect_port)); set(NVP(server_port)); set(NVP(alternative_port)); set(NVP(nickname)); set(NVP(debug_second_nickname)); set(NVP(tickrate)); set(NVP(jitter_buffer_ms)); set(NVP(client_commands_jitter_buffer_ms)); set(NVP(interpolation_speed)); set(NVP(misprediction_smoothing_multiplier)); set(NVP(debug_var)); set(NVP(debug_randomize_entropies_in_client_setup)); set(NVP(debug_randomize_entropies_in_client_setup_once_every_steps)); set(NVP(server_launch_http_daemon)); set(NVP(server_http_daemon_port)); set(NVP(server_http_daemon_html_file_path)); set(NVP(db_path)); set(NVP(survey_num_file_path)); set(NVP(post_data_file_path)); set(NVP(last_session_update_link)); set(NVP(director_scenario_filename)); set(NVP(menu_intro_scenario_filename)); set(NVP(menu_theme_filename)); set(NVP(rewind_intro_scene_by_secs)); set(NVP(start_menu_music_at_secs)); set(NVP(skip_credits)); set(NVP(latest_news_url)); set(NVP(hotbar.increase_inside_alpha_when_selected)); set(NVP(hotbar.colorize_inside_when_selected)); set(NVP(hotbar.primary_selected_color)); set(NVP(hotbar.secondary_selected_color)); }
bool XML_Saver::open(const ACE_TString & base_name, size_t backup_count) { this->base_name_ = base_name; this->backup_count_ = backup_count; if (base_name == ACE_TEXT("cout")) { this->output_ = stdout; this->close_out_ = false; } else if (base_name == ACE_TEXT("cerr")) { this->output_ = stderr; this->close_out_ = false; } else { ACE_TString file_name = base_name; file_name += ACE_TEXT(".new"); this->output_ = ACE_OS::fopen (file_name.c_str(), ACE_TEXT("wb")); if (this->output_) { this->close_out_ = true; } else { ORBSVCS_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) XML_Saver unable to open %s\n"), base_name.c_str())); } } if (this->output_ != 0) { FILE * const out = this->output_; ACE_OS::fprintf (out, "<?xml version=\"1.0\"?>\n"); try { bool changed = true; NVPList attrs; ACE_Time_Value const now = ACE_High_Res_Timer::gettimeofday(); ACE_UINT64 nowus = now.usec(); static const ACE_UINT64 USECSPERSEC = 1000 * 1000; ACE_UINT64 const tmpus = now.sec(); nowus += tmpus * USECSPERSEC; ACE_TCHAR nowusstr[128]; ACE_OS::sprintf(nowusstr, ACE_UINT64_FORMAT_SPECIFIER, nowus); attrs.push_back(NVP("version", "1.0")); if (this->timestamp_) { attrs.push_back(NVP("timestamp", ACE_TEXT_ALWAYS_CHAR(nowusstr))); } this->begin_object(0, "notification_service", attrs, changed); } catch (const CORBA::Exception& ex) { ex._tao_print_exception ( ACE_TEXT ( "(%P|%t) XML_Saver Unknown exception\n")); if (this->close_out_ && this->output_ != 0) { (void) ACE_OS::fclose (this->output_); } this->output_ = 0; } } return this->output_ != 0; }