Changeset 372 for cpp/frams/param


Ignore:
Timestamp:
04/22/15 04:14:59 (9 years ago)
Author:
sz
Message:

Renamed some classes and functions to make their purpose more obvious:

All MessageHandlers? must now be given the explicit "Enable" argument if you want them to automatically become active. This makes side effects clearly visible.

Location:
cpp/frams/param
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/param/multiparamload.cpp

    r348 r372  
    55#include "multiparamload.h"
    66#include <frams/util/sstringutils.h>
    7 #include "common/framsg.h"
     7#include "common/hmessage.h"
    88#include <ctype.h>
    99
     
    107107        else if (status==BeforeUnknown)
    108108                {
    109                 FMprintf("MultiParamLoader","go",FMLV_WARN,"Skipping object '%s'",lastunknown.c_str());
     109                Hprintf("MultiParamLoader","go",HMLV_WARN,"Skipping object '%s'",lastunknown.c_str());
    110110                loadObjectNow(&emptyparam,false);
    111111                continue;
     
    137137                                {
    138138                                const char* thisfilename=file->VgetPath();
    139                                 FMprintf("MultiParamLoader","go",FMLV_WARN,"invalid \"%s\"%s%s",buf.c_str(),
     139                                Hprintf("MultiParamLoader","go",HMLV_WARN,"invalid \"%s\"%s%s",buf.c_str(),
    140140                                         (thisfilename?" in ":""),(thisfilename?thisfilename:""));
    141141                                }
     
    204204if (alreadyIncluded(newfilename.c_str()))
    205205        {
    206         FMprintf("MultiParamLoader","include",FMLV_WARN,"circular reference ignored (\"%s\")",
     206        Hprintf("MultiParamLoader","include",HMLV_WARN,"circular reference ignored (\"%s\")",
    207207                    filename.c_str());
    208208        return;
     
    212212if (!f)
    213213        {
    214         FMprintf("MultiParamLoader","include",FMLV_WARN,"\"%s\" not found",newfilename.c_str());
     214        Hprintf("MultiParamLoader","include",HMLV_WARN,"\"%s\" not found",newfilename.c_str());
    215215        }
    216216else
  • cpp/frams/param/param.cpp

    r366 r372  
    88#include "param.h"
    99#include <frams/util/extvalue.h>
    10 #include "common/framsg.h"
     10#include "common/hmessage.h"
    1111#include <frams/util/sstringutils.h>
    1212
     
    445445                {
    446446                        SString name(p0, p_len);
    447                         FMprintf("ParamInterface", "load", FMLV_WARN, "Ignored unknown property '%s' while reading object '%s'", name.c_str(), getName());
     447                        Hprintf("ParamInterface", "load", HMLV_WARN, "Ignored unknown property '%s' while reading object '%s'", name.c_str(), getName());
    448448                }
    449449
     
    518518        case 'o':       ret.setObject(getObject(i)); break;
    519519        case 'x':       ret = getExtValue(i); break;
    520         default: FMprintf("ParamInterface", "get", FMLV_ERROR, "'%s.%s' is not a field", getName(), id(i));
     520        default: Hprintf("ParamInterface", "get", HMLV_ERROR, "'%s.%s' is not a field", getName(), id(i));
    521521        }
    522522}
     
    562562                        if (v.type == TObj)
    563563                        {
    564                                 FMprintf("ParamInterface", "set", FMLV_WARN, "Getting integer value from object reference (%s)", v.getString().c_str());
     564                                Hprintf("ParamInterface", "set", HMLV_WARN, "Getting integer value from object reference (%s)", v.getString().c_str());
    565565                                return 0;
    566566                        }
     
    574574                        if (v.type == TObj)
    575575                        {
    576                                 FMprintf("ParamInterface", "set", FMLV_WARN, "Getting floating point value from object reference (%s)", v.getString().c_str());
     576                                Hprintf("ParamInterface", "set", HMLV_WARN, "Getting floating point value from object reference (%s)", v.getString().c_str());
    577577                                return 0;
    578578                        }
     
    583583        case 'o': return setObject(i, v.getObject());
    584584        case 'x': return setExtValue(i, v);
    585         default: FMprintf("ParamInterface", "set", FMLV_ERROR, "'%s.%s' is not a field", getName(), id(i));
     585        default: Hprintf("ParamInterface", "set", HMLV_ERROR, "'%s.%s' is not a field", getName(), id(i));
    586586        }
    587587        return 0;
     
    605605                        if ((after == NULL) || (*after))
    606606                        {
    607                                 FMprintf("ParamInterface", "set", FMLV_WARN, "serialization format mismatch in %s.%s", (getName() ? getName() : "<Unknown>"), id(i));
     607                                Hprintf("ParamInterface", "set", HMLV_WARN, "serialization format mismatch in %s.%s", (getName() ? getName() : "<Unknown>"), id(i));
    608608                                e.setEmpty();
    609609                        }
     
    690690        }
    691691        if (err!=NULL)
    692                 FMprintf("SimpleAbstractParam","sanityCheck", FMLV_ERROR,
     692                Hprintf("SimpleAbstractParam","sanityCheck", HMLV_ERROR,
    693693                "Invalid ParamEntry for %s.%s (%s)", getName(), pe->id, err);
    694694}       
     
    961961        else
    962962        {
    963                 FMprintf("SimpleAbstractParam", "call", FMLV_ERROR,
     963                Hprintf("SimpleAbstractParam", "call", HMLV_ERROR,
    964964                        (*pe->type != 'p') ? "'%s.%s' is not a function" : "Internal error - undefined function pointer for '%s.%s'", getName(), pe->id);
    965965                ret->setInvalid();
     
    10601060                        {
    10611061                                SString name(t, (int)(equals_sign - t));
    1062                                 FMprintf("Param", "load2", FMLV_WARN, "Unknown property '%s' while reading object '%s' (ignored)", name.c_str(), getName());
     1062                                Hprintf("Param", "load2", HMLV_WARN, "Unknown property '%s' while reading object '%s' (ignored)", name.c_str(), getName());
    10631063                        }
    10641064                        t = equals_sign + 1; // t=value
     
    10701070#endif
    10711071                        {
    1072                         FMprintf("Param", "load2", FMLV_WARN, "Missing property name in '%s' (assuming '%s')",
     1072                        Hprintf("Param", "load2", HMLV_WARN, "Missing property name in '%s' (assuming '%s')",
    10731073                                getName(), id(i) ? id(i) : "unknown property?");
    10741074                        }
     
    10921092                        fields_loaded++;
    10931093                        if (ret&(PSET_HITMAX | PSET_HITMIN))
    1094                                 FMprintf("Param", "load2", FMLV_WARN, "Adjusted '%s' in '%s' (was too %s)",
     1094                                Hprintf("Param", "load2", HMLV_WARN, "Adjusted '%s' in '%s' (was too %s)",
    10951095                                id(i), getName(), (ret&PSET_HITMAX) ? "big" : "small");
    10961096                        *(char*)valstop = remember;
  • cpp/frams/param/param.h

    r348 r372  
    1212#include <frams/util/statrick.h>
    1313#include <frams/virtfile/virtfile.h>
    14 #include <common/framsg.h>
     14#include <common/hmessage.h>
    1515
    1616class ExtValue;
     
    273273                        SString svaluetoset = SString::valueOf(valuetoset); //converts any type to SString
    274274                        SString actual = get(i);
    275                         FMprintf("Param", "set", FMLV_WARN, "Setting '%s.%s = %s' exceeded allowed range (too %s). Adjusted to %s.",
     275                        Hprintf("Param", "set", HMLV_WARN, "Setting '%s.%s = %s' exceeded allowed range (too %s). Adjusted to %s.",
    276276                                getName(), id(i), svaluetoset.c_str(), (setflags&PSET_HITMAX) ? "big" : "small", actual.c_str());
    277277                }
Note: See TracChangeset for help on using the changeset viewer.