Loading [MathJax]/extensions/tex2jax.js

Search Results

 #pragma once
 
 #include <memory>
 #include <stdexcept>
 #include <tuple>
 #include <vector>
 
 #include <momemta/any.h>
 #include <lua.hpp>
 
 class ILuaCallback;
 class ParameterSet;
 
 namespace lua {
 
     class invalid_configuration_file: public std::runtime_error {
         using std::runtime_error::runtime_error;
     };
 
     class invalid_array_error: public std::runtime_error {
         using std::runtime_error::runtime_error;
     };
 
     class unsupported_type_error: public std::runtime_error {
         using std::runtime_error::runtime_error;
     };
 
     enum Type {
         NOT_SUPPORTED, 
         BOOLEAN, 
         STRING, 
         INTEGER, 
         REAL, 
         INPUT_TAG, 
         PARAMETER_SET, 
     };
 
     struct Lazy {
         lua_State* L; 
 
         Lazy(lua_State* L);
 
         virtual momemta::any operator() () const = 0;
     };
 
     struct LazyFunction: public Lazy {
         int ref_index; 
 
         virtual momemta::any operator() () const override;
 
         LazyFunction(lua_State* L, int index);
     };
 
     Type type(lua_State* L, int index);
 
     size_t get_index(lua_State* L, int index);
 
     int lua_is_array(lua_State* L, int index);
 
     std::pair<momemta::any, bool> to_any(lua_State* L, int index);
 
     void push_any(lua_State* L, const momemta::any& value);
 
     template<typename T> T special_any_cast(const momemta::any& value) {
         return momemta::any_cast<T>(value);
     }
 
     template<typename T>
     momemta::any to_vectorT(lua_State* L, int index) {
 
         std::vector<T> result;
         size_t absolute_index = get_index(L, index);
 
         if (lua_type(L, absolute_index) != LUA_TTABLE)
             return result;
 
         lua_pushnil(L);
         while (lua_next(L, absolute_index) != 0) {
             momemta::any value;
             bool lazy = false;
             std::tie(value, lazy) = to_any(L, -1);
             result.push_back(special_any_cast<T>(value));
             lua_pop(L, 1);
         }
 
         return momemta::any(result);
     }
 
     momemta::any to_vector(lua_State* L, int index, Type type);
 
     void setup_hooks(lua_State* L, void* ptr);
 
     int module_table_newindex(lua_State* L);
 
     void register_modules(lua_State* L, void* ptr);
 
     int load_modules(lua_State* L);
 
     int parameter(lua_State* L);
 
     std::shared_ptr<lua_State> init_runtime(ILuaCallback* callback);
 
     int generate_cuba_inputtag(lua_State* L);
 
     void inject_parameters(lua_State* L, const ParameterSet& parameters);
 
     namespace debug {
         std::vector<std::string> dump_stack(lua_State* L);
         void print_stack(lua_State* L);
     }
 }
All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Modules Pages