tclpkg-th.cc

Go to the documentation of this file.
00001 
00003 
00004 //
00005 // Copyright (c) 1999-2004 California Institute of Technology
00006 // Copyright (c) 2004-2007 University of Southern California
00007 // Rob Peters <rjpeters at usc dot edu>
00008 //
00009 // created: Wed Jun  9 20:39:46 1999
00010 // commit: $Id: tclpkg-th.cc 10065 2007-04-12 05:54:56Z rjpeters $
00011 // $HeadURL: file:///lab/rjpeters/svnrepo/code/trunk/groovx/src/visx/tclpkg-th.cc $
00012 //
00013 // --------------------------------------------------------------------
00014 //
00015 // This file is part of GroovX.
00016 //   [http://ilab.usc.edu/rjpeters/groovx/]
00017 //
00018 // GroovX is free software; you can redistribute it and/or modify it
00019 // under the terms of the GNU General Public License as published by
00020 // the Free Software Foundation; either version 2 of the License, or
00021 // (at your option) any later version.
00022 //
00023 // GroovX is distributed in the hope that it will be useful, but
00024 // WITHOUT ANY WARRANTY; without even the implied warranty of
00025 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00026 // General Public License for more details.
00027 //
00028 // You should have received a copy of the GNU General Public License
00029 // along with GroovX; if not, write to the Free Software Foundation,
00030 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00031 //
00033 
00034 #ifndef GROOVX_VISX_TCLPKG_TH_CC_UTC20050628171009_DEFINED
00035 #define GROOVX_VISX_TCLPKG_TH_CC_UTC20050628171009_DEFINED
00036 
00037 #include "visx/tclpkg-th.h"
00038 
00039 #include "nub/objfactory.h"
00040 
00041 #include "tcl/objpkg.h"
00042 #include "tcl/pkg.h"
00043 
00044 #include "visx/timinghandler.h"
00045 #include "visx/timinghdlr.h"
00046 #include "visx/trialevent.h"
00047 
00048 #include "rutz/trace.h"
00049 
00050 namespace
00051 {
00052   unsigned int addNewEvent(nub::ref<TimingHdlr> th, const char* event_type,
00053                            int msec, TimingHdlr::TimePoint time_point)
00054   {
00055     return th->addEventByName(event_type, time_point, msec);
00056   }
00057 }
00058 
00059 extern "C"
00060 int Timinghdlr_Init(Tcl_Interp* interp)
00061 {
00062 GVX_TRACE("Timinghdlr_Init");
00063 
00064   GVX_PKG_CREATE(pkg, interp, "TimingHdlr", "4.$Revision: 10065 $");
00065   tcl::def_creator<TimingHdlr>(pkg);
00066   pkg->inherit_pkg("io");
00067   tcl::def_basic_type_cmds<TimingHdlr>(pkg, SRC_POS);
00068 
00069   pkg->def( "addImmediateEvent", "th_id event_type msec_delay",
00070             rutz::bind_last(&addNewEvent, TimingHdlr::IMMEDIATE),
00071             SRC_POS );
00072   pkg->def( "addStartEvent", "th_id event_type msec_delay",
00073             rutz::bind_last(&addNewEvent, TimingHdlr::FROM_START),
00074             SRC_POS );
00075   pkg->def( "addResponseEvent", "th_id event_type msec_delay",
00076             rutz::bind_last(&addNewEvent, TimingHdlr::FROM_RESPONSE),
00077             SRC_POS );
00078   pkg->def( "addAbortEvent", "th_id event_type msec_delay",
00079             rutz::bind_last(&addNewEvent, TimingHdlr::FROM_ABORT),
00080             SRC_POS );
00081 
00082   pkg->def( "addImmediateEvent", "th_id event_id",
00083             rutz::bind_last(rutz::mem_func(&TimingHdlr::addEvent),
00084                             TimingHdlr::IMMEDIATE),
00085             SRC_POS );
00086   pkg->def( "addStartEvent", "th_id event_id",
00087             rutz::bind_last(rutz::mem_func(&TimingHdlr::addEvent),
00088                             TimingHdlr::FROM_START),
00089             SRC_POS );
00090   pkg->def( "addResponseEvent", "th_id event_id",
00091             rutz::bind_last(rutz::mem_func(&TimingHdlr::addEvent),
00092                             TimingHdlr::FROM_RESPONSE),
00093             SRC_POS );
00094   pkg->def( "addAbortEvent", "th_id event_id",
00095             rutz::bind_last(rutz::mem_func(&TimingHdlr::addEvent),
00096                             TimingHdlr::FROM_ABORT),
00097             SRC_POS );
00098 
00099   pkg->namesp_alias("Th");
00100 
00101   GVX_PKG_RETURN(pkg);
00102 }
00103 
00104 extern "C"
00105 int Timinghandler_Init(Tcl_Interp* interp)
00106 {
00107 GVX_TRACE("Timinghandler_Init");
00108 
00109   GVX_PKG_CREATE(pkg, interp, "TimingHandler", "4.$Revision: 10065 $");
00110   tcl::def_creator<TimingHandler>(pkg);
00111   pkg->inherit_pkg("io");
00112   tcl::def_basic_type_cmds<TimingHandler>(pkg, SRC_POS);
00113 
00114   pkg->def_get_set("abortWait",
00115                    &TimingHandler::getAbortWait,
00116                    &TimingHandler::setAbortWait,
00117                    SRC_POS);
00118   pkg->def_get_set("interTrialInterval",
00119                    &TimingHandler::getInterTrialInterval,
00120                    &TimingHandler::setInterTrialInterval,
00121                    SRC_POS);
00122   pkg->def_get_set("stimDur",
00123                    &TimingHandler::getStimDur,
00124                    &TimingHandler::setStimDur,
00125                    SRC_POS);
00126   pkg->def_get_set("timeout",
00127                    &TimingHandler::getTimeout,
00128                    &TimingHandler::setTimeout,
00129                    SRC_POS);
00130 
00131   pkg->namesp_alias("SimpleTh");
00132 
00133   GVX_PKG_RETURN(pkg);
00134 }
00135 
00136 static const char __attribute__((used)) vcid_groovx_visx_tclpkg_th_cc_utc20050628171009[] = "$Id: tclpkg-th.cc 10065 2007-04-12 05:54:56Z rjpeters $ $HeadURL: file:
00137 #endif // !GROOVX_VISX_TCLPKG_TH_CC_UTC20050628171009_DEFINED

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:49:42 2008 by Doxygen version 1.5.5.