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/RodPrimList.h

Go to the documentation of this file.
00001 // File: RodPrimList.h
00002 
00003 #ifndef SCTPIXELROD_RODPRIMLIST_H
00004 #define SCTPIXELROD_RODPRIMLIST_H
00005 
00006 #include <list>
00007 #include <string>
00008 #include "RodPrimitive.h"
00009 #include "../CommonWithDsp/processor.h"
00010 #include "../CommonWithDsp/primParams.h"
00011 
00012 namespace SctPixelRod {
00013 
00014 /*!
00015  * @class PrimListException
00016  *
00017  * @brief This is a class to handle exceptions in the PrimList Class.
00018  *
00019  * @author Tom Meyer (meyer@iastate.edu) - originator
00020  */
00021 
00022 class PrimListException {
00023 public:
00024   PrimListException( std::string descriptor, unsigned long data1, unsigned long data2);
00025   std::string getDescriptor() {return m_descriptor;};
00026   unsigned long getData1() {return m_data1;};
00027   unsigned long getData2() {return m_data2;};
00028 
00029 private:
00030   std::string m_descriptor;    // A text description of the error
00031   unsigned long m_data1;    // First data value returned
00032   unsigned long m_data2;    // Second data value returned
00033 };                                                                            
00034 
00035 /*!
00036  * @class RodPrimList
00037  *
00038  * @brief This is a list of RodPrimitives to be sent to the RodModule.
00039  *
00040  * This class is a list of the primitives that control ROD behavior.  
00041  * It is sent to the RodModule via its Send function.  As it is derived 
00042  * from the STL list, it inherits all the usual list functionality.
00043  *
00044  * @author Tom Meyer (meyer@iastate.edu) - originator
00045  */
00046 
00047 class RodPrimList : public list<RodPrimitive> {
00048   private:
00049     //! Unique list identifier
00050     unsigned long m_index;
00051     //! PrimList version number
00052     unsigned long m_version;
00053     //! Buffer to send
00054     unsigned long *m_buffer;
00055     //! Buffer size
00056     unsigned long m_bufferSize;
00057 
00058   public:
00059     //! Constructor with specified index
00060     RodPrimList(unsigned long theIndex) : 
00061       list<RodPrimitive>(), m_index(theIndex), 
00062       m_buffer(0), m_bufferSize(0) {m_version = PRIM_LIST_REVISION;};
00063     //! Default constructor
00064     RodPrimList() : 
00065       list<RodPrimitive>(), m_index(0), 
00066       m_buffer(0), m_bufferSize(0) {m_version = PRIM_LIST_REVISION;};
00067     //! Copy constructor 
00068     RodPrimList(const RodPrimList &rhs); 
00069     //! Overloaded assignment
00070     RodPrimList &operator=(const RodPrimList&);
00071     //! Destructor
00072     ~RodPrimList();
00073 
00074     //! Compute list checksum
00075     unsigned long checkSum();   
00076     //! Compute number of words in list
00077     unsigned long numWords();   
00078 
00079     //! Create the buffer to send
00080     void bufferBuild() throw(PrimListException &);
00081     
00082     //! Return the buffer lingth.
00083     long getBufferLength() { return m_buffer[0]; };
00084 
00085     //! Return the buffer.
00086     unsigned long *getBuffer() { return m_buffer; };
00087 
00088     //! Print the primitive list
00089     void print();
00090 
00091     //! Clear the primitive list
00092     void clear();
00093 
00094     //! Set the list identifier index
00095     void setIndex(unsigned long i) { m_index=i; }  
00096     //! Get the list identifier index
00097     unsigned long getIndex() const { return m_index; } ;    
00098 
00099     //! Set the version number
00100     void setVersion(unsigned long version) { m_index=version; }  
00101     //! Get the version number
00102     unsigned long getVersion() const { return m_version; } ;    
00103 };
00104 
00105 } // End namespace SctPixelRod
00106 #endif

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