CCF
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions
jsengine.h File Reference
#include "ccf/ds/json.h"
#include "ccf/ds/openapi.h"
#include "ccf/service/map.h"

Go to the source code of this file.

Classes

struct  ccf::JSRuntimeOptions
 
struct  ccf::JSRuntimeOptions::Defaults
 

Namespaces

namespace  ccf
 
namespace  ccf::Tables
 

Macros

#define FOREACH_JSENGINE_FIELD(XX)
 
#define XX(field, field_type)   j[#field] = options.field;
 
#define XX(field, field_type)
 
#define XX(field, field_type)
 

Typedefs

using ccf::JSEngine = ServiceValue< JSRuntimeOptions >
 

Functions

void ccf::to_json (nlohmann::json &j, const JSRuntimeOptions &options)
 
void ccf::from_json (const nlohmann::json &j, JSRuntimeOptions &options)
 
std::string ccf::schema_name (const JSRuntimeOptions *)
 
void ccf::fill_json_schema (nlohmann::json &schema, const JSRuntimeOptions *)
 

Macro Definition Documentation

◆ FOREACH_JSENGINE_FIELD

#define FOREACH_JSENGINE_FIELD (   XX)
Value:
XX(max_heap_bytes, decltype(JSRuntimeOptions::max_heap_bytes)) \
XX(max_stack_bytes, decltype(JSRuntimeOptions::max_stack_bytes)) \
XX(max_execution_time_ms, decltype(JSRuntimeOptions::max_execution_time_ms)) \
XX(log_exception_details, decltype(JSRuntimeOptions::log_exception_details)) \
XX( \
return_exception_details, \
decltype(JSRuntimeOptions::return_exception_details)) \
XX( \
max_cached_interpreters, \
decltype(JSRuntimeOptions::max_cached_interpreters))
#define XX(field, field_type)

◆ XX [1/3]

#define XX (   field,
  field_type 
)    j[#field] = options.field;

◆ XX [2/3]

#define XX (   field,
  field_type 
)
Value:
{ \
const auto it = j.find(#field); \
if (it != j.end()) \
{ \
options.field = it->get<field_type>(); \
} \
}

◆ XX [3/3]

#define XX (   field,
  field_type 
)
Value:
properties[#field] = ccf::ds::openapi::components_ref_object( \
ccf::ds::json::schema_name<field_type>());