Vowpal Wabbit
Public Member Functions | Public Attributes | List of all members
VWReaderHandler< audit > Struct Template Reference

#include <parse_example_json.h>

Inheritance diagram for VWReaderHandler< audit >:

Public Member Functions

void init (vw *all, v_array< example *> *examples, rapidjson::InsituStringStream *stream, const char *stream_end, VW::example_factory_t example_factory, void *example_factory_context)
 
bool Bool (bool v)
 
bool Int (int v)
 
bool Uint (unsigned v)
 
bool Int64 (int64_t v)
 
bool Uint64 (uint64_t v)
 
bool Double (double v)
 
bool String (const char *str, SizeType len, bool copy)
 
bool StartObject ()
 
bool Key (const char *str, SizeType len, bool copy)
 
bool EndObject (SizeType count)
 
bool StartArray ()
 
bool EndArray (SizeType count)
 
bool Null ()
 
bool VWReaderHandlerNull ()
 
bool VWReaderHandlerDefault ()
 
bool RawNumber (const char *, rapidjson::SizeType, bool)
 
std::stringstream & error ()
 
BaseState< audit > * current_state ()
 

Public Attributes

Context< audit > ctx
 

Detailed Description

template<bool audit>
struct VWReaderHandler< audit >

Definition at line 1288 of file parse_example_json.h.

Member Function Documentation

◆ Bool()

template<bool audit>
bool VWReaderHandler< audit >::Bool ( bool  v)
inline

Definition at line 1307 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1307 { return ctx.TransitionState(ctx.current_state->Bool(ctx, v)); }
Context< audit > ctx

◆ current_state()

template<bool audit>
BaseState<audit>* VWReaderHandler< audit >::current_state ( )
inline

Definition at line 1335 of file parse_example_json.h.

References Context< audit >::current_state.

Referenced by VW::read_line_decision_service_json(), and VW::read_line_json().

1335 { return ctx.current_state; }
Context< audit > ctx

◆ Double()

template<bool audit>
bool VWReaderHandler< audit >::Double ( double  v)
inline

Definition at line 1312 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1312 { return ctx.TransitionState(ctx.current_state->Float(ctx, (float)v)); }
Context< audit > ctx

◆ EndArray()

template<bool audit>
bool VWReaderHandler< audit >::EndArray ( SizeType  count)
inline

Definition at line 1324 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1324 { return ctx.TransitionState(ctx.current_state->EndArray(ctx, count)); }
Context< audit > ctx

◆ EndObject()

template<bool audit>
bool VWReaderHandler< audit >::EndObject ( SizeType  count)
inline

Definition at line 1322 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1322 { return ctx.TransitionState(ctx.current_state->EndObject(ctx, count)); }
Context< audit > ctx

◆ error()

template<bool audit>
std::stringstream& VWReaderHandler< audit >::error ( )
inline

Definition at line 1333 of file parse_example_json.h.

References Context< audit >::error().

Referenced by VW::read_line_decision_service_json(), and VW::read_line_json().

1333 { return ctx.error(); }
Context< audit > ctx

◆ init()

template<bool audit>
void VWReaderHandler< audit >::init ( vw all,
v_array< example *> *  examples,
rapidjson::InsituStringStream *  stream,
const char *  stream_end,
VW::example_factory_t  example_factory,
void *  example_factory_context 
)
inline

Definition at line 1292 of file parse_example_json.h.

References label_parser::default_label, Context< audit >::ex, Context< audit >::example_factory, Context< audit >::example_factory_context, Context< audit >::examples, Context< audit >::init(), example::l, parser::lp, vw::p, Context< audit >::stream, and Context< audit >::stream_end.

Referenced by VW::read_line_decision_service_json(), and VW::read_line_json().

1294  {
1295  ctx.init(all);
1296  ctx.examples = examples;
1297  ctx.ex = (*examples)[0];
1298  all->p->lp.default_label(&ctx.ex->l);
1299 
1300  ctx.stream = stream;
1301  ctx.stream_end = stream_end;
1302  ctx.example_factory = example_factory;
1303  ctx.example_factory_context = example_factory_context;
1304  }
void(* default_label)(void *)
Definition: label_parser.h:12
parser * p
Definition: global_data.h:377
Context< audit > ctx
label_parser lp
Definition: parser.h:102

◆ Int()

template<bool audit>
bool VWReaderHandler< audit >::Int ( int  v)
inline

Definition at line 1308 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1308 { return ctx.TransitionState(ctx.current_state->Float(ctx, (float)v)); }
Context< audit > ctx

◆ Int64()

template<bool audit>
bool VWReaderHandler< audit >::Int64 ( int64_t  v)
inline

Definition at line 1310 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1310 { return ctx.TransitionState(ctx.current_state->Float(ctx, (float)v)); }
Context< audit > ctx

◆ Key()

template<bool audit>
bool VWReaderHandler< audit >::Key ( const char *  str,
SizeType  len,
bool  copy 
)
inline

Definition at line 1318 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1319  {
1320  return ctx.TransitionState(ctx.current_state->Key(ctx, str, len, copy));
1321  }
Context< audit > ctx

◆ Null()

template<bool audit>
bool VWReaderHandler< audit >::Null ( )
inline

Definition at line 1325 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1325 { return ctx.TransitionState(ctx.current_state->Null(ctx)); }
Context< audit > ctx

◆ RawNumber()

template<bool audit>
bool VWReaderHandler< audit >::RawNumber ( const char *  ,
rapidjson::SizeType  ,
bool   
)
inline

Definition at line 1331 of file parse_example_json.h.

1331 { return false; }

◆ StartArray()

template<bool audit>
bool VWReaderHandler< audit >::StartArray ( )
inline

Definition at line 1323 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1323 { return ctx.TransitionState(ctx.current_state->StartArray(ctx)); }
Context< audit > ctx

◆ StartObject()

template<bool audit>
bool VWReaderHandler< audit >::StartObject ( )
inline

Definition at line 1317 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1317 { return ctx.TransitionState(ctx.current_state->StartObject(ctx)); }
Context< audit > ctx

◆ String()

template<bool audit>
bool VWReaderHandler< audit >::String ( const char *  str,
SizeType  len,
bool  copy 
)
inline

Definition at line 1313 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1314  {
1315  return ctx.TransitionState(ctx.current_state->String(ctx, str, len, copy));
1316  }
Context< audit > ctx

◆ Uint()

template<bool audit>
bool VWReaderHandler< audit >::Uint ( unsigned  v)
inline

Definition at line 1309 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1309 { return ctx.TransitionState(ctx.current_state->Uint(ctx, v)); }
Context< audit > ctx

◆ Uint64()

template<bool audit>
bool VWReaderHandler< audit >::Uint64 ( uint64_t  v)
inline

Definition at line 1311 of file parse_example_json.h.

References Context< audit >::current_state, and Context< audit >::TransitionState().

1311 { return ctx.TransitionState(ctx.current_state->Float(ctx, (float)v)); }
Context< audit > ctx

◆ VWReaderHandlerDefault()

template<bool audit>
bool VWReaderHandler< audit >::VWReaderHandlerDefault ( )
inline

Definition at line 1328 of file parse_example_json.h.

1328 { return false; }

◆ VWReaderHandlerNull()

template<bool audit>
bool VWReaderHandler< audit >::VWReaderHandlerNull ( )
inline

Definition at line 1327 of file parse_example_json.h.

1327 { return true; }

Member Data Documentation

◆ ctx

template<bool audit>
Context<audit> VWReaderHandler< audit >::ctx

Definition at line 1290 of file parse_example_json.h.

Referenced by VW::read_line_decision_service_json().


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