← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3947: Remove YADE_DEPREC_DOF_LIST prepocessor.

 

------------------------------------------------------------
revno: 3947
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Tue 2014-05-13 17:07:07 +0200
message:
  Remove YADE_DEPREC_DOF_LIST prepocessor.
modified:
  core/State.cpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'core/State.cpp'
--- core/State.cpp	2010-12-15 12:48:11 +0000
+++ core/State.cpp	2014-05-13 15:07:07 +0000
@@ -21,36 +21,12 @@
 	return ret;
 }
 
-#ifdef YADE_DEPREC_DOF_LIST
-// support deprecated syntax, later take std::string arg directly (more efficient)
-void State::blockedDOFs_vec_set(const python::object& dofs0){
-	python::extract<std::string> dofStr(dofs0);
-	python::extract<std::vector<std::string> > dofLst(dofs0);
+void State::blockedDOFs_vec_set(const std::string& dofs){
 	blockedDOFs=0;
-	if(dofStr.check()){
-		string dofs(dofStr());
-#else
-	void State::blockedDOFs_vec_set(const std::string& dofs){
-		blockedDOFs=0;
-#endif
 		FOREACH(char c, dofs){
 			#define _GET_DOF(DOF_ANY,ch) if(c==ch) { blockedDOFs|=State::DOF_ANY; continue; }
 			_GET_DOF(DOF_X,'x'); _GET_DOF(DOF_Y,'y'); _GET_DOF(DOF_Z,'z'); _GET_DOF(DOF_RX,'X'); _GET_DOF(DOF_RY,'Y'); _GET_DOF(DOF_RZ,'Z');
 			#undef _GET_DOF
 			throw std::invalid_argument("Invalid  DOF specification `"+lexical_cast<string>(c)+"' in '"+dofs+"', characters must be ∈{x,y,z,X,Y,Z}.");
-		}
-#ifdef YADE_DEPREC_DOF_LIST
-	} else 
-	if(dofLst.check()){
-		LOG_WARN("Specifying State.blockedDOFs as list ['x','y','rx','rz'] is deprecated, use string 'xyXZ' instead.");
-		FOREACH(const std::string s, dofLst()){
-			#define _GET_DOF(DOF_ANY,str) if(s==str) { blockedDOFs|=State::DOF_ANY; continue; }
-			_GET_DOF(DOF_X,"x"); _GET_DOF(DOF_Y,"y"); _GET_DOF(DOF_Z,"z"); _GET_DOF(DOF_RX,"rx"); _GET_DOF(DOF_RY,"ry"); _GET_DOF(DOF_RZ,"rz");
-			#undef _GET_DOF
-			throw std::invalid_argument("Invalid  DOF specification `"+s+"', must be ∈{x,y,z,rx,ry,rz}.");
-		}
-	} else {
-		throw std::invalid_argument("Invalid type: State.blockedDOFs must be either list of strings or string.");
 	}
-#endif
 }