From: Frank Mori Hess Date: Thu, 13 Nov 2008 14:17:15 +0000 (+0000) Subject: Added C++ wrapper for comedi_get_buffer_contents(). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=83058293b93f0be8fb9a7e055f19512b04d6d3dc;p=comedilib.git Added C++ wrapper for comedi_get_buffer_contents(). --- diff --git a/c++/include/comedilib.hpp b/c++/include/comedilib.hpp index 16eeec9..a999ec4 100644 --- a/c++/include/comedilib.hpp +++ b/c++/include/comedilib.hpp @@ -405,6 +405,19 @@ namespace comedi } return retval; } + unsigned get_buffer_contents() const + { + int retval = comedi_get_buffer_contents(comedi_handle(), index()); + if(retval < 0) + { + std::ostringstream message; + message << __PRETTY_FUNCTION__ << ": comedi_get_buffer_contents() failed."; + std::cerr << message.str() << std::endl; + comedi_perror("comedi_get_buffer_contents"); + throw std::runtime_error(message.str()); + } + return retval; + } void get_clock_source(unsigned *clock, unsigned *period_ns) const { int retval = comedi_get_clock_source(comedi_handle(), index(), clock, period_ns);