/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Friends
DybDaq::FadcTraits Class Reference

#include <FadcTraits.h>

Inheritance diagram for DybDaq::FadcTraits:
Inheritance graph
[legend]
Collaboration diagram for DybDaq::FadcTraits:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector
< BitsDefinition
Definitions

Public Member Functions

virtual ~FadcTraits ()
 Destroy this instance of the class.
virtual unsigned int illegalMarker () const
 Returns the index value for an illegal header.
virtual unsigned int illegalField () const
 Returns the index value for an illegal field.
virtual unsigned int triggerTypeEnd () const =0
 Returns the maximum trigger type.
virtual const char * triggerTypeAsString (unsigned int triggerType) const
 Returns the string for the specified trigger type.
virtual unsigned int headSize () const =0
 Returns the size of a FadcHead in this format.
virtual unsigned int dataSize () const =0
 Returns the size of a FADC data in this format.
virtual unsigned int footSize () const =0
 Returns the size of a FadcFoot in this format.
virtual void initializeHead (char *buffer) const =0
 Initializes the FadcHead memory with the appropriate markers.
virtual void initializeData (char *buffer) const =0
 Initializes the FadcData memory with the appropriate markers.
virtual void initializeFoot (char *buffer) const =0
 Initializes the FadcFoot memory with the appropriate markers.
virtual unsigned int majorVersion () const =0
virtual unsigned int minorVersion () const =0
virtual const std::string versionString () const =0
virtual unsigned int marker (unsigned int marker) const
virtual const char * boolAsString (bool value) const
const DaqTraits::DefinitionsbitsDefinitions (unsigned int component) const

Static Public Member Functions

static const FadcTraitsdefaultTraits ()
 Returns a default FadcTraits to bootstrap the system.
static const FadcTraitsreadTraits (const char *&buffer)
 Returns the FadcTraits to use given the supplied buffer.

Static Public Attributes

static const unsigned int kHead = 0
 The head component for this format.
static const unsigned int kData = FadcTraits::kHead + 1
 The data component for this format.
static const unsigned int kFoot = FadcTraits::kData + 1
 The foot component for this format.
static const unsigned int kHeadTriggerNumber = 0
 The field for the trigger number in the head.
static const unsigned int kMajorVersion = FadcTraits::kHeadTriggerNumber + 1
 The field for the major version.
static const unsigned int kMinorVersion = FadcTraits::kMajorVersion + 1
 The field for the minor version.
static const unsigned int kTriggerType = FadcTraits::kMinorVersion + 1
 The field for the trigger type.
static const unsigned int kNoData = FadcTraits::kTriggerType + 1
 The field for when there is no data.
static const unsigned int kHeadMarker = FadcTraits::kFootDataLength + 1
 The field for the head marker.
static const unsigned int kAdcDataMarker = FadcTraits::kHeadMarker + 1
 The field for the ADC data marker.
static const unsigned int kFootMarker = FadcTraits::kAdcDataMarker + 1
 The field for the foot marker.
static const unsigned int kProtectionStatus = FadcTraits::kFootMarker + 1
 The field for when there is no data.
static const unsigned int kScaleEnabled = FadcTraits::kProtectionStatus + 1
 The field for when there is no data.
static const unsigned int kDuringPrevious = FadcTraits::kScaleEnabled + 1
 The field for when there is no data.
static const unsigned int kChannelId = FadcTraits::kNoData + 1
 The field for the channel id for the data.
static const unsigned int kHighDataByte = FadcTraits::kChannelId + 1
 The field for the high data byte.
static const unsigned int kMiddleDataByte = FadcTraits::kHighDataByte + 1
 The field for the middle data byte.
static const unsigned int kLowDataByte = FadcTraits::kMiddleDataByte + 1
 The field for the low data byte.
static const unsigned int kChannelHeadMarker = FadcTraits::kDuringPrevious + 1
 The field for the channel header marker.
static const unsigned int kChannelHeadCheck = FadcTraits::kChannelHeadMarker + 1
 The field for the channel header check bytes.
static const unsigned int kChannelFootMarker = FadcTraits::kChannelHeadCheck + 1
 The field for the channel trailer marker.
static const unsigned int kChannelFootCheck = FadcTraits::kChannelFootMarker + 1
 The field for the channel trailer check bytes.
static const unsigned int kSample1 = FadcTraits::kChannelFootCheck + 1
 The field for the sample 1.
static const unsigned int kSample2 = FadcTraits::kSample1 + 1
 The field for the sample 2.
static const unsigned int kSample3 = FadcTraits::kSample2 + 1
 The field for the sample 3.
static const unsigned int kSample4 = FadcTraits::kSample3 + 1
 The field for the sample 4.
static const unsigned int kFootTriggerNumber = FadcTraits::kLowDataByte + 1
 The field for the trigger number in the foot.
static const unsigned int kFootDataLength = FadcTraits::kFootTriggerNumber + 1
 The field for the trigger type.

Protected Member Functions

 FadcTraits ()
 Creates an instance of this class.
virtual const char ** triggerTypeStrings () const =0
 Returns the array of trigger type strings.
unsigned int index (unsigned int field) const
virtual unsigned int markersEnd () const =0
virtual const unsigned int * markers () const =0
virtual unsigned int fieldsEnd () const =0
virtual const unsigned int * indices () const =0
virtual const unsigned int * shifts () const =0
virtual const unsigned int * masks () const =0
virtual const std::string * descriptions () const
virtual DaqTraits::Definitionsdefinitions (unsigned int component) const
virtual void setDefinitions (DaqTraits::Definitions *definitions, unsigned int component)
virtual const unsigned int * componentFields (unsigned int component) const
virtual const unsigned int componentFieldsEnd (unsigned int component) const

Static Protected Member Functions

static unsigned int readUnsignedInt (const char *&buffer, const DaqTraits &traits, unsigned int field)

Private Member Functions

 FadcTraits (FadcTraits &rhs)
 Suppress default.
FadcTraitsoperator= (FadcTraits &rhs)
 Suppress default.

Friends

friend class DaqBuffer

Detailed Description

Definition at line 17 of file FadcTraits.h.


Constructor & Destructor Documentation

FadcTraits::~FadcTraits ( ) [virtual]

Destroy this instance of the class.

Definition at line 65 of file FadcTraits.cc.

                        {
}
FadcTraits::FadcTraits ( ) [protected]

Creates an instance of this class.

Definition at line 62 of file FadcTraits.cc.

                       {
}
DybDaq::FadcTraits::FadcTraits ( FadcTraits rhs) [private]

Suppress default.


Member Function Documentation

const FadcTraits & FadcTraits::defaultTraits ( ) [static]

Returns a default FadcTraits to bootstrap the system.

Definition at line 68 of file FadcTraits.cc.

                                            {
    if (0 == m_allTraits.size()) {
        m_allTraits.insert(std::pair<const char*, FadcTraits*>(FadcTraits_v1_2::key(),new FadcTraits_v1_2()));
        m_allTraits.insert(std::pair<const char*, FadcTraits*>(FadcTraits_v1_5::key(),new FadcTraits_v1_5()));
        m_allTraits.insert(std::pair<const char*, FadcTraits*>(FadcTraits_v2_0::key(),new FadcTraits_v2_0()));
    }
    return *m_allTraits[FadcTraits_v2_0::key()];
}
const FadcTraits * FadcTraits::readTraits ( const char *&  buffer) [static]

Returns the FadcTraits to use given the supplied buffer.

Definition at line 77 of file FadcTraits.cc.

                                                            {
    unsigned int major = 0;
    const unsigned int minor = readUnsignedInt(buffer,
                                             defaultTraits(),
                                             FadcTraits::kMinorVersion);
    
    const FadcTraits* result = 0;
    if (0U == major && 0U == minor) {
        result = m_allTraits[FadcTraits_v1_2::key()];
    } else if (0U == major && 1U == minor) {
            result = m_allTraits[FadcTraits_v1_5::key()];
    } else if (0U == major && 2U == minor) {
            result = m_allTraits[FadcTraits_v2_0::key()];
    }
    return result;
}
unsigned int FadcTraits::illegalMarker ( ) const [virtual]

Returns the index value for an illegal header.

Implements DybDaq::DaqTraits.

Definition at line 94 of file FadcTraits.cc.

                                             {
    return 0xffffffffU;
}
unsigned int FadcTraits::illegalField ( ) const [virtual]

Returns the index value for an illegal field.

Implements DybDaq::DaqTraits.

Definition at line 98 of file FadcTraits.cc.

                                            {
    return 0xffffffffU;
}
virtual unsigned int DybDaq::FadcTraits::triggerTypeEnd ( ) const [pure virtual]

Returns the maximum trigger type.

Implemented in DybDaq::FadcTraits_v1_2, DybDaq::FadcTraits_v1_5, and DybDaq::FadcTraits_v2_0.

const char * FadcTraits::triggerTypeAsString ( unsigned int  triggerType) const [virtual]

Returns the string for the specified trigger type.

Definition at line 102 of file FadcTraits.cc.

                                                                          {
    if (triggerType >= triggerTypeEnd()) {
        return "Unknown";
    }
    return triggerTypeStrings()[triggerType];
}
virtual unsigned int DybDaq::FadcTraits::headSize ( ) const [pure virtual]

Returns the size of a FadcHead in this format.

Implemented in DybDaq::FadcTraits_v1_2, DybDaq::FadcTraits_v1_5, and DybDaq::FadcTraits_v2_0.

virtual unsigned int DybDaq::FadcTraits::dataSize ( ) const [pure virtual]

Returns the size of a FADC data in this format.

Implemented in DybDaq::FadcTraits_v1_2, DybDaq::FadcTraits_v1_5, and DybDaq::FadcTraits_v2_0.

virtual unsigned int DybDaq::FadcTraits::footSize ( ) const [pure virtual]

Returns the size of a FadcFoot in this format.

Implemented in DybDaq::FadcTraits_v1_2, DybDaq::FadcTraits_v1_5, and DybDaq::FadcTraits_v2_0.

virtual void DybDaq::FadcTraits::initializeHead ( char *  buffer) const [pure virtual]

Initializes the FadcHead memory with the appropriate markers.

Implemented in DybDaq::FadcTraits_v1_2, DybDaq::FadcTraits_v1_5, and DybDaq::FadcTraits_v2_0.

virtual void DybDaq::FadcTraits::initializeData ( char *  buffer) const [pure virtual]

Initializes the FadcData memory with the appropriate markers.

Implemented in DybDaq::FadcTraits_v1_2, DybDaq::FadcTraits_v1_5, and DybDaq::FadcTraits_v2_0.

virtual void DybDaq::FadcTraits::initializeFoot ( char *  buffer) const [pure virtual]

Initializes the FadcFoot memory with the appropriate markers.

Implemented in DybDaq::FadcTraits_v1_2, DybDaq::FadcTraits_v1_5, and DybDaq::FadcTraits_v2_0.

virtual const char** DybDaq::FadcTraits::triggerTypeStrings ( ) const [protected, pure virtual]

Returns the array of trigger type strings.

Implemented in DybDaq::FadcTraits_v1_2, DybDaq::FadcTraits_v1_5, and DybDaq::FadcTraits_v2_0.

FadcTraits& DybDaq::FadcTraits::operator= ( FadcTraits rhs) [private]

Suppress default.


Member Data Documentation

const unsigned int FadcTraits::kHead = 0 [static]

The head component for this format.

Definition at line 24 of file FadcTraits.h.

const unsigned int FadcTraits::kData = FadcTraits::kHead + 1 [static]

The data component for this format.

Definition at line 29 of file FadcTraits.h.

const unsigned int FadcTraits::kFoot = FadcTraits::kData + 1 [static]

The foot component for this format.

Definition at line 34 of file FadcTraits.h.

const unsigned int FadcTraits::kHeadTriggerNumber = 0 [static]

The field for the trigger number in the head.

Definition at line 39 of file FadcTraits.h.

const unsigned int FadcTraits::kMajorVersion = FadcTraits::kHeadTriggerNumber + 1 [static]

The field for the major version.

Definition at line 46 of file FadcTraits.h.

const unsigned int FadcTraits::kMinorVersion = FadcTraits::kMajorVersion + 1 [static]

The field for the minor version.

Definition at line 51 of file FadcTraits.h.

const unsigned int FadcTraits::kTriggerType = FadcTraits::kMinorVersion + 1 [static]

The field for the trigger type.

Definition at line 56 of file FadcTraits.h.

const unsigned int FadcTraits::kNoData = FadcTraits::kTriggerType + 1 [static]

The field for when there is no data.

Definition at line 61 of file FadcTraits.h.

const unsigned int FadcTraits::kHeadMarker = FadcTraits::kFootDataLength + 1 [static]

The field for the head marker.

Definition at line 68 of file FadcTraits.h.

const unsigned int FadcTraits::kAdcDataMarker = FadcTraits::kHeadMarker + 1 [static]

The field for the ADC data marker.

Definition at line 73 of file FadcTraits.h.

const unsigned int FadcTraits::kFootMarker = FadcTraits::kAdcDataMarker + 1 [static]

The field for the foot marker.

Definition at line 78 of file FadcTraits.h.

const unsigned int FadcTraits::kProtectionStatus = FadcTraits::kFootMarker + 1 [static]

The field for when there is no data.

Definition at line 85 of file FadcTraits.h.

const unsigned int FadcTraits::kScaleEnabled = FadcTraits::kProtectionStatus + 1 [static]

The field for when there is no data.

Definition at line 90 of file FadcTraits.h.

const unsigned int FadcTraits::kDuringPrevious = FadcTraits::kScaleEnabled + 1 [static]

The field for when there is no data.

Definition at line 95 of file FadcTraits.h.

const unsigned int FadcTraits::kChannelId = FadcTraits::kNoData + 1 [static]

The field for the channel id for the data.

Definition at line 102 of file FadcTraits.h.

const unsigned int FadcTraits::kHighDataByte = FadcTraits::kChannelId + 1 [static]

The field for the high data byte.

Definition at line 107 of file FadcTraits.h.

const unsigned int FadcTraits::kMiddleDataByte = FadcTraits::kHighDataByte + 1 [static]

The field for the middle data byte.

Definition at line 112 of file FadcTraits.h.

const unsigned int FadcTraits::kLowDataByte = FadcTraits::kMiddleDataByte + 1 [static]

The field for the low data byte.

Definition at line 117 of file FadcTraits.h.

The field for the channel header marker.

Definition at line 124 of file FadcTraits.h.

The field for the channel header check bytes.

Definition at line 129 of file FadcTraits.h.

The field for the channel trailer marker.

Definition at line 134 of file FadcTraits.h.

The field for the channel trailer check bytes.

Definition at line 139 of file FadcTraits.h.

const unsigned int FadcTraits::kSample1 = FadcTraits::kChannelFootCheck + 1 [static]

The field for the sample 1.

Definition at line 144 of file FadcTraits.h.

const unsigned int FadcTraits::kSample2 = FadcTraits::kSample1 + 1 [static]

The field for the sample 2.

Definition at line 149 of file FadcTraits.h.

const unsigned int FadcTraits::kSample3 = FadcTraits::kSample2 + 1 [static]

The field for the sample 3.

Definition at line 154 of file FadcTraits.h.

const unsigned int FadcTraits::kSample4 = FadcTraits::kSample3 + 1 [static]

The field for the sample 4.

Definition at line 159 of file FadcTraits.h.

const unsigned int FadcTraits::kFootTriggerNumber = FadcTraits::kLowDataByte + 1 [static]

The field for the trigger number in the foot.

Definition at line 166 of file FadcTraits.h.

The field for the trigger type.

Definition at line 171 of file FadcTraits.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:52:59 for FadcReadoutFormat by doxygen 1.7.4