Qore Programming Language 2.3.0
Loading...
Searching...
No Matches
RuntimeConfig Class Reference

Runtime configuration passed through the evaluation call chain. More...

#include <RuntimeConfig.h>

Friends

RuntimeConfig rc_get_current ()
 Get the current runtime configuration from thread-local storage.
 
RuntimeConfigrc_get_current_ref ()
 Get a reference to the thread-local RuntimeConfig updated with current values.
 
RuntimeConfig rc_get_parse_time ()
 Get a minimal RuntimeConfig for parse-time constant folding.
 
RuntimeConfigrc_get_tls_ref ()
 Get a direct reference to the thread-local RuntimeConfig.
 
void rc_sync_to_thread (const RuntimeConfig &rc)
 Sync runtime config changes back to thread-local storage.
 
class RuntimeConfigClosureHelper
 
class RuntimeConfigElementHelper
 
class RuntimeConfigHelper
 
class RuntimeConfigLocationHelper
 
class RuntimeConfigObjectHelper
 
class RuntimeConfigStackHelper
 

Detailed Description

Runtime configuration passed through the evaluation call chain.

Friends And Related Symbol Documentation

◆ rc_get_current

RuntimeConfig rc_get_current ( )
friend

Get the current runtime configuration from thread-local storage.

This function captures the current runtime context from TLS into a RuntimeConfig struct. It should be called at entry points (like AbstractQoreNode::eval()) and the result passed through the call chain.

Returns
RuntimeConfig populated with current TLS values

◆ rc_get_current_ref

RuntimeConfig & rc_get_current_ref ( )
friend

Get a reference to the thread-local RuntimeConfig updated with current values.

This version avoids stack allocation by using a thread-local RuntimeConfig. Use this in hot paths where stack space is at a premium (e.g., deep recursion).

Warning
The returned reference is only valid until the next call to this function on the same thread. Do not store the reference across calls.
Returns
Reference to thread-local RuntimeConfig with current values

◆ rc_get_parse_time

RuntimeConfig rc_get_parse_time ( )
friend

Get a minimal RuntimeConfig for parse-time constant folding.

This returns a RuntimeConfig with minimal initialization suitable for evaluating constant expressions at parse time. Unlike rc_get_current(), this does not access TLS and can be used safely during parsing.

The returned RuntimeConfig has:

  • pgm set to the current parse program (if available)
  • Other fields set to nullptr or default values
Returns
RuntimeConfig suitable for parse-time evaluation

◆ rc_get_tls_ref

RuntimeConfig & rc_get_tls_ref ( )
friend

Get a direct reference to the thread-local RuntimeConfig.

This returns a reference to the authoritative TLS RuntimeConfig that stores runtime location, statement, and parse options. Use this for direct updates instead of calling separate TLS update functions.

Returns
Reference to the thread-local RuntimeConfig

◆ rc_sync_to_thread

void rc_sync_to_thread ( const RuntimeConfig rc)
friend

Sync runtime config changes back to thread-local storage.

Call this when the RuntimeConfig has been modified and those changes need to be reflected in TLS (e.g., for nested eval calls that don't use RuntimeConfig).

Parameters
rcThe RuntimeConfig to sync to TLS

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