Changeset 1177 for trunk/MagicSoft


Ignore:
Timestamp:
01/14/02 18:03:45 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc

    r1176 r1177  
    4848ClassImp(MWriteAsciiFile);
    4949
     50// --------------------------------------------------------------------------
     51//
     52// Init. Replaces the same code used in all constructors.
     53//
    5054void MWriteAsciiFile::Init(const char *filename, const char *name, const char *title)
    5155{
     
    110114// --------------------------------------------------------------------------
    111115//
    112 // Check if our container is ready for writing. If so write it.
     116// Check if the containers are ready for writing. If so write them.
     117// The containers are written in one line, one after each other.
     118// If not all containers are written (because of the IsReadyToSave-flag)
     119// a warning message is print.
    113120//
    114121void MWriteAsciiFile::CheckAndWrite() const
     
    117124
    118125    MParContainer *cont = NULL;
     126
     127    const Int_t num = fContainer.GetSize();
    119128
    120129    TIter Next(&fContainer);
     
    128137        *fOut << " ";
    129138        written = kTRUE;
     139
     140        num--;
    130141    }
    131142
    132143    if (written)
    133144        *fOut << endl;
     145
     146    if (num!=0)
     147        *fOut << warn << "Warning - given number of containers doesn't fit number of written containers." << endl;
    134148}
    135149
     
    145159// --------------------------------------------------------------------------
    146160//
    147 // If the container is yet unknown and the name of it is known only, try
    148 // to get the container from the parameter list.
     161// Tries to get all containers from the ParList which were given by name
     162// adds them to the list of pointers to the container which should be
     163// written to the ascii file.
    149164//
    150165Bool_t MWriteAsciiFile::GetContainer(MParList *pList)
     
    180195// --------------------------------------------------------------------------
    181196//
     197// Add another container (by name) to be written to the ascii file.
     198// The container will be output one after each other in one line.
    182199//
    183200void MWriteAsciiFile::AddContainer(const char *cname)
     
    189206// --------------------------------------------------------------------------
    190207//
     208// Add another container (by pointer) to be written to the ascii file.
     209// The container will be output one after each other in one line.
    191210//
    192211void MWriteAsciiFile::AddContainer(MParContainer *cont)
Note: See TracChangeset for help on using the changeset viewer.