From ea7e8426db723968d91855af28a7c8b7a3482774 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 7 May 2013 21:41:33 -0700 Subject: gras: create common gras/exception.i header fix other misc swig warnings --- include/gras/CMakeLists.txt | 1 + include/gras/buffer_queue.hpp | 2 ++ include/gras/element.i | 14 +------------- include/gras/exception.i | 18 ++++++++++++++++++ include/gras/tags.i | 5 +++++ 5 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 include/gras/exception.i (limited to 'include') diff --git a/include/gras/CMakeLists.txt b/include/gras/CMakeLists.txt index 1ab9a4c..7f37b1a 100644 --- a/include/gras/CMakeLists.txt +++ b/include/gras/CMakeLists.txt @@ -3,6 +3,7 @@ ######################################################################## install(FILES + exception.i chrono.hpp block.hpp block.i diff --git a/include/gras/buffer_queue.hpp b/include/gras/buffer_queue.hpp index da8de41..0a68030 100644 --- a/include/gras/buffer_queue.hpp +++ b/include/gras/buffer_queue.hpp @@ -17,6 +17,8 @@ typedef boost::shared_ptr BufferQueueSptr; //! Buffer Queue is an interface enabling us to create custom buffer allocators. struct BufferQueue { + //! virtual destructor + virtual ~BufferQueue(void){} /*! * Create a buffer queue object using the pool allocator. diff --git a/include/gras/element.i b/include/gras/element.i index ecfa898..bcf07c2 100644 --- a/include/gras/element.i +++ b/include/gras/element.i @@ -13,22 +13,10 @@ namespace gras } //////////////////////////////////////////////////////////////////////// -// remove base class warning +// remove base class warning -- boost::shared_ptr //////////////////////////////////////////////////////////////////////// #pragma SWIG nowarn=401 -//////////////////////////////////////////////////////////////////////// -// http://www.swig.org/Doc2.0/Library.html#Library_stl_exceptions -//////////////////////////////////////////////////////////////////////// -%include - -%exception -{ - try{$action} - catch (const std::exception& e) - {SWIG_exception(SWIG_RuntimeError, e.what());} -} - //////////////////////////////////////////////////////////////////////// // Export swig element comprehension //////////////////////////////////////////////////////////////////////// diff --git a/include/gras/exception.i b/include/gras/exception.i new file mode 100644 index 0000000..5ed2cd3 --- /dev/null +++ b/include/gras/exception.i @@ -0,0 +1,18 @@ +// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. + +#ifndef INCLUDED_GRAS_EXCEPTION_I +#define INCLUDED_GRAS_EXCEPTION_I + +//////////////////////////////////////////////////////////////////////// +// http://www.swig.org/Doc2.0/Library.html#Library_stl_exceptions +//////////////////////////////////////////////////////////////////////// +%include + +%exception +{ + try{$action} + catch (const std::exception& e) + {SWIG_exception(SWIG_RuntimeError, e.what());} +} + +#endif /*INCLUDED_GRAS_EXCEPTION_I*/ diff --git a/include/gras/tags.i b/include/gras/tags.i index 33838e2..bf2bdb4 100644 --- a/include/gras/tags.i +++ b/include/gras/tags.i @@ -7,6 +7,11 @@ #include %} +//////////////////////////////////////////////////////////////////////// +// remove base class warning -- boost::less_than_comparable +//////////////////////////////////////////////////////////////////////// +#pragma SWIG nowarn=401 + %include %include %import -- cgit