00001 /*************************************************************************** 00002 consumer.cpp - configuration consumer class 00003 00004 ------------------- 00005 begin : Sun 2 Jan 2005 00006 copyright : (C) 2002-2010 by Ewald Arnold 00007 email : mockpp at ewald-arnold dot de 00008 00009 $Id: consumer.cpp 1491 2010-01-02 22:21:45Z ewald-arnold $ 00010 00011 ***************************************************************************/ 00012 00013 #include "interface.h" 00014 #include "consumer.h" 00015 00016 #include <mockpp/mockpp_dbc.h> 00017 00018 Consumer::Consumer(Interface *intf) 00019 : configfile(intf) 00020 { 00021 MOCKPP_PRE(intf != 0); 00022 } 00023 00024 void Consumer::load() 00025 { 00026 configfile->open("file1.lst"); 00027 config1 = configfile->read(); 00028 config2 = configfile->read(); 00029 config3 = configfile->read(); 00030 configfile->close(); 00031 } 00032 00033 void Consumer::process() 00034 { 00035 unsigned x = configfile->calculate(1); 00036 x += configfile->calculate(2); 00037 x =+ configfile->calculate(3); 00038 00039 config1 += "/processed"; 00040 config2 += "/processed"; 00041 config3 += "/processed"; 00042 } 00043 00044 void Consumer::save() 00045 { 00046 configfile->open("file1.lst"); 00047 configfile->write(config1); 00048 configfile->write(config2); 00049 configfile->write(config3); 00050 configfile->close(); 00051 }