Add Lua Bindings for const shared_ptr lists (295dbd8e1e
)
This commit is contained in:
parent
89c7159bc5
commit
dbc3008163
@ -2123,11 +2123,21 @@ LuaBindings::common (lua_State* L)
|
||||
.beginConstStdVector <std::shared_ptr<VCA> > ("VCAVector")
|
||||
.endClass ()
|
||||
|
||||
// std::shared_ptr<RouteList const>
|
||||
.beginPtrConstStdList <std::shared_ptr<Route> > ("ConstRouteListPtr")
|
||||
.addVoidPtrConstructor<std::list<std::shared_ptr <Route> > const > ()
|
||||
.endClass ()
|
||||
|
||||
// std::shared_ptr<RouteList>
|
||||
.beginPtrStdList <std::shared_ptr<Route> > ("RouteListPtr")
|
||||
.addVoidPtrConstructor<std::list<std::shared_ptr <Route> > > ()
|
||||
.endClass ()
|
||||
|
||||
// std::shared_ptr<BundleList const>
|
||||
.beginPtrConstStdVector <std::shared_ptr<Bundle> > ("ConstBundleListPtr")
|
||||
.addVoidPtrConstructor<std::vector<std::shared_ptr <Bundle> > const > ()
|
||||
.endClass ()
|
||||
|
||||
// std::shared_ptr<BundleList>
|
||||
.beginPtrStdVector <std::shared_ptr<Bundle> > ("BundleListPtr")
|
||||
.addVoidPtrConstructor<std::vector<std::shared_ptr <Bundle> > > ()
|
||||
|
@ -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)<::empty)
|
||||
.addPtrFunction ("size", (T_SIZE (LT::*)()const)<::size)
|
||||
.addPtrFunction ("reverse", (void (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)<::empty)
|
||||
.addPtrFunction ("size", (T_SIZE (LT::*)()const)<::size)
|
||||
.addPtrFunction ("at", (T_REF (LT::*)(T_SIZE))<::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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user