diff options
author | Josh Blum | 2013-05-07 21:41:33 -0700 |
---|---|---|
committer | Josh Blum | 2013-05-07 21:41:33 -0700 |
commit | ea7e8426db723968d91855af28a7c8b7a3482774 (patch) | |
tree | 522aeb33958c41a58ea57a24fe85c6c3f7b59d1a /include | |
parent | 60a154123f4452d3699e25a245c145eed896f1d3 (diff) | |
download | sandhi-ea7e8426db723968d91855af28a7c8b7a3482774.tar.gz sandhi-ea7e8426db723968d91855af28a7c8b7a3482774.tar.bz2 sandhi-ea7e8426db723968d91855af28a7c8b7a3482774.zip |
gras: create common gras/exception.i header
fix other misc swig warnings
Diffstat (limited to 'include')
-rw-r--r-- | include/gras/CMakeLists.txt | 1 | ||||
-rw-r--r-- | include/gras/buffer_queue.hpp | 2 | ||||
-rw-r--r-- | include/gras/element.i | 14 | ||||
-rw-r--r-- | include/gras/exception.i | 18 | ||||
-rw-r--r-- | include/gras/tags.i | 5 |
5 files changed, 27 insertions, 13 deletions
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<BufferQueue> 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,23 +13,11 @@ namespace gras } //////////////////////////////////////////////////////////////////////// -// remove base class warning +// remove base class warning -- boost::shared_ptr<ElementImpl> //////////////////////////////////////////////////////////////////////// #pragma SWIG nowarn=401 //////////////////////////////////////////////////////////////////////// -// http://www.swig.org/Doc2.0/Library.html#Library_stl_exceptions -//////////////////////////////////////////////////////////////////////// -%include <exception.i> - -%exception -{ - try{$action} - catch (const std::exception& e) - {SWIG_exception(SWIG_RuntimeError, e.what());} -} - -//////////////////////////////////////////////////////////////////////// // Export swig element comprehension //////////////////////////////////////////////////////////////////////// %include <std_string.i> 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.i> + +%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 <gras/tags.hpp> %} +//////////////////////////////////////////////////////////////////////// +// remove base class warning -- boost::less_than_comparable<Tag> +//////////////////////////////////////////////////////////////////////// +#pragma SWIG nowarn=401 + %include <gras/gras.hpp> %include <gras/tags.hpp> %import <gras/sbuffer.i> |