Template:Module/class.cpp

// $Id$ // Copyright (c) <<>> <<>> // Template valid as of EXPORT_CREATE(<<>>); EXPORT_INIT(<<>>); // TODO add optional functions declarations CLASS <<>>::oclass = NULL; <<>> *<<>>::defaults = NULL; // TODO add declaration of class globals <<>>::<<>>(MODULE *module) {  if ( oclass!=NULL ) exception("cannot register class more than once"); oclass = gld_class::create(module,"<<>>",sizeof(<<>>),<<>>); if ( oclass==NULL ) exception("class registration failed"); oclass->trl = <<>>; if ( gl_publish_variable(oclass, <<>>, NULL)<1 ) exception("unable to publish properties"); memset(defaults=this,0,sizeof(*this)); // TODO set defaults } <<>>::create(void) {  memcpy(this,defaults,sizeof(*this)); // TODO set defaults return SUCCESS; // return FAILED on create error } <<>>::init(OBJECT *parent) {  // TODO initialize object return SUCCESS; // return FAILED on create error } // TODO add implementations of optional class functions
 * 1) include "<<<CLASS>>>.h"