The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ai::lua_object< T > Class Template Reference

#include <lua_object.hpp>

Inheritance diagram for ai::lua_object< T >:
Inheritance graph

Public Member Functions

 lua_object ()
 
 lua_object (const T &init)
 
std::shared_ptr< T > get ()
 
void store (lua_State *L, int n)
 
void push (lua_State *L)
 
- Public Member Functions inherited from ai::lua_object_base
 lua_object_base ()
 
virtual ~lua_object_base ()
 

Protected Member Functions

std::shared_ptr< T > to_type (lua_State *, int)
 
void from_type (lua_State *L, std::shared_ptr< T >)
 
template<>
std::shared_ptr< aspect_attacks_lua_filterto_type (lua_State *L, int n)
 
template<>
std::shared_ptr< double > to_type (lua_State *L, int n)
 
template<>
void from_type (lua_State *L, std::shared_ptr< double > value)
 
template<>
std::shared_ptr< std::string > to_type (lua_State *L, int n)
 
template<>
void from_type (lua_State *L, std::shared_ptr< std::string > value)
 
template<>
std::shared_ptr< bool > to_type (lua_State *L, int n)
 
template<>
void from_type (lua_State *L, std::shared_ptr< bool > value)
 
template<>
std::shared_ptr< int > to_type (lua_State *L, int n)
 
template<>
void from_type (lua_State *L, std::shared_ptr< int > value)
 
template<>
std::shared_ptr< std::vector< std::string > > to_type (lua_State *L, int n)
 
template<>
void from_type (lua_State *L, std::shared_ptr< std::vector< std::string > > value)
 
template<>
std::shared_ptr< configto_type (lua_State *L, int n)
 
template<>
void from_type (lua_State *L, std::shared_ptr< config > value)
 
template<>
std::shared_ptr< terrain_filterto_type (lua_State *L, int n)
 
template<>
void from_type (lua_State *L, std::shared_ptr< terrain_filter > value)
 
template<>
std::shared_ptr< std::vector< target > > to_type (lua_State *L, int n)
 
template<>
std::shared_ptr< unit_advancements_aspectto_type (lua_State *L, int n)
 
template<>
std::shared_ptr< aspect_attacks_lua_filterto_type (lua_State *L, int n)
 

Protected Attributes

std::shared_ptr< T > value_
 

Detailed Description

template<typename T>
class ai::lua_object< T >

Definition at line 52 of file lua_object.hpp.

Constructor & Destructor Documentation

◆ lua_object() [1/2]

template<typename T>
ai::lua_object< T >::lua_object ( )
inline

Definition at line 57 of file lua_object.hpp.

◆ lua_object() [2/2]

template<typename T>
ai::lua_object< T >::lua_object ( const T &  init)
inline

Definition at line 63 of file lua_object.hpp.

Member Function Documentation

◆ from_type() [1/8]

template<typename T>
void ai::lua_object< T >::from_type ( lua_State L,
std::shared_ptr< T >   
)
inlineprotected

Definition at line 93 of file lua_object.hpp.

References lua_error(), and lua_pushliteral.

◆ from_type() [2/8]

template<>
void ai::lua_object< double >::from_type ( lua_State L,
std::shared_ptr< double >  value 
)
inlineprotected

Definition at line 109 of file lua_object.hpp.

References lua_pushnil(), and lua_pushnumber().

◆ from_type() [3/8]

template<>
void ai::lua_object< std::string >::from_type ( lua_State L,
std::shared_ptr< std::string >  value 
)
inlineprotected

Definition at line 122 of file lua_object.hpp.

References lua_pushlstring(), and lua_pushnil().

◆ from_type() [4/8]

template<>
void ai::lua_object< bool >::from_type ( lua_State L,
std::shared_ptr< bool >  value 
)
inlineprotected

Definition at line 135 of file lua_object.hpp.

References lua_pushboolean(), and lua_pushnil().

◆ from_type() [5/8]

template<>
void ai::lua_object< int >::from_type ( lua_State L,
std::shared_ptr< int >  value 
)
inlineprotected

Definition at line 148 of file lua_object.hpp.

References lua_pushnil(), and lua_pushnumber().

◆ from_type() [6/8]

template<>
void ai::lua_object< std::vector< std::string > >::from_type ( lua_State L,
std::shared_ptr< std::vector< std::string > >  value 
)
inlineprotected

◆ from_type() [7/8]

template<>
void ai::lua_object< config >::from_type ( lua_State L,
std::shared_ptr< config value 
)
inlineprotected

Definition at line 192 of file lua_object.hpp.

References lua_pushnil(), and luaW_pushconfig().

◆ from_type() [8/8]

template<>
void ai::lua_object< terrain_filter >::from_type ( lua_State L,
std::shared_ptr< terrain_filter value 
)
inlineprotected

◆ get()

template<typename T>
std::shared_ptr<T> ai::lua_object< T >::get ( )
inline

Definition at line 69 of file lua_object.hpp.

◆ push()

template<typename T>
void ai::lua_object< T >::push ( lua_State L)
inline

Definition at line 79 of file lua_object.hpp.

Referenced by ai::typesafe_aspect< attacks_vector >::get_lua().

◆ store()

template<typename T>
void ai::lua_object< T >::store ( lua_State L,
int  n 
)
inlinevirtual

Implements ai::lua_object_base.

Definition at line 74 of file lua_object.hpp.

References lua_absindex().

◆ to_type() [1/12]

template<>
std::shared_ptr< aspect_attacks_lua_filter > ai::lua_object< aspect_attacks_lua_filter >::to_type ( lua_State L,
int  n 
)
protected

◆ to_type() [2/12]

template<typename T>
std::shared_ptr<T> ai::lua_object< T >::to_type ( lua_State ,
int   
)
inlineprotected

Definition at line 87 of file lua_object.hpp.

Referenced by ai::lua_object< T >::to_type().

◆ to_type() [3/12]

template<>
std::shared_ptr< double > ai::lua_object< double >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 103 of file lua_object.hpp.

References lua_tonumber.

◆ to_type() [4/12]

template<>
std::shared_ptr< std::string > ai::lua_object< std::string >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 116 of file lua_object.hpp.

References lua_tostring.

◆ to_type() [5/12]

template<>
std::shared_ptr< bool > ai::lua_object< bool >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 129 of file lua_object.hpp.

References luaW_toboolean().

◆ to_type() [6/12]

template<>
std::shared_ptr< int > ai::lua_object< int >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 142 of file lua_object.hpp.

References lua_tointeger.

◆ to_type() [7/12]

template<>
std::shared_ptr< std::vector< std::string > > ai::lua_object< std::vector< std::string > >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 155 of file lua_object.hpp.

References i, lua_gettable(), lua_pushinteger(), lua_rawlen(), lua_settop(), lua_tostring, and s.

◆ to_type() [8/12]

template<>
std::shared_ptr< config > ai::lua_object< config >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 184 of file lua_object.hpp.

References luaW_toconfig().

◆ to_type() [9/12]

template<>
std::shared_ptr< terrain_filter > ai::lua_object< terrain_filter >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 199 of file lua_object.hpp.

References resources::filter_con, and luaW_tovconfig().

◆ to_type() [10/12]

template<>
std::shared_ptr< std::vector< target > > ai::lua_object< std::vector< target > >::to_type ( lua_State L,
int  n 
)
inlineprotected

◆ to_type() [11/12]

template<>
std::shared_ptr< unit_advancements_aspect > ai::lua_object< unit_advancements_aspect >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 275 of file lua_object.hpp.

References n, and ai::lua_object< T >::to_type().

◆ to_type() [12/12]

template<>
std::shared_ptr< aspect_attacks_lua_filter > ai::lua_object< aspect_attacks_lua_filter >::to_type ( lua_State L,
int  n 
)
protected

Member Data Documentation

◆ value_

template<typename T>
std::shared_ptr<T> ai::lua_object< T >::value_
protected

Definition at line 99 of file lua_object.hpp.


The documentation for this class was generated from the following file: