ESyS-Particle  2.3.4
SetPy.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.apache.org/licenses/LICENSE-2.0 //
10 // //
12 
13 #ifndef ESYS_LSMSETPY_H
14 #define ESYS_LSMSETPY_H
15 
16 #include <boost/python.hpp>
17 #include <set>
18 #include <iterator>
19 
20 namespace esys
21 {
22  namespace lsm
23  {
24  template <typename TmplElem, typename TmplCompare=std::less<TmplElem> >
25  class SetPy : public std::set<TmplElem, TmplCompare>
26  {
27  public:
28  typedef std::set<TmplElem, TmplCompare> Inherited;
29 
30  class PickleSuite : public boost::python::pickle_suite
31  {
32  public:
33  static
34  boost::python::tuple
35  getinitargs(SetPy const& s);
36  };
37 
38  SetPy();
39 
40  SetPy(const SetPy &set);
41 
42  SetPy(const Inherited &set);
43 
44  SetPy(boost::python::object &iterable);
45 
46  SetPy getUnion(const SetPy &set) const;
47 
48  SetPy getDifference(const SetPy &set) const;
49 
50  SetPy getIntersection(const SetPy &set) const;
51 
52  static boost::python::class_<SetPy>
53  exportSet(
54  const std::string &pyClassName,
55  const std::string &pyClassDocString
56  );
57 
58  protected:
59  typedef std::insert_iterator<SetPy> InsertIterator;
60  };
61  }
62 }
63 
65 
66 #endif
esys::lsm::SetPy::SetPy
SetPy()
Definition: SetPy.hpp:21
esys::lsm::SetPy::Inherited
std::set< TmplElem, TmplCompare > Inherited
Definition: SetPy.h:28
SetPy.h
esys
Definition: CheckPointable.cpp:17
SetPy.hpp
esys::lsm::SetPy::getIntersection
SetPy getIntersection(const SetPy &set) const
Definition: SetPy.hpp:75
esys::lsm::SetPy::getDifference
SetPy getDifference(const SetPy &set) const
Definition: SetPy.hpp:61
esys::lsm::SetPy::PickleSuite::getinitargs
static boost::python::tuple getinitargs(SetPy const &s)
Definition: SetPy.hpp:90
esys::lsm::SetPy::getUnion
SetPy getUnion(const SetPy &set) const
Definition: SetPy.hpp:47
esys::lsm::SetPy::exportSet
static boost::python::class_< SetPy > exportSet(const std::string &pyClassName, const std::string &pyClassDocString)
Definition: SetPy.hpp:97
esys::lsm::SetPy::PickleSuite
Definition: SetPy.h:31
esys::lsm::SetPy
Definition: SetPy.h:26
esys::lsm::SetPy::InsertIterator
std::insert_iterator< SetPy > InsertIterator
Definition: SetPy.h:59