Skip to content

Commit

Permalink
Fixing warning about control reaching end of non-void method
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanmunawar committed Jul 11, 2021
1 parent 9b59f94 commit b171708
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
39 changes: 21 additions & 18 deletions adf_loader/adf_loader_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,58 +59,61 @@ class ADFLoaderBase{
~ADFLoaderBase(){}

// Load object attributes
virtual bool loadObjectAttribs(YAML::Node* a_node, std::string a_objName, afType a_objType, afBaseObjectAttributes* a_objAttribs){}
virtual bool loadObjectAttribs(YAML::Node* a_node, std::string a_objName, afType a_objType, afBaseObjectAttributes* a_objAttribs){return 0;}

// Load Light Attributes
virtual bool loadLightAttribs(YAML::Node* a_node, afLightAttributes* attribs){}
virtual bool loadLightAttribs(YAML::Node* a_node, afLightAttributes* attribs){return 0;}

// Load Camera Attributes
virtual bool loadCameraAttribs(YAML::Node* a_node, afCameraAttributes* attribs){}
virtual bool loadCameraAttribs(YAML::Node* a_node, afCameraAttributes* attribs){return 0;}

// Load rigid body from a YAML::Node
virtual bool loadRigidBodyAttribs(YAML::Node* a_node, afRigidBodyAttributes* attribs){}
virtual bool loadRigidBodyAttribs(YAML::Node* a_node, afRigidBodyAttributes* attribs){return 0;}

// Load soft body from a YAML::Node
virtual bool loadSoftBodyAttribs(YAML::Node* a_node, afSoftBodyAttributes* attribs){}
virtual bool loadSoftBodyAttribs(YAML::Node* a_node, afSoftBodyAttributes* attribs){return 0;}

// Load ghost object from a YAML::Node
virtual bool loadGhostObjectAttribs(YAML::Node* a_node, afGhostObjectAttributes* attribs){}
virtual bool loadGhostObjectAttribs(YAML::Node* a_node, afGhostObjectAttributes* attribs){return 0;}

// Load joint from a YAML::Node
virtual bool loadJointAttribs(YAML::Node* a_node, afJointAttributes* attribs){}
virtual bool loadJointAttribs(YAML::Node* a_node, afJointAttributes* attribs){return 0;}

// Load joint from a YAML::Node
virtual bool loadRayTracerSensorAttribs(YAML::Node* a_node, afRayTracerSensorAttributes* attribs){}
virtual bool loadRayTracerSensorAttribs(YAML::Node* a_node, afRayTracerSensorAttributes* attribs){return 0;}

// Load joint from a YAML::Node
virtual bool loadResistanceSensorAttribs(YAML::Node* a_node, afResistanceSensorAttributes* attribs){}
virtual bool loadResistanceSensorAttribs(YAML::Node* a_node, afResistanceSensorAttributes* attribs){return 0;}

// Load actuator from a YAML::Node
virtual bool loadActuatorAttribs(YAML::Node* a_node, afActuatorAttributes* attribs){}
virtual bool loadActuatorAttribs(YAML::Node* a_node, afActuatorAttributes* attribs){return 0;}

// Load actuator from a YAML::Node
virtual bool loadConstraintActuatorAttribs(YAML::Node* a_node, afConstraintActuatorAttributes* attribs){}
virtual bool loadConstraintActuatorAttribs(YAML::Node* a_node, afConstraintActuatorAttributes* attribs){return 0;}

// Load sensor from a YAML::Node
virtual bool loadVehicleAttribs(YAML::Node* a_node, afVehicleAttributes* attribs){}
virtual bool loadVehicleAttribs(YAML::Node* a_node, afVehicleAttributes* attribs){return 0;}

// Load sensor from a YAML::Node
virtual bool loadVolumeAttribs(YAML::Node* a_node, afVolumeAttributes* attribs){return 0;}

// Load Input Device Attributes
virtual bool loadInputDeviceAttribs(YAML::Node* a_node, afInputDeviceAttributes *attribs){}
virtual bool loadInputDeviceAttribs(YAML::Node* a_node, afInputDeviceAttributes *attribs){return 0;}

// Load Simulated Device Attributes
virtual bool loadSimulatedDeviceAttribs(YAML::Node* a_node, afSimulatedDeviceAttribs *attribs){}
virtual bool loadSimulatedDeviceAttribs(YAML::Node* a_node, afSimulatedDeviceAttribs *attribs){return 0;}

// Load all the TU device attributes
virtual bool loadTeleRoboticUnitsAttribs(string a_filepath, vector<afTeleRoboticUnitAttributes>* attribs, vector<int> dev_indexes){}
virtual bool loadTeleRoboticUnitsAttribs(string a_filepath, vector<afTeleRoboticUnitAttributes>* attribs, vector<int> dev_indexes){return 0;}

// Load model from ADF file
virtual bool loadModelAttribs(string a_filepath, afModelAttributes* attribs){}
virtual bool loadModelAttribs(string a_filepath, afModelAttributes* attribs){return 0;}

// Load world from ADF file
virtual bool loadWorldAttribs(string a_filepath, afWorldAttributes* attribs){}
virtual bool loadWorldAttribs(string a_filepath, afWorldAttributes* attribs){return 0;}

// Load the launch file
virtual bool loadLaunchFileAttribs(string a_filepath, afLaunchAttributes* attribs){}
virtual bool loadLaunchFileAttribs(string a_filepath, afLaunchAttributes* attribs){return 0;}

// Get the version of this loader
virtual std::string getLoaderVersion();
Expand Down
8 changes: 4 additions & 4 deletions ambf_framework/afPluginInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class afSimulatorPlugin: public afPluginBase<afSimulatorPlugin>{
virtual void graphicsUpdate(){}
virtual void physicsUpdate(double dt){}
virtual void reset(){}
virtual bool close(){}
virtual bool close(){return 0;}

protected:
afWorldPtr m_worldPtr;
Expand All @@ -254,7 +254,7 @@ class afWorldPlugin: public afPluginBase<afWorldPlugin>{
virtual void graphicsUpdate(){}
virtual void physicsUpdate(double dt){}
virtual void reset(){}
virtual bool close(){}
virtual bool close(){return 0;}

protected:
afWorldPtr m_worldPtr;
Expand All @@ -277,7 +277,7 @@ class afModelPlugin: public afPluginBase<afModelPlugin>{
virtual void graphicsUpdate(){}
virtual void physicsUpdate(double dt){}
virtual void reset(){}
virtual bool close(){}
virtual bool close(){return 0;}

protected:
afModelPtr m_modelPtr;
Expand All @@ -297,7 +297,7 @@ class afObjectPlugin: public afPluginBase<afObjectPlugin>{
virtual void graphicsUpdate(){}
virtual void physicsUpdate(double dt){}
virtual void reset(){}
virtual bool close(){}
virtual bool close(){return 0;}

protected:
afBaseObjectPtr m_objectPtr;
Expand Down
5 changes: 4 additions & 1 deletion ambf_framework/afPluginManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ bool afSimulatorPluginManager::close(){
for (vector<afSimulatorPlugin*>::iterator it = m_plugins.begin() ; it != m_plugins.end() ; ++it){
(*it)->close();
}
return true;
}

void ambf::afWorldPluginManager::init(const afWorldPtr a_afWorld, const afWorldAttribsPtr a_worldAttribs)
Expand Down Expand Up @@ -161,6 +162,7 @@ bool ambf::afWorldPluginManager::close()
for (vector<afWorldPlugin*>::iterator it = m_plugins.begin() ; it != m_plugins.end() ; ++it){
(*it)->close();
}
return true;
}

void afModelPluginManager::init(const afModelPtr a_afModel, const afModelAttribsPtr a_modelAttribs)
Expand Down Expand Up @@ -207,10 +209,10 @@ void afModelPluginManager::reset()

bool afModelPluginManager::close()
{

for (vector<afModelPlugin*>::iterator it = m_plugins.begin() ; it != m_plugins.end() ; ++it){
(*it)->close();
}
return true;
}

void afBaseObjectPluginManager::init(const afBaseObjectPtr a_afObjectPtr, afBaseObjectAttribsPtr a_objectAttribs)
Expand Down Expand Up @@ -246,4 +248,5 @@ bool afBaseObjectPluginManager::close()
for (vector<afObjectPlugin*>::iterator it = m_plugins.begin() ; it != m_plugins.end() ; ++it){
(*it)->close();
}
return true;
}

0 comments on commit b171708

Please sign in to comment.