Ignore:
Timestamp:
02/04/05 13:31:19 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

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

    r4991 r6253  
    9595TString MFilter::GetRule() const
    9696{
    97     return "<GetRule n/a for " + fName + ">";
     97    return ClassName(); //"<GetRule n/a for " + fName + ">";
    9898}
    9999
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r5994 r6253  
    534534MParContainer *MParContainer::GetNewObject(const char *name, TClass *base) const
    535535{
     536    return base ? GetNewObject(name, base->GetName()) : 0;
     537}
     538
     539// --------------------------------------------------------------------------
     540//
     541// Return a new object of class 'name'. Make sure that the object
     542// derives from the class base.
     543//
     544// In case of failure return NULL
     545//
     546// The caller is responsible of deleting the object!
     547//
     548MParContainer *MParContainer::GetNewObject(const char *name, const char *base) const
     549{
    536550    TClass *cls = GetConstructor(name);
    537551    if (!cls || !base)
     
    540554    if (!cls->InheritsFrom(base))
    541555    {
    542         *fLog << " - Class doesn't inherit from " << base->GetName() << endl;
     556        *fLog << err;
     557        *fLog << dbginf << GetDescriptor() << " - Cannot create new instance of class '" << name << "': ";
     558        *fLog << " - Class " << cls->GetName() << " doesn't inherit from " << base << endl;
    543559        return NULL;
    544560    }
     
    550566    if (!obj)
    551567    {
    552         *fLog << " - Class has no default constructor." << endl;
    553         *fLog << " - An abstract member functions of a base class is not overwritten." << endl;
    554         return NULL;
    555     }
    556 
    557     return (MParContainer*)obj;
    558 }
    559 
    560 // --------------------------------------------------------------------------
    561 //
    562 // Return a new object of class 'name'. Make sure that the object
    563 // derives from the class base.
    564 //
    565 // In case of failure return NULL
    566 //
    567 // The caller is responsible of deleting the object!
    568 //
    569 MParContainer *MParContainer::GetNewObject(const char *name, const char *base) const
    570 {
    571     TClass *cls = GetConstructor(name);
    572     if (!cls || !base)
    573         return NULL;
    574 
    575     if (!cls->InheritsFrom(base))
    576     {
    577         *fLog << " - Class doesn't inherit from " << base << endl;
    578         return NULL;
    579     }
    580 
    581     //
    582     // create the parameter container of the the given class type
    583     //
    584     TObject *obj = (TObject*)cls->New();
    585     if (!obj)
    586     {
    587         *fLog << " - Class has no default constructor." << endl;
     568        *fLog << err;
     569        *fLog << dbginf << GetDescriptor() << " - Cannot create new instance of class '" << name << "': ";
     570        *fLog << " - Class " << cls->GetName() << " has no default constructor." << endl;
    588571        *fLog << " - An abstract member functions of a base class is not overwritten." << endl;
    589572        return NULL;
     
    766749        return kFALSE;
    767750
    768     *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but no " << ClassName() << "::ReadEnv." << endl;
     751    *fLog << warn << "WARNING - " << fName << ": Resource " << prefix << " found, but no " << ClassName() << "::ReadEnv." << endl;
    769752    return kTRUE;
    770753}
Note: See TracChangeset for help on using the changeset viewer.