Add Lua Bindings for const shared_ptr lists (295dbd8e1e)

This commit is contained in:
Robin Gareus 2023-04-12 20:47:02 +02:00
parent 89c7159bc5
commit dbc3008163
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 38 additions and 0 deletions

View file

@ -2029,6 +2029,19 @@ public:
//----------------------------------------------------------------------------
template <class T>
Class<std::shared_ptr<const std::list<T> > > beginPtrConstStdList (char const* name)
{
typedef std::list<T> const LT;
typedef typename LT::size_type T_SIZE;
return beginClass<std::shared_ptr<LT> > (name)
.addPtrFunction ("empty", (bool (LT::*)()const)&LT::empty)
.addPtrFunction ("size", (T_SIZE (LT::*)()const)&LT::size)
.addPtrFunction ("reverse", (void (LT::*)())&LT::reverse)
.addExtCFunction ("iter", &CFunc::ptrListIter<T, LT>)
.addExtCFunction ("table", &CFunc::ptrListToTable<T, LT>);
}
template <class T>
Class<std::shared_ptr<std::list<T> > > beginPtrStdList (char const* name)
{
@ -2053,6 +2066,21 @@ public:
.addExtCFunction ("table", &CFunc::ptrListToTable<T, LT>);
}
template <class T>
Class<std::shared_ptr<const std::vector<T> > > beginPtrConstStdVector (char const* name)
{
typedef std::vector<T> const LT;
typedef typename std::vector<T>::reference T_REF;
typedef typename std::vector<T>::size_type T_SIZE;
return beginClass<std::shared_ptr<LT> > (name)
.addPtrFunction ("empty", (bool (LT::*)()const)&LT::empty)
.addPtrFunction ("size", (T_SIZE (LT::*)()const)&LT::size)
.addPtrFunction ("at", (T_REF (LT::*)(T_SIZE))&LT::at)
.addExtCFunction ("iter", &CFunc::ptrListIter<T, LT>)
.addExtCFunction ("table", &CFunc::ptrListToTable<T, LT>);
}
template <class T>
Class<std::shared_ptr<std::vector<T> > > beginPtrStdVector (char const* name)
{