Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/sched/EvGetUpd.cpp
Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 1998-2005 George Tzanetakis <gtzan@cs.uvic.ca>
00003 **
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 **
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 */
00018 
00019 #include <marsyas/sched/EvGetUpd.h>
00020 #include <marsyas/system/MarSystem.h>
00021 
00022 using std::ostringstream;
00023 using namespace Marsyas;
00024 
00025 EvGetUpd::EvGetUpd(MarSystem* src, mrs_string scname, MarSystem* tgt, mrs_string tcname) : EvEvent("EvGetUpd","GetUpd")
00026 {
00027   setEvent(src,scname,tgt,tcname);
00028 }
00029 
00030 EvGetUpd::EvGetUpd(EvGetUpd& e) : EvEvent("EvGetUpd","GetUpd")
00031 {
00032   setEvent(e.source_,e.src_cname_,e.target_,e.tgt_cname_);
00033 }
00034 EvGetUpd::~EvGetUpd() { }
00035 
00036 void
00037 EvGetUpd::setEvent(MarSystem* src, mrs_string scname, MarSystem* tgt, mrs_string tcname)
00038 {
00039   src_cname_=scname;
00040   tgt_cname_=tcname;
00041   source_=src;
00042   target_=tgt;
00043 }
00044 
00045 void
00046 EvGetUpd::dispatch()
00047 {
00048   if (target_!=NULL && source_!=NULL) {
00049     target_->updControl(tgt_cname_,source_->getctrl(src_cname_));
00050   }
00051 }
00052 
00053 EvGetUpd*
00054 EvGetUpd::clone()
00055 {
00056   return new EvGetUpd(*this);
00057 }
00058 
00059 /* these have been moved to the header file
00060 mrs_string EvGetUpd::getSrcCName() const { return tgt_cname_; }
00061 mrs_string EvGetUpd::getTgtCName() const { return src_cname_; }
00062 MarSystem* EvGetUpd::getSource() const { return source_; }
00063 MarSystem* EvGetUpd::getTarget() const { return target_; }
00064 
00065 void EvGetUpd::setSrcCName(mrs_string cname) { src_cname_=cname; }
00066 void EvGetUpd::setTgtCName(mrs_string cname) { tgt_cname_=cname; }
00067 void EvGetUpd::setSource(MarSystem* ms) { source_=ms; }
00068 void EvGetUpd::setTarget(MarSystem* ms) { target_=ms; }
00069 */
00070 
00071 /*
00072 ostream& Marsyas::operator<< (ostream& o, EvValUpd& e) {
00073 //    sys.put(o);
00074     o << "EvValUpd<" << e.getCName() << "," << e.getValue() << ">";
00075     return o;
00076 }
00077 */