static void set( value &v, DocumentInsertRequest const &d ) { v.set( "docid", d.docid ); v.set( "attributes", d.attributes ); v.set( "metadata", d.metadata ); v.set( "forward", d.forward ); v.set( "search", d.search ); }
static void set( value &v, DocumentGetAnswer const &a ) { v.set( "docno", a.docno ); v.set( "attributes", a.attributes ); v.set( "metadata", a.metadata ); v.set( "forward", a.forward ); v.set( "search", a.search ); }
void ValueObjectStreamOut::toValue(value &v) { int offset = (int)&data[0]; int len = data.size(); value::global("Module").call<void>("unrealize", v, offset, len, value::null() ); if (count) v.set("handles", handleArray); }
static void set( value &v, StorageCreateParameters const &p ) { v.set( "database", p.database ); v.set( "compression", p.compression ); v.set( "cache_size", p.cache_size ); v.set( "max_open_files", p.max_open_files ); v.set( "write_buffer_size", p.write_buffer_size ); v.set( "block_size", p.block_size ); v.set( "metadata", p.metadata ); }
void nme_native_resource_dispose(value inValue) { if (inValue.isNull() || inValue.isUndefined()) return; if (inValue["ptr"].isNull() || inValue["ptr"].isUndefined()) return; Object *ptr = (Object *)inValue["ptr"].as<int>(); if (ptr) { ptr->DecRef(); } inValue.set("ptr",value::null()); }
static void set( value &v, std::pair<std::string, strus::NumericVariant> const &p ) { v.set( "key", p.first ); switch( p.second.type ) { case strus::NumericVariant::Null: v.set( "value", cppcms::json::null( ) ); break; case strus::NumericVariant::Int: v.set( "value", p.second.toint( ) ); break; case strus::NumericVariant::UInt: v.set( "value", p.second.touint( ) ); break; case strus::NumericVariant::Float: v.set( "value", p.second.tofloat( ) ); break; default: throw bad_value_cast( ); } }
static void set( value &v, FunctionParameter const &p ) { switch( p.type ) { case FUNCTION_TYPE_FEATURE: v.set( "type", "feature" ); break; case FUNCTION_TYPE_ATTRIBUTE: v.set( "type", "attribute" ); break; case FUNCTION_TYPE_METADATA: v.set( "type", "metadata" ); break; case FUNCTION_TYPE_NUMERIC: v.set( "type", "numeric" ); break; case FUNCTION_TYPE_STRING: v.set( "type", "string" ); break; default: throw bad_value_cast( ); } v.set( "name", p.name ); v.set( "description", p.description ); }
static void set( value &v, boost::tuple<std::string, std::string, strus::Index> const &t ) { v.set( "type", boost::get<0>( t ) ); v.set( "value", boost::get<1>( t ) ); v.set( "pos", boost::get<2>( t ) ); }
static void set( value &v, DocumentGetRequest const &d ) { v.set( "docid", d.docid ); }
static void set( value &v, PostingJoinOperatorConfiguration const &c ) { v.set( "name", c.name ); v.set( "description", c.description ); }
static void set( value &v, SummarizerFunctionConfiguration const &c ) { v.set( "name", c.name ); v.set( "description", c.description ); v.set( "parameter", c.parameter ); }
static void set( value &v, ServiceConfiguration const &c ) { v.set( "weighting_functions", c.weighting_functions ); v.set( "summarizer_functions", c.summarizer_functions ); v.set( "posting_join_operators", c.posting_join_operators ); }
static void set( value &v, StorageStatistics const &s ) { v.set( "nof_docs", s.nof_docs ); }
static void set( value &v, StorageConfiguration const &c ) { v.set( "metadata", c.metadata ); v.set( "attributes", c.attributes ); v.set( "types", c.types ); }
static void set( value &v, MetadataDefiniton const &m ) { v.set( "name", m.name ); v.set( "type", m.type ); }