MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Lila::Lila Class Reference

#include <Lila.hpp>

+ Collaboration diagram for Lila::Lila:

Public Member Functions

 Lila ()
 Constructs a Lila instance.
 
 ~Lila ()
 Destructor; cleans up interpreter and server resources.
 
bool initialize (OperationMode mode=OperationMode::Direct, int server_port=9090) noexcept
 Initializes the live coding environment.
 
bool eval (const std::string &code)
 Evaluates a C++ code snippet directly.
 
bool eval_file (const std::string &filepath)
 Evaluates a C++ code file directly.
 
void start_server (int port=9090)
 Starts the TCP server for remote live coding.
 
void stop_server ()
 Stops the TCP server and disconnects all clients.
 
bool is_server_running () const
 Checks if the server is currently running.
 
void * get_symbol_address (const std::string &name)
 Gets the address of a symbol defined in the interpreter.
 
std::vector< std::string > get_defined_symbols ()
 Gets a list of all defined symbols.
 
void add_include_path (const std::string &path)
 Adds an include path for code evaluation.
 
void add_compile_flag (const std::string &flag)
 Adds a compile flag for code evaluation.
 
void on_success (std::function< void()> callback)
 Registers a callback for successful code evaluation.
 
void on_error (std::function< void(const std::string &)> callback)
 Registers a callback for code evaluation errors.
 
void on_server_client_connected (std::function< void(const ClientInfo &)> callback)
 Registers a callback for new client connections (server mode)
 
void on_server_client_disconnected (std::function< void(const ClientInfo &)> callback)
 Registers a callback for client disconnections (server mode)
 
void on_server_started (std::function< void()> callback)
 Registers a callback for server start events.
 
std::string get_last_error () const
 Gets the last error message.
 
OperationMode get_current_mode () const
 Gets the current operation mode.
 

Private Member Functions

bool initialize_interpreter ()
 
bool initialize_server (int port)
 
std::expected< std::string, std::string > handle_server_message (std::string_view message)
 

Static Private Member Functions

static std::string escape_json (const std::string &str)
 Escapes a string for safe JSON encoding.
 

Private Attributes

std::unique_ptr< ClangInterpreterm_interpreter
 Embedded Clang interpreter.
 
std::unique_ptr< Serverm_server
 TCP server for live coding.
 
OperationMode m_current_mode
 Current operation mode.
 
std::function< void()> m_success_callback
 Success callback.
 
std::function< void(const std::string &)> m_error_callback
 Error callback.
 

Detailed Description

Definition at line 46 of file Lila.hpp.


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