diff --git a/tools/src/librtcltools/RtclGet.ipp b/tools/src/librtcltools/RtclGet.ipp index 09a6776c..a50018a4 100644 --- a/tools/src/librtcltools/RtclGet.ipp +++ b/tools/src/librtcltools/RtclGet.ipp @@ -1,6 +1,6 @@ -// $Id: RtclGet.ipp 488 2013-02-16 18:49:47Z mueller $ +// $Id: RtclGet.ipp 854 2017-02-25 14:46:03Z mueller $ // -// Copyright 2013- by Walter F.J. Mueller +// Copyright 2013-2017 by Walter F.J. Mueller // // This program is free software; you may redistribute and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -13,12 +13,13 @@ // // Revision History: // Date Rev Version Comment +// 2017-02-20 854 1.1 add Rtime // 2013-02-12 487 1.0 Initial version // --------------------------------------------------------------------------- /*! \file - \version $Id: RtclGet.ipp 488 2013-02-16 18:49:47Z mueller $ + \version $Id: RtclGet.ipp 854 2017-02-25 14:46:03Z mueller $ \brief Implemenation (inline) of class RtclGet. */ @@ -27,6 +28,8 @@ \brief FIXME_docs */ +#include "librtools/Rtime.hpp" + // all method definitions in namespace Retro namespace Retro { @@ -185,5 +188,26 @@ inline Tcl_Obj* RtclGet::operator()() const return Tcl_NewStringObj((char*) val.data(), val.length()); } +//------------------------------------------+----------------------------------- +//! FIXME_docs + +template <> +inline Tcl_Obj* RtclGet::operator()() const +{ + Rtime val = fGet(); + return Tcl_NewDoubleObj(double(val)); +} + +//------------------------------------------+----------------------------------- +//! FIXME_docs + +template <> +inline Tcl_Obj* RtclGet::operator()() const +{ + Rtime val = fGet(); + return Tcl_NewDoubleObj(double(val)); +} + + } // end namespace Retro diff --git a/tools/src/librtcltools/RtclSet.ipp b/tools/src/librtcltools/RtclSet.ipp index 74f46d48..e511dfce 100644 --- a/tools/src/librtcltools/RtclSet.ipp +++ b/tools/src/librtcltools/RtclSet.ipp @@ -1,6 +1,6 @@ -// $Id: RtclSet.ipp 488 2013-02-16 18:49:47Z mueller $ +// $Id: RtclSet.ipp 854 2017-02-25 14:46:03Z mueller $ // -// Copyright 2013- by Walter F.J. Mueller +// Copyright 2013-2017 by Walter F.J. Mueller // // This program is free software; you may redistribute and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -13,12 +13,13 @@ // // Revision History: // Date Rev Version Comment +// 2017-02-20 854 1.1 add Rtime // 2013-02-12 487 1.0 Initial version // --------------------------------------------------------------------------- /*! \file - \version $Id: RtclSet.ipp 488 2013-02-16 18:49:47Z mueller $ + \version $Id: RtclSet.ipp 854 2017-02-25 14:46:03Z mueller $ \brief Implemenation (inline) of class RtclSet. */ @@ -30,6 +31,8 @@ #include #include +#include "librtools/Rtime.hpp" + // all method definitions in namespace Retro namespace Retro { @@ -245,6 +248,20 @@ inline void RtclSet::operator()(RtclArgs& args) const return; } +//------------------------------------------+----------------------------------- +//! FIXME_docs + +template <> +inline void RtclSet::operator()(RtclArgs& args) const +{ + double val; + if(Tcl_GetDoubleFromObj(args.Interp(), args.CurrentArg(), &val) != TCL_OK) + throw Rexception("RtclSet<>::oper()", "conversion error"); + + fSet(Rtime(val)); + return; +} + } // end namespace Retro