Charlie Curry (ctc++at++brown.engr.sgi.com)
Thu, 15 Jul 1999 08:36:14 -0700 (PDT)
pfSoundSource::pfSoundSource() : pfNode(/*blah*/)
{
/* more stuff */
}
Check out the documentation for pfNode, and you'll see that IT has no
default constructor. If you just write...
pfSoundSource::pfSoundSource()
{
It implies...
pfSoundSource::pfSoundSource() : pfNode()
{
but that call does not exist.
Good luck,
Charlie Curry
On Thu, 15 Jul 1999, Simon Mills wrote:
> Hi,
>
> I'm trying to subclass pfNode to make my own (sound) pfNode type. It
> works if I subclass a pfGroup but I'm having trouble compiling if I use
> pfNode. The error I get is:
>
> "../pfSoundSource.c++", line 27: error(1264): no default constructor
> exists
> for class "pfNode"
> {
>
> ... and this is the relevant code parts:
>
> ----- pfSoundSource.c++ ------
>
> #include <Performer/pf/pfNode.h>
> #include <Performer/pr/pfMemory.h>
> #include <Performer/pr/pfLinMath.h>
> #include <Performer/pf/pfTraverser.h>
> #include "pfSoundSource.h"
>
>
> pfType *pfSoundSource::classType = NULL;
>
>
> void
> pfSoundSource::init() /* Define class type */
> {
> if (classType == NULL) {
> pfNode::init();
> classType = new pfType(pfNode::getClassType(), "pfSoundSource");
> }
> }
>
>
> pfSoundSource::pfSoundSource(char *fName) // Constructor with loading
> {
> pfMemory::setType(classType);
>
> /* Initialise properties */
> ...
> }
>
> ---- end pfSoundSource.c++ -----
>
> ---- pfSoundSource.h ----
>
> class pfSoundSource : public pfNode
> {
> private:
> static pfType *classType;
>
> private:
> ...
>
> public: /* constructor/destructor */
> pfSoundSource(); // without loading (default)
> pfSoundSource(char *fName); // with loading
> ~pfSoundSource(void);
>
> public: /* type */
> static void init();
> static pfType *getClassType() { return classType; }
>
> }
>
> ---- end pfSoundSource.h ----
>
>
> Does anyone know what I'm doing wrong or recognise this problem? I've
> followed the recommendations in the Performer Programming Guide but I
> guess I'm missing something because pfNode is only a container class.
>
> Regards, Simon
> ________________________________________________________________________
>
> Simon C. Mills
> Modelling & Simulation Section (TOS-EMM) Tel: +31 (0)71 565 3725
> European Space Agency (ESA/ESTEC) Fax: +31 (0)71 565 5419
> Postbus 299, 2200AG Noordwijk e-mail: simon++at++wgs.estec.esa.nl
> The Netherlands http://www.estec.esa.nl/wmwww/EMM
> ________________________________________________________________________
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>
This archive was generated by hypermail 2.0b2 on Thu Jul 15 1999 - 08:36:21 PDT