$darkmode
lua_types.cpp File Reference
#include <cloe/utility/lua_types.hpp>
#include <Eigen/Dense>
#include <cloe/component/object.hpp>
Include dependency graph for lua_types.cpp:

Classes

struct  sol::is_automagical< Eigen::Vector2d >
 
struct  sol::is_automagical< Eigen::Vector3d >
 
struct  sol::is_automagical< Eigen::Vector4d >
 
struct  cloe::utility::MatrixTypeTraitsDetail< T >
 
struct  cloe::utility::MatrixTypeTraitsDetail< Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >
 
struct  cloe::utility::MatrixCtors< T, Rows, Cols >
 
struct  cloe::utility::MatrixCtors< T, 2, 1 >
 Derives the SOL constructors-type from the given typename T. More...
 
struct  cloe::utility::MatrixCtors< T, 3, 1 >
 Derives the SOL constructors-type from the given typename T. More...
 
struct  cloe::utility::MatrixCtors< T, 4, 1 >
 Derives the SOL constructors-type from the given typename T. More...
 
struct  cloe::utility::MatrixTypeTraits< T >
 
struct  cloe::utility::MatrixAccessor< Row, Col >
 
struct  cloe::utility::MatrixAccessor< Row, 0 >
 

Functions

void cloe::utility::traverse_namespace_impl (sol::state_view view, const std::vector< const char * > &ns, std::function< void(sol::table &)> table_fn)
 Traverses the global namespace-prefix as well as the given namespace. More...
 
template<typename T >
void cloe::utility::traverse_namespace (DataBroker &db, const std::vector< const char * > &ns, std::function< void(sol::table &)> table_fn)
 Traverses the given namespace as a preparation for the registration of a type. More...
 
template<typename T , typename CtorType >
sol::usertype< T > cloe::utility::register_usertype (DataBroker &db, const std::vector< const char * > &ns, const char *type_name)
 Registers a class under a given namespace. More...
 
template<typename T , typename... Args>
void cloe::utility::register_enum (DataBroker &db, const std::vector< const char * > &ns, const char *type_name, Args &&... args)
 Registers an enum under a given namespace. More...
 
template<typename T , std::size_t... ints>
void cloe::utility::register_vector (DataBroker &db, const std::vector< const char * > &ns, const char *type_name, const char *member_names[], std::index_sequence< ints... >)
 Registers a vector-type under a given namespace. More...
 
template<typename T >
void cloe::utility::register_vector (DataBroker &db, const std::vector< const char * > &ns, const char *class_name, const char *member_names[])
 
void cloe::utility::register_gaspedal_sensor (DataBroker &db, const std::string &vehicle, std::function< const double &()> gaspedal_getter)
 
void cloe::utility::register_wheel_sensor (DataBroker &db, const std::string &vehicle, const std::string &wheel_name, std::function< const ::cloe::Wheel &()> wheel_getter)
 
void cloe::utility::register_lua_types (cloe::DataBroker &db)
 

Variables

const char * cloe::utility::vector_names_xyzw [] = {"x", "y", "z", "w"}
 
const char * cloe::utility::vector_names_r_phi [] = {"r", "phi", "", ""}
 
const char * cloe::utility::vector_names_r_theta_phi [] = {"r", "theta", "phi", ""}
 
const char * cloe::utility::vector_names_rho_eta_phi [] = {"rho", "eta", "phi", ""}
 
const std::vector cloe::utility::namespace_eigen = {"eigen"}
 
const std::array cloe::utility::namespace_prefix = {"cloe", "types"}
 
std::vector cloe::utility::namespace_cloe_object = {"cloe", "Object"}
 

Detailed Description

Function Documentation

◆ register_enum()

template<typename T , typename... Args>
void cloe::utility::register_enum ( DataBroker db,
const std::vector< const char * > &  ns,
const char *  type_name,
Args &&...  args 
)

Registers an enum under a given namespace.

Template Parameters
TType of the enum to be registered
ArgsTypes of parameter 'args'
Parameters
dbInstance of the DataBroker
nsstd::vector of ASCIIZ strings describing the namespace of the enum-type
type_nameASCIIZ string describing the name of the enum to be registered
argsPairs of ASCIIZ-String of one enum-value & the enum-value itself
Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_usertype()

template<typename T , typename CtorType >
sol::usertype<T> cloe::utility::register_usertype ( DataBroker db,
const std::vector< const char * > &  ns,
const char *  type_name 
)

Registers a class under a given namespace.

Template Parameters
TType of the class to be registered
Typeof the SOL constructor-class
ns_sizeSize of the namespace array
Parameters
dbInstance of the DataBroker
nsArray of ASCIIZ strings describing the namespace of the enum-type
type_nameASCIIZ string describing the name of the class to be registered
Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_vector()

template<typename T , std::size_t... ints>
void cloe::utility::register_vector ( DataBroker db,
const std::vector< const char * > &  ns,
const char *  type_name,
const char *  member_names[],
std::index_sequence< ints... >   
)

Registers a vector-type under a given namespace.

Template Parameters
TVector-type to be registered
ns_sizeSize of the namespace array
intsIndex-sequence into the parameter member_names
Parameters
nsArray of ASCIIZ strings describing the namespace of the type
type_nameASCIIZ string describing the name of the class to be registered
member_namesASCIIZ string array describing the names of the vector properties

◆ traverse_namespace()

template<typename T >
void cloe::utility::traverse_namespace ( DataBroker db,
const std::vector< const char * > &  ns,
std::function< void(sol::table &)>  table_fn 
)

Traverses the given namespace as a preparation for the registration of a type.

Template Parameters
TType of the class/enum to be registered
ns_sizeSize of the namespace array
Parameters
dbInstance of the DataBroker
nsArray of ASCIIZ strings describing the namespace of the enum-type
table_fnCallback accepting a SOL-table which reflects the given namespace
Here is the call graph for this function:
Here is the caller graph for this function:

◆ traverse_namespace_impl()

void cloe::utility::traverse_namespace_impl ( sol::state_view  view,
const std::vector< const char * > &  ns,
std::function< void(sol::table &)>  table_fn 
)

Traverses the global namespace-prefix as well as the given namespace.

Parameters
viewLua state_view
ns_iterIterator pointing to the beginning of the namspace-array
ns_endIterator pointing to the end of the namspace-array
table_fnCallback accepting a SOL-table which reflects the given namespace
Here is the call graph for this function:
Here is the caller graph for this function: