Skip to content
Snippets Groups Projects
Commit f0cc9a6f authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Changed the deprecated auto_ptr for the unique_ptr.

Changed the xsd library to generate code with the C++11 standard.
parent 2922d6c7
No related branches found
No related tags found
1 merge request!1Changed the deprecated auto_ptr for the unique_ptr.
......@@ -438,7 +438,7 @@ void CDynamixelMotor::read_config(std::string &filename,TDynamixel_config &confi
{
// try to open the specified file
try{
std::auto_ptr<dynamixel_motor_config_t> cfg(dynamixel_motor_config(filename.c_str(), xml_schema::flags::dont_validate));
std::unique_ptr<dynamixel_motor_config_t> cfg(dynamixel_motor_config(filename.c_str(), xml_schema::flags::dont_validate));
// configure the parameters of the controller
config.max_angle=cfg->max_angle();
config.min_angle=cfg->min_angle();
......@@ -477,7 +477,7 @@ void CDynamixelMotor::load_config(std::string &filename)
{
// try to open the specified file
try{
std::auto_ptr<dynamixel_motor_config_t> cfg(dynamixel_motor_config(filename.c_str(), xml_schema::flags::dont_validate));
std::unique_ptr<dynamixel_motor_config_t> cfg(dynamixel_motor_config(filename.c_str(), xml_schema::flags::dont_validate));
// configure the parameters of the controller
this->set_turn_off_alarms(cfg->alarm_shtdwn());
this->set_position_range(cfg->min_angle(), cfg->max_angle());
......
......@@ -660,7 +660,7 @@ TDynamixelGroup_config CDynamixelMotorGroup::read_config(std::string &filename)
{
// try to open the specified file
try{
std::auto_ptr<dyn_motor_group_config_t> cfg(dyn_motor_group_config(filename.c_str(), xml_schema::flags::dont_validate));
std::unique_ptr<dyn_motor_group_config_t> cfg(dyn_motor_group_config(filename.c_str(), xml_schema::flags::dont_validate));
config.id.resize(cfg->dyn_motor_config().size());
config.dyn_config.resize(cfg->dyn_motor_config().size());
config.pid_control.resize(cfg->dyn_motor_config().size());
......@@ -703,7 +703,7 @@ void CDynamixelMotorGroup::load_config(std::string &filename)
{
// try to open the specified file
try{
std::auto_ptr<dyn_motor_group_config_t> cfg(dyn_motor_group_config(filename.c_str(), xml_schema::flags::dont_validate));
std::unique_ptr<dyn_motor_group_config_t> cfg(dyn_motor_group_config(filename.c_str(), xml_schema::flags::dont_validate));
pid.resize(cfg->dyn_motor_config().size());
punch.resize(cfg->dyn_motor_config().size());
compliance.resize(cfg->dyn_motor_config().size());
......@@ -717,7 +717,7 @@ void CDynamixelMotorGroup::load_config(std::string &filename)
this->init_motor(iterator->id());
// load the configuration file
full_path=path+iterator->config_file();
std::auto_ptr<dynamixel_motor_config_t> motor(dynamixel_motor_config(full_path.c_str(),xml_schema::flags::dont_validate));
std::unique_ptr<dynamixel_motor_config_t> motor(dynamixel_motor_config(full_path.c_str(),xml_schema::flags::dont_validate));
this->set_position_range(i,motor->min_angle(),motor->max_angle());
this->set_temperature_limit(i,motor->temp_limit());
this->set_voltage_limits(i,motor->min_voltage(),motor->max_voltage());
......
......@@ -37,7 +37,7 @@ IF(XSD_FOUND)
ADD_CUSTOM_TARGET(xsd_files_gen DEPENDS ${XSD_SOURCES_INT})
ADD_CUSTOM_COMMAND(
OUTPUT ${XSD_SOURCES_INT}
COMMAND xsdcxx cxx-tree --generate-serialization ${XSD_FILES}
COMMAND xsdcxx cxx-tree --std c++11 --generate-serialization ${XSD_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${XSD_PATH_FILES}
COMMENT "Parsing the xml template file ${XSD_FILES}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment