Changeset 15628 for trunk


Ignore:
Timestamp:
05/17/13 11:40:30 (11 years ago)
Author:
tbretz
Message:
Changed argument for writing event data and tail to const
Location:
trunk/FACT++/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DataCalib.cc

    r15011 r15628  
    175175}
    176176
    177 bool DataCalib::WriteEvt(EVENT *e)
     177bool DataCalib::WriteEvt(const EVENT *e)
    178178{
    179179    // FIXME: SET StartPix to 0 if StartPix is -1
     
    269269}
    270270*/
    271 bool DataCalib::Close(RUN_TAIL *tail)
     271bool DataCalib::Close(const RUN_TAIL *tail)
    272272{
    273273    if (fNumEntries==0)
  • trunk/FACT++/src/DataCalib.h

    r15023 r15628  
    3838
    3939    bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
    40     bool WriteEvt(EVENT *e);
    41     bool Close(RUN_TAIL * = 0);
     40    bool WriteEvt(const EVENT *e);
     41    bool Close(const RUN_TAIL * = 0);
    4242
    4343    //static void Apply(int16_t *val, const int16_t *start, uint32_t roi);
  • trunk/FACT++/src/DataProcessorImp.cc

    r14700 r15628  
    6666}
    6767
    68 bool DataDump::WriteEvt(EVENT *e)
     68bool DataDump::WriteEvt(const EVENT *e)
    6969{
    7070    const Time now;
     
    8181}
    8282
    83 bool DataDump::Close(RUN_TAIL *)
     83bool DataDump::Close(const RUN_TAIL *)
    8484{
    8585    ostringstream str;
     
    9393// =======================================================================
    9494
    95 bool DataDebug::WriteEvt(EVENT *e)
     95bool DataDebug::WriteEvt(const EVENT *e)
    9696{
    9797    cout << "WRITE_EVENT #" << GetRunId() << " (" << e->EventNum << ")" << endl;
  • trunk/FACT++/src/DataProcessorImp.h

    r14700 r15628  
    3737
    3838    virtual bool Open(const RUN_HEAD* h, const FAD::RunDescription &desc) = 0;
    39     virtual bool WriteEvt(EVENT *) = 0;
    40     virtual bool Close(RUN_TAIL * = 0) = 0;
     39    virtual bool WriteEvt(const EVENT *) = 0;
     40    virtual bool Close(const RUN_TAIL * = 0) = 0;
    4141
    4242    const std::string &GetFileName() const { return fFileName; }
     
    6262
    6363    bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
    64     bool WriteEvt(EVENT *e);
    65     bool Close(RUN_TAIL * = 0);
     64    bool WriteEvt(const EVENT *e);
     65    bool Close(const RUN_TAIL * = 0);
    6666};
    6767
     
    7171    DataDebug(const std::string &path, uint64_t night, uint32_t id, MessageImp &imp) : DataDump(path, night, id, imp) { }
    7272
    73     bool WriteEvt(EVENT *e);
     73    bool WriteEvt(const EVENT *e);
    7474};
    7575
  • trunk/FACT++/src/DataWriteFits.cc

    r12806 r15628  
    198198//! @param e the pointer to the EVENT
    199199//
    200 bool DataWriteFits::WriteEvt(EVENT *e)
     200bool DataWriteFits::WriteEvt(const EVENT *e)
    201201{
    202202    if (!fFile.AddRow())
     
    227227    const size_t sz = sizeof(EVENT) + sizeof(e->StartPix)*e->Roi+sizeof(e->StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi
    228228
    229     const vector<char> data = fConv->ToFits(reinterpret_cast<char*>(e)+4, sz-4);
     229    const vector<char> data = fConv->ToFits(reinterpret_cast<const char*>(e)+4, sz-4);
    230230
    231231    return fFile.WriteData(data.data(), data.size());
    232232}
    233233
    234 bool DataWriteFits::WriteFooter(RUN_TAIL */*rt*/)
     234bool DataWriteFits::WriteFooter(const RUN_TAIL */*rt*/)
    235235{
    236236    try
     
    288288//! @param rt the pointer to the RUN_TAIL data structure
    289289//
    290 bool DataWriteFits::Close(RUN_TAIL *rt)
     290bool DataWriteFits::Close(const RUN_TAIL *rt)
    291291{
    292292    if (!fFile.IsOpen())
  • trunk/FACT++/src/DataWriteFits.h

    r14700 r15628  
    2323        void WriteKey(const string &name, const int idx, const T &value, const string &comment);
    2424
    25     bool WriteFooter(RUN_TAIL *rt);
     25    bool WriteFooter(const RUN_TAIL *rt);
    2626
    2727    virtual int GetDrsStep() const { return -1; }
     
    3636
    3737    bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
    38     bool WriteEvt(EVENT *e);
    39     bool Close(RUN_TAIL *rt = 0);
     38    bool WriteEvt(const EVENT *e);
     39    bool Close(const RUN_TAIL *rt = 0);
    4040};
    4141
  • trunk/FACT++/src/DataWriteFits2.cc

    r14550 r15628  
    209209//! @param e the pointer to the EVENT
    210210//
    211 bool DataWriteFits2::WriteEvt(EVENT *e)
     211bool DataWriteFits2::WriteEvt(const EVENT *e)
    212212{
    213213    if (e->TriggerType && !(e->TriggerType & FAD::EventHeader::kAll))
     
    237237    try
    238238    {
    239         fFile.WriteRow(reinterpret_cast<char*>(e)+4, sz-4);
     239        fFile.WriteRow(reinterpret_cast<const char*>(e)+4, sz-4);
    240240    }
    241241    catch (const exception &ex)
     
    256256}
    257257
    258 void DataWriteFits2::WriteFooter(RUN_TAIL */*rt*/)
     258void DataWriteFits2::WriteFooter(const RUN_TAIL */*rt*/)
    259259{
    260260    //FIXME shouldn't we convert start and stop time to MjD first ?
     
    292292//! @param rt the pointer to the RUN_TAIL data structure
    293293//
    294 bool DataWriteFits2::Close(RUN_TAIL *rt)
     294bool DataWriteFits2::Close(const RUN_TAIL *rt)
    295295{
    296296    if (!fFile.is_open())
  • trunk/FACT++/src/DataWriteFits2.h

    r15010 r15628  
    1717
    1818    void WriteHeader(const RUN_HEAD* h, const FAD::RunDescription &d);
    19     void WriteFooter(RUN_TAIL *rt);
     19    void WriteFooter(const RUN_TAIL *rt);
    2020
    2121    virtual int GetDrsStep() const { return -1; }
     
    2828
    2929    bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
    30     bool WriteEvt(EVENT *e);
    31     bool Close(RUN_TAIL *rt = 0);
     30    bool WriteEvt(const EVENT *e);
     31    bool Close(const RUN_TAIL *rt = 0);
    3232
    3333    Time GetTstart() const { return Time(fTstart[0], fTstart[1]); }
  • trunk/FACT++/src/DataWriteRaw.cc

    r15464 r15628  
    7979}
    8080
    81 bool DataWriteRaw::WriteEvt(EVENT *evt)
     81bool DataWriteRaw::WriteEvt(const EVENT *evt)
    8282{
    8383    const int sh = sizeof(EVENT)-2 + NPIX*evt->Roi*2;
    8484
    8585    WriteBlockHeader(kEvent, 1, fCounter++, sh);
    86     fOut.write(reinterpret_cast<char*>(evt)+2, sh);
     86    fOut.write(reinterpret_cast<const char*>(evt)+2, sh);
    8787    return true;
    8888}
    8989
    90 bool DataWriteRaw::Close(RUN_TAIL *tail)
     90bool DataWriteRaw::Close(const RUN_TAIL *tail)
    9191{
    9292    WriteBlockHeader(kEndOfFile, 0, 0, 0);
     
    9797
    9898        WriteValue(uint32_t(1));
    99         fOut.write(reinterpret_cast<char*>(tail), sizeof(RUN_TAIL));
     99        fOut.write(reinterpret_cast<const char*>(tail), sizeof(RUN_TAIL));
    100100    }
    101101
  • trunk/FACT++/src/DataWriteRaw.h

    r14700 r15628  
    8282
    8383    bool Open(const RUN_HEAD *h, const FAD::RunDescription &d);
    84     bool WriteEvt(EVENT *evt);
    85     bool Close(RUN_TAIL *tail= 0);
     84    bool WriteEvt(const EVENT *evt);
     85    bool Close(const RUN_TAIL *tail= 0);
    8686};
    8787
Note: See TracChangeset for help on using the changeset viewer.