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

#include <parse_example_json.h>

Public Member Functions

 Context ()
 
void init (vw *pall)
 
std::stringstream & error ()
 
void SetStartStateToDecisionService (DecisionServiceInteraction *data)
 
void PushNamespace (const char *ns, BaseState< audit > *return_state)
 
BaseState< audit > * PopNamespace ()
 
Namespace< audit > & CurrentNamespace ()
 
bool TransitionState (BaseState< audit > *next_state)
 

Public Attributes

vwall
 
const char * key
 
rapidjson::SizeType key_length
 
BaseState< audit > * current_state
 
BaseState< audit > * previous_state
 
std::vector< Namespace< audit > > namespace_path
 
v_array< example * > * examples
 
exampleex
 
rapidjson::InsituStringStream * stream
 
const char * stream_end
 
VW::example_factory_t example_factory
 
void * example_factory_context
 
DefaultState< audit > default_state
 
LabelState< audit > label_state
 
LabelObjectState< audit > label_object_state
 
LabelSinglePropertyState< audit > label_single_property_state
 
LabelIndexState< audit > label_index_state
 
TextState< audit > text_state
 
TagState< audit > tag_state
 
MultiState< audit > multi_state
 
IgnoreState< audit > ignore_state
 
ArrayState< audit > array_state
 
SlotsState< audit > slots_state
 
DecisionServiceState< audit > decision_service_state
 
ArrayToVectorState< audit, float > array_float_state
 
ArrayToVectorState< audit, unsigned > array_uint_state
 
StringToStringState< audit > string_state
 
FloatToFloatState< audit > float_state
 
BoolToBoolState< audit > bool_state
 
CCBOutcomeList< audit > ccb_outcome_list_state
 
BaseState< audit > * root_state
 

Private Attributes

std::unique_ptr< std::stringstream > error_ptr
 

Detailed Description

template<bool audit>
struct Context< audit >

Definition at line 51 of file parse_example_json.h.

Constructor & Destructor Documentation

◆ Context()

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

Definition at line 1212 of file parse_example_json.h.

1213  {
1216  }
BaseState< audit > * root_state
DefaultState< audit > default_state
BaseState< audit > * current_state

Member Function Documentation

◆ CurrentNamespace()

template<bool audit>
Namespace<audit>& Context< audit >::CurrentNamespace ( )
inline

◆ error()

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

◆ init()

template<bool audit>
void Context< audit >::init ( vw pall)
inline

Definition at line 1218 of file parse_example_json.h.

References LabelObjectState< audit >::init().

Referenced by VWReaderHandler< audit >::init().

1219  {
1220  all = pall;
1221  key = " ";
1222  key_length = 1;
1223  previous_state = nullptr;
1224  label_object_state.init(pall);
1225  }
LabelObjectState< audit > label_object_state
const char * key
rapidjson::SizeType key_length
BaseState< audit > * previous_state

◆ PopNamespace()

template<bool audit>
BaseState<audit>* Context< audit >::PopNamespace ( )
inline

Definition at line 1255 of file parse_example_json.h.

References v_array< T >::begin(), v_array< T >::end(), recall_tree_ns::find(), example_predict::indices, and v_array< T >::push_back().

Referenced by ArrayState< audit >::EndArray(), DefaultState< audit >::EndObject(), and SlotsState< audit >::StartArray().

1256  {
1257  auto& ns = CurrentNamespace();
1258  if (ns.feature_count > 0)
1259  {
1260  auto feature_group = ns.feature_group;
1261  // Do not insert feature_group if it already exists.
1262  if (std::find(ex->indices.begin(), ex->indices.end(), feature_group) == ex->indices.end())
1263  {
1264  ex->indices.push_back(feature_group);
1265  }
1266  }
1267 
1268  auto return_state = namespace_path.back().return_state;
1269  namespace_path.pop_back();
1270  return return_state;
1271  }
v_array< namespace_index > indices
std::vector< Namespace< audit > > namespace_path
example * ex
T *& begin()
Definition: v_array.h:42
Namespace< audit > & CurrentNamespace()
void push_back(const T &new_ele)
Definition: v_array.h:107
T *& end()
Definition: v_array.h:43
node_pred * find(recall_tree &b, uint32_t cn, example &ec)
Definition: recall_tree.cc:126

◆ PushNamespace()

template<bool audit>
void Context< audit >::PushNamespace ( const char *  ns,
BaseState< audit > *  return_state 
)
inline

Definition at line 1241 of file parse_example_json.h.

References Namespace< audit >::feature_count, Namespace< audit >::feature_group, example_predict::feature_space, Namespace< audit >::ftrs, VW::hash_space(), Namespace< audit >::name, Namespace< audit >::namespace_hash, and Namespace< audit >::return_state.

Referenced by SlotsState< audit >::EndArray(), ArrayState< audit >::StartArray(), MultiState< audit >::StartObject(), SlotsState< audit >::StartObject(), ArrayState< audit >::StartObject(), DefaultState< audit >::StartObject(), and CCBOutcomeList< audit >::StartObject().

1242  {
1243  Namespace<audit> n;
1244  n.feature_group = ns[0];
1245  n.namespace_hash = VW::hash_space(*all, ns);
1246  n.ftrs = ex->feature_space.data() + ns[0];
1247  n.feature_count = 0;
1248  n.return_state = return_state;
1249 
1250  n.name = ns;
1251 
1252  namespace_path.push_back(n);
1253  }
std::vector< Namespace< audit > > namespace_path
features * ftrs
example * ex
size_t feature_count
feature_index namespace_hash
std::array< features, NUM_NAMESPACES > feature_space
BaseState< audit > * return_state
uint64_t hash_space(vw &all, const std::string &s)
Definition: vw.h:138
const char * name

◆ SetStartStateToDecisionService()

template<bool audit>
void Context< audit >::SetStartStateToDecisionService ( DecisionServiceInteraction data)
inline

Definition at line 1235 of file parse_example_json.h.

References DecisionServiceState< audit >::data.

1236  {
1237  decision_service_state.data = data;
1239  }
BaseState< audit > * root_state
DecisionServiceState< audit > decision_service_state
BaseState< audit > * current_state

◆ TransitionState()

template<bool audit>
bool Context< audit >::TransitionState ( BaseState< audit > *  next_state)
inline

Member Data Documentation

◆ all

template<bool audit>
vw* Context< audit >::all

◆ array_float_state

template<bool audit>
ArrayToVectorState<audit, float> Context< audit >::array_float_state

◆ array_state

template<bool audit>
ArrayState<audit> Context< audit >::array_state

Definition at line 1198 of file parse_example_json.h.

Referenced by DefaultState< audit >::StartArray().

◆ array_uint_state

template<bool audit>
ArrayToVectorState<audit, unsigned> Context< audit >::array_uint_state

◆ bool_state

template<bool audit>
BoolToBoolState<audit> Context< audit >::bool_state

Definition at line 1207 of file parse_example_json.h.

Referenced by DecisionServiceState< audit >::Key().

◆ ccb_outcome_list_state

template<bool audit>
CCBOutcomeList<audit> Context< audit >::ccb_outcome_list_state

Definition at line 1208 of file parse_example_json.h.

Referenced by DecisionServiceState< audit >::Key().

◆ current_state

template<bool audit>
BaseState<audit>* Context< audit >::current_state

◆ decision_service_state

template<bool audit>
DecisionServiceState<audit> Context< audit >::decision_service_state

Definition at line 1202 of file parse_example_json.h.

Referenced by CCBOutcomeList< audit >::EndArray().

◆ default_state

template<bool audit>
DefaultState<audit> Context< audit >::default_state

◆ error_ptr

template<bool audit>
std::unique_ptr<std::stringstream> Context< audit >::error_ptr
private

Definition at line 1165 of file parse_example_json.h.

◆ ex

template<bool audit>
example* Context< audit >::ex

◆ example_factory

template<bool audit>
VW::example_factory_t Context< audit >::example_factory

◆ example_factory_context

template<bool audit>
void* Context< audit >::example_factory_context

◆ examples

template<bool audit>
v_array<example*>* Context< audit >::examples

◆ float_state

template<bool audit>
FloatToFloatState<audit> Context< audit >::float_state

Definition at line 1206 of file parse_example_json.h.

Referenced by DecisionServiceState< audit >::Key().

◆ ignore_state

template<bool audit>
IgnoreState<audit> Context< audit >::ignore_state

Definition at line 1197 of file parse_example_json.h.

Referenced by DefaultState< audit >::Ignore().

◆ key

template<bool audit>
const char* Context< audit >::key

◆ key_length

template<bool audit>
rapidjson::SizeType Context< audit >::key_length

◆ label_index_state

template<bool audit>
LabelIndexState<audit> Context< audit >::label_index_state

◆ label_object_state

template<bool audit>
LabelObjectState<audit> Context< audit >::label_object_state

◆ label_single_property_state

template<bool audit>
LabelSinglePropertyState<audit> Context< audit >::label_single_property_state

◆ label_state

template<bool audit>
LabelState<audit> Context< audit >::label_state

◆ multi_state

template<bool audit>
MultiState<audit> Context< audit >::multi_state

Definition at line 1196 of file parse_example_json.h.

Referenced by DefaultState< audit >::Key().

◆ namespace_path

template<bool audit>
std::vector<Namespace<audit> > Context< audit >::namespace_path

◆ previous_state

template<bool audit>
BaseState<audit>* Context< audit >::previous_state

◆ root_state

template<bool audit>
BaseState<audit>* Context< audit >::root_state

◆ slots_state

template<bool audit>
SlotsState<audit> Context< audit >::slots_state

Definition at line 1199 of file parse_example_json.h.

Referenced by DefaultState< audit >::Key().

◆ stream

template<bool audit>
rapidjson::InsituStringStream* Context< audit >::stream

◆ stream_end

template<bool audit>
const char* Context< audit >::stream_end

◆ string_state

template<bool audit>
StringToStringState<audit> Context< audit >::string_state

Definition at line 1205 of file parse_example_json.h.

Referenced by DecisionServiceState< audit >::Key().

◆ tag_state

template<bool audit>
TagState<audit> Context< audit >::tag_state

Definition at line 1195 of file parse_example_json.h.

Referenced by DefaultState< audit >::Key().

◆ text_state

template<bool audit>
TextState<audit> Context< audit >::text_state

Definition at line 1194 of file parse_example_json.h.

Referenced by DefaultState< audit >::Key().


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