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

#include <parse_example_json.h>

Inheritance diagram for LabelState< audit >:
BaseState< audit >

Public Member Functions

 LabelState ()
 
BaseState< audit > * StartObject (Context< audit > &ctx) override
 
BaseState< audit > * String (Context< audit > &ctx, const char *str, rapidjson::SizeType, bool) override
 
BaseState< audit > * Float (Context< audit > &ctx, float v) override
 
BaseState< audit > * Uint (Context< audit > &ctx, unsigned v) override
 
- Public Member Functions inherited from BaseState< audit >
 BaseState (const char *pname)
 
virtual BaseState< audit > * Null (Context< audit > &ctx)
 
virtual BaseState< audit > * Bool (Context< audit > &ctx, bool b)
 
virtual BaseState< audit > * Key (Context< audit > &ctx, const char *str, rapidjson::SizeType len, bool)
 
virtual BaseState< audit > * EndObject (Context< audit > &ctx, rapidjson::SizeType)
 
virtual BaseState< audit > * StartArray (Context< audit > &ctx)
 
virtual BaseState< audit > * EndArray (Context< audit > &ctx, rapidjson::SizeType)
 

Additional Inherited Members

- Public Attributes inherited from BaseState< audit >
const char * name
 

Detailed Description

template<bool audit>
struct LabelState< audit >

Definition at line 346 of file parse_example_json.h.

Constructor & Destructor Documentation

◆ LabelState()

template<bool audit>
LabelState< audit >::LabelState ( )
inline

Definition at line 348 of file parse_example_json.h.

348 : BaseState<audit>("Label") {}

Member Function Documentation

◆ Float()

template<bool audit>
BaseState<audit>* LabelState< audit >::Float ( Context< audit > &  ctx,
float  v 
)
inlineoverridevirtual

Reimplemented from BaseState< audit >.

Definition at line 358 of file parse_example_json.h.

References Context< audit >::ex, example::l, label_data::label, Context< audit >::previous_state, and polylabel::simple.

359  {
360  // TODO: once we introduce label types, check here
361  ctx.ex->l.simple.label = v;
362  return ctx.previous_state;
363  }
example * ex
float label
Definition: simple_label.h:14
label_data simple
Definition: example.h:28
polylabel l
Definition: example.h:57
BaseState< audit > * previous_state

◆ StartObject()

template<bool audit>
BaseState<audit>* LabelState< audit >::StartObject ( Context< audit > &  ctx)
inlineoverridevirtual

Reimplemented from BaseState< audit >.

Definition at line 350 of file parse_example_json.h.

References Context< audit >::label_object_state.

350 { return ctx.label_object_state.StartObject(ctx); }
LabelObjectState< audit > label_object_state

◆ String()

template<bool audit>
BaseState<audit>* LabelState< audit >::String ( Context< audit > &  ctx,
const char *  str,
rapidjson::SizeType  ,
bool   
)
inlineoverridevirtual

Reimplemented from BaseState< audit >.

Definition at line 352 of file parse_example_json.h.

References Context< audit >::all, Context< audit >::ex, VW::parse_example_label(), and Context< audit >::previous_state.

353  {
354  VW::parse_example_label(*ctx.all, *ctx.ex, str);
355  return ctx.previous_state;
356  }
void parse_example_label(vw &all, example &ec, std::string label)
Definition: parser.cc:846
example * ex
BaseState< audit > * previous_state

◆ Uint()

template<bool audit>
BaseState<audit>* LabelState< audit >::Uint ( Context< audit > &  ctx,
unsigned  v 
)
inlineoverridevirtual

Reimplemented from BaseState< audit >.

Definition at line 365 of file parse_example_json.h.

References Context< audit >::ex, example::l, label_data::label, Context< audit >::previous_state, and polylabel::simple.

366  {
367  // TODO: once we introduce label types, check here
368  ctx.ex->l.simple.label = (float)v;
369  return ctx.previous_state;
370  }
example * ex
float label
Definition: simple_label.h:14
label_data simple
Definition: example.h:28
polylabel l
Definition: example.h:57
BaseState< audit > * previous_state

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