SctApi::PrimListWrapper Struct Reference

Wrap the SctPixelRod::RodPrimList class. More...

#include <primListWrapper.h>


Public Member Functions

 PrimListWrapper ()
 Create a default RodPrimList.
 PrimListWrapper (unsigned int index)
 A RodPrimList with a particular index.
void clear ()
 Clear all datastructures.
void addPrimitive (const SctPixelRod::RodPrimitive &prim, long *data=0)
 If data is non zero then take ownership of the provided memory block.
void addPrimitive (long length, long index, long prim, long rev, const long *data)
 Copy and keep data to end of life.
 ~PrimListWrapper ()

Data Fields

std::auto_ptr< SctPixelRod::RodPrimList > list
std::list< long * > data


Detailed Description

Wrap the SctPixelRod::RodPrimList class.

Why? When a RodPrimitive is created a buffer containing the primitive is passed to the constructor. This remains under the ownership of the caller, but is used by RodPrimitive, and especially RodPrimList in the call buildList.

PrimListWrapper allows the caller to pass ownership, so the memory buffer isn't leaked.

Definition at line 24 of file primListWrapper.h.


Constructor & Destructor Documentation

SctApi::PrimListWrapper::PrimListWrapper  ) 
 

Create a default RodPrimList.

Definition at line 9 of file primListWrapper.cxx.

SctApi::PrimListWrapper::PrimListWrapper unsigned int  index  ) 
 

A RodPrimList with a particular index.

Definition at line 10 of file primListWrapper.cxx.


Member Function Documentation

void SctApi::PrimListWrapper::addPrimitive long  length,
long  index,
long  prim,
long  rev,
const long *  data
 

Copy and keep data to end of life.

Parameters:
length Length of data (ie primLength - 4)
index Id of primitive in primList
prim Primitive identifier
rev Primitive revision number
data Contents of primitive. Ownership remains with the caller.

Definition at line 24 of file primListWrapper.cxx.

References data, and list.

void SctApi::PrimListWrapper::addPrimitive const SctPixelRod::RodPrimitive &  prim,
long *  data = 0
 

If data is non zero then take ownership of the provided memory block.

Parameters:
prim Prebuilt primitive to add to the list
data Memory block to take ownership of (will be deleted by delete[])

Definition at line 17 of file primListWrapper.cxx.

References data, and list.

void SctApi::PrimListWrapper::clear  ) 
 

Clear all datastructures.

This deletes the contents of the RodPrimList as well as all the data buffers it owns.

Definition at line 12 of file primListWrapper.cxx.

References list.


The documentation for this struct was generated from the following files:
Generated on Mon Feb 6 14:04:35 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6