Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

/var/pcce/usera/hill/rcc_1.2/RodDaq/RodCrate/RodPrimitive.cxx

Go to the documentation of this file.
00001 // File: RodPrimitive.cxx
00002 // $Header: /afs/cern.ch/user/s/sctpixel/private/cvsroot/RodDaq/RodCrate/RodPrimitive.cxx,v 1.2 2002/12/12 21:25:53 tmeyer Exp $
00003 
00004 // Description:
00005 // This class contains the primitives which are sent as a list to the RODs. They control 
00006 // almost all aspects of the ROD DSP behavior. New primitives can be defined to perform
00007 // user-defined actions, but corresponding DSP code must also be written, compiled and
00008 // loaded into the DSPs before the primitive can be executed.
00009 //
00010 // @author Tom Meyer (meyer@iastate.edu) - originator
00011 
00012 //! Namespace for the common routines for SCT and PIXEL ROD software.
00013 
00014 #include "RodPrimitive.h"
00015 
00016 namespace SctPixelRod {
00017 
00018 // Constructors
00019         /*
00020         The default constructor, provided explicitly.
00021         */
00022         RodPrimitive::RodPrimitive()
00023         {
00024           m_length = 0;
00025           m_index = 0;
00026           m_id = 0;
00027           m_version = 100;
00028           m_body = 0;
00029         }
00030 
00031         /*
00032         An alternate constructor, which initializes the data members from arguments.
00033         */
00034         RodPrimitive::RodPrimitive( long length, long index, long id, long
00035                                     version, long* body)
00036         {
00037           m_length = length;
00038           m_index = index;
00039           m_id = id;
00040           m_version = version;
00041           m_body = body;
00042         }
00043 
00044         /*
00045         The copy constructor, which uses a deep copy since one data member is referenced
00046         by a pointer.
00047         */
00048         RodPrimitive::RodPrimitive( const RodPrimitive& rhs)
00049         {
00050           if (this == &rhs) return;
00051           m_length = rhs.getLength();
00052           m_index = rhs.getIndex();
00053           m_id = rhs.getId();
00054           m_version = rhs.getVersion();
00055           m_body = rhs.getBody();
00056           return;
00057         }
00058 
00059 // Destructor
00060         /*
00061         The destructor. We MUST be sure to delete the space allocated on the heap for m_body.
00062         For safety, we also set the pointer to zero to avoid pointers into la-la land.
00063         */
00064         RodPrimitive::~RodPrimitive() 
00065         {
00066           m_body = 0;
00067         }
00068 
00069 // Overload = operator
00070         /*
00071         Overload the assignment operator to allow us to equate objects of this class. Note the
00072         special case to handle assigning an object to itself (i.e. A=A).
00073         */
00074         RodPrimitive& RodPrimitive::operator=( const RodPrimitive& rhs)
00075         {
00076           if (this == &rhs) return *this;
00077           m_length = rhs.getLength();
00078           m_index = rhs.getIndex();
00079           m_id = rhs.getId();
00080           m_version = rhs.getVersion();
00081           m_body = rhs.getBody();
00082           return *this;
00083         }
00084 
00085 } // End namespace SctPixelRod

Generated on Mon Mar 3 11:16:17 2003 for SCTPixelDAQ by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001