head	1.3;
access;
symbols
	OctansJune5:1.3
	Ver3-0:1.3
	Ver2-4:1.3
	Ver2-3-2:1.2
	Ver2-3:1.2
	Ver2-2:1.1
	Ver2-1:1.1
	Ver1-11:1.1
	Ver1-10:1.1
	Ver1-9:1.1
	Ver1-8:1.1
	Ver1-7:1.1
	Ver1-6:1.1
	Ver1-5:1.1
	Ver1-4-1:1.1
	Ver1-4:1.1
	Ver1-3:1.1
	Ver1-2:1.1;
locks; strict;
comment	@# @;


1.3
date	2000.09.11.19.18.41;	author oreilly;	state Exp;
branches;
next	1.2;

1.2
date	2000.06.30.23.09.58;	author oreilly;	state Exp;
branches;
next	1.1;

1.1
date	2000.01.16.18.51.55;	author oreilly;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Added documentation
@
text
@#!/bin/csh
# This script automatically generates most of the code for a subclass
# of SharedData (which uses shared memory as its underlying IPC mechanism)
#
# NOTE: This script is written for csh (so it does not run under QNX)
#
# Author: Tom O'Reilly
#
if ($#argv != 1) then
  echo usage: $0 classname
  exit 1
endif

set classname = $argv[1]

cat > ${classname}.h << EndHeader

#ifndef _${classname}_H
#define _${classname}_H

#include "SharedData.h"

#define ${classname}Name "${classname}_ShmemName"

/*
CLASS 
$classname

DESCRIPTION
!!!FILL IN CLASS DESCRIPTION HERE!!!

AUTHOR
!!!FILL IN AUTHOR HERE!!!
*/
class $classname : public SharedData {

public:

  struct Data {
    // DEFINE STRUCTURE ELEMENTS HERE
  };

  $classname(Access access = NoAccess, Boolean init = False);

  ~$classname();

  ////////////////////////////////////////////////////////////////////
  // Read from shared memory to this object's Data::data element
  void read();

  ////////////////////////////////////////////////////////////////////
  // Write from this object's Data::data element to shared memory
  void write();

  ////////////////////////////////////////////////////////////////////
  // Your application accesses the fields of this Data object, before 
  // calling write() or after calling read().
  Data data;

};

#endif
EndHeader


cat > ${classname}.cc << Endcc

#include "${classname}.h"
#include "Syslog.h"

${classname}::${classname}(Access access, Boolean init)
  : SharedData(${classname}Name, 
               sizeof(${classname}::Data),
               access, init)
{
}


${classname}::~${classname}()
{
}


void ${classname}::read()
{
  SharedData::read((void *)&data);
}

void ${classname}::write()
{
  SharedData::write((void *)&data);
}



Endcc

echo Generated files ${classname}.h and ${classname}.cc
echo NOTE: You must define ${classname}::Data structure in ${classname}.h

exit 0


@


1.2
log
@Added comments
@
text
@d3 1
a3 1
# of SharedData (which uses shared memory as the underlying IPC mechanism)
d5 1
a5 1
# NOTE: This script does not run under QNX, which doesn't have csh 
d7 2
a12 1

@


1.1
log
@*** empty log message ***
@
text
@d54 3
@
