[rkward-cvs] rkward/rkward/core robject.cpp,1.19,1.20 robject.h,1.21,1.22

Thomas Friedrichsmeier tfry at users.sourceforge.net
Fri Dec 9 17:35:43 UTC 2005


Update of /cvsroot/rkward/rkward/rkward/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23947/core

Modified Files:
	robject.cpp robject.h 
Log Message:
Fix last commit

Index: robject.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/core/robject.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** robject.h	9 Dec 2005 16:06:32 -0000	1.21
--- robject.h	9 Dec 2005 17:35:40 -0000	1.22
***************
*** 32,37 ****
  Base class for representations of objects in the R-workspace. RObject is never used directly (contains pure virtual functions).
  
- TODO: information about dimensionality and classes should be moved to RObject instead of its derived classes (virtual functions).
- 	- after that, several other portions of the code should be updated (e.g. RKComponentPropertyRObjects)
  @author Thomas Friedrichsmeier
  */
--- 32,35 ----
***************
*** 43,47 ****
--- 41,50 ----
  	virtual ~RObject ();
  
+ /** types of objects, RKWard knows about */
  	enum RObjectType { DataFrame=1, Matrix=2, Array=4, List=8, Container=16, Variable=32, Workspace=64, Function=128, HasMetaObject=256 };
+ 	#define ROBJECT_TYPE_INTERNAL_MASK (RObject::Container | RObject::Variable | RObject::Workspace)
+ /** @returns false if an object of the given old type cannot represent an object of the given new type (e.g. (new_type & RObjectType::Variable), but (old_type & RObjectType::Container)). */
+ 	static bool isMatchingType (int old_type, int new_type) { return ((old_type & ROBJECT_TYPE_INTERNAL_MASK) == (new_type & ROBJECT_TYPE_INTERNAL_MASK)); };
+ /** types of variables, RKWard knows about. See \ref RKVariable */
  	enum VarType { Unknown=0, Number=1, Factor=2, String=3, Invalid=4 };
  	
***************
*** 59,64 ****
  	bool isVariable () { return (type & Variable); };
  	bool hasMetaObject () { return (type & HasMetaObject); };
- /** @returns false if an object of the given old type can not represent an object of the given new type (e.g. (new_type & RObjectType::Variable), but (old_type & RObjectType::Container)). */
- 	bool isMatchingType (int old_type, int new_type);
  
  	void rename (const QString &new_short_name);
--- 62,65 ----
***************
*** 72,76 ****
  	bool inherits (const QString &class_name);
  
! /** get number of dimensions. In RKWard each object is viewed to have at least one dimension (this view, of course, is slightly incorrect as well, but makes life easier) */
  	int numDimensions () { return num_dimensions; };
  /** get the length of the given dimension. The object is guaranteed to have at least 1 dimension, so calling getDimension (0) is always safe */
--- 73,77 ----
  	bool inherits (const QString &class_name);
  
! /** get number of dimensions. For simplicity, In RKWard each object is considered to have at least one dimension (but that dimension may be 0 in length) */
  	int numDimensions () { return num_dimensions; };
  /** get the length of the given dimension. The object is guaranteed to have at least 1 dimension, so calling getDimension (0) is always safe */

Index: robject.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/core/robject.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** robject.cpp	9 Dec 2005 16:06:32 -0000	1.19
--- robject.cpp	9 Dec 2005 17:35:40 -0000	1.20
***************
*** 147,157 ****
  }
  
- bool RObject::isMatchingType (int old_type, int new_type) {
- 	RK_TRACE (OBJECTS);
- 
- 	int type_mask = Container | Variable | Workspace;	// for easier typing
- 	return ((old_type & type_mask) == (new_type & type_mask));
- }
- 
  QString RObject::makeChildName (const QString &short_child_name) {
  	RK_TRACE (OBJECTS);
--- 147,150 ----





More information about the rkward-tracker mailing list