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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/shapeconvert.cpp

    r348 r372  
    99
    1010#include <frams/model/model.h>
    11 #include <frams/errmgr/stdouterr.h>
     11#include <frams/mhandlers/stdouthandler.h>
    1212#include <frams/genetics/preconfigured.h>
    1313
     
    3434{
    3535        StdioFILE::setStdio();//setup VirtFILE::Vstdin/out/err
    36         StdoutErrorHandler err(ErrorHandlerBase::DontBlock, VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
     36        MessageHandlerToStdout messages_to_stderr(MessageHandlerBase::Enable | MessageHandlerBase::DontBlock, VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
    3737
    3838        PreconfiguredGenetics genetics;
     
    5050                                if ((shape != Part::SHAPE_ELLIPSOID) && (shape != Part::SHAPE_CUBOID) && (shape != Part::SHAPE_CYLINDER))
    5151                                {
    52                                         FMprintf("", "shapeconvert", FMLV_ERROR, "Invalid shape");
     52                                        Hprintf("", "shapeconvert", HMLV_ERROR, "Invalid shape");
    5353                                        return 4;
    5454                                }
     
    7171        if (!m.isValid())
    7272        {
    73                 FMprintf("", "shapeconvert", FMLV_ERROR, "Cannot build Model from the supplied genotype");
     73                Hprintf("", "shapeconvert", HMLV_ERROR, "Cannot build Model from the supplied genotype");
    7474                return 2;
    7575        }
     
    7777        if (m.getShape() != Model::SHAPE_OLD)
    7878        {
    79                 FMprintf("", "shapeconvert", FMLV_ERROR, "Only old style shapes can be converted");
     79                Hprintf("", "shapeconvert", HMLV_ERROR, "Only old style shapes can be converted");
    8080                return 3;
    8181        }
Note: See TracChangeset for help on using the changeset viewer.