Next: print() and info() Up: Creating a New Previous: The Constructor

The Data

The heart of the new class is its data members. You should give them good mnemonic names. If you are planning to use the node type in DSTs, you should make the data members of the shortest acceptable data type to save disk space when the node is written out. That is, you should not use an int when a short is large enough to contain the data. The data definition in the example consists of the following lines:


  unsigned char version;
  
  short boxnum;                 // ERP BOX

  short adc0u;                  // ADC 0 side Unattenuated
  short adc1u;                  // ADC 1 side Unattenuated
  short tdc0h;                  // TDC 0 side high
  short tdc1h;                  // TDC 1 side high
  short adc0a;                  // ADC 0 side attenuated
  short adc1a;                  // ADC 1 side attenuated
  short tdc0l;                  // TDC 0 side low
  short tdc1l;                  // TDC 1 side low

  float energy;                 // ERP Energy
  float time;                   // Time of BOX hit rel. to stop
  float posh;                   // Box position from tdch


walter@
Wed Aug 10 11:53:26 PDT 1994