From janko.thyson at ku-eichstaett.de  Mon Nov 22 00:31:25 2010
From: janko.thyson at ku-eichstaett.de (Janko Thyson)
Date: Mon, 22 Nov 2010 00:31:25 +0100
Subject: [Rd] reference classes: question on inheritance
Message-ID: <006301cb89d4$36afbcf0$a40f36d0$@thyson@ku-eichstaett.de>

Dear list,

I have a reference class which should act as a "generic" superclass for
other classes. I've read the respective section at ?setRefClass and put the
name of the superclass to the 'contains' argument of an example subclass
(see class defs below). Classnames are set in a way that shouldn't result in
collation issues (virtual def sourced before superclass def sourced before
subclass). Yet, this  results in the following error:

Warnmeldung:
unable to find a consistent ordering of superclasses for class "Shabubu":
order chosen is inconsistent with the superclasses of "JObject"

###### CLASS DEFS #####
setClass("JObjectVirtual")
setRefClass(
	Class="JObject",
	fields=list(
		# GENERIC FIELDS (DON'T CHANGE !!!)
		.BUFFER="environment",
		.GENESIS="environment",
		.HISTORY="environment",
		.IMAGES="environment",
		.LOGS="environment",
		.OPTS="environment",
		.PLUGINS="environment",
		.TMP="environment",
		.UID="character",
		DATA="data.frame"
		# /
	),
	contains=c("JObjectVirtual"),
 	methods=list(
		...
	)
)
setRefClass(
	Class="Shabubu",
	fields=list(
		# CUSTOM FIELDS (ADAPT TO YOUR NEEDS)
		a="numeric",
		b="character",
		c="logical",
		d="data.frame",
		e="matrix",
		f="list",
		derived.field="function"
		# /
	),
	contains=c("JObject")
)

What am I doing wrong here?

Thanks,
Janko



[Rd] reference classes: question on inheritance
Janko Thyson