JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Public Member Functions | Static Public Attributes | Protected Attributes
joda::query::FlattenProjector Class Reference

#include <FlattenProjector.h>

Inheritance diagram for joda::query::FlattenProjector:
[legend]
Collaboration diagram for joda::query::FlattenProjector:
[legend]

Public Member Functions

 FlattenProjector (const std::string &to, std::unique_ptr< IValueProvider > &&from)
 
void project (const RapidJsonDocument &json, std::vector< std::unique_ptr< RJDocument >> &newDocs, bool view=false) override
 
std::string getType () override
 
std::string toString () override
 
std::vector< std::string > getAttributes () const override
 
- Public Member Functions inherited from joda::query::ISetProjector
 ISetProjector (const std::string &to)
 
virtual ~ISetProjector ()=default
 
virtual std::string getToPointer () const final
 
RJPointer getRawToPointer () const
 

Static Public Attributes

static const std::string type = "FlattenProjector"
 

Protected Attributes

std::unique_ptr< IValueProviderfrom
 
- Protected Attributes inherited from joda::query::ISetProjector
RJPointer ptr
 
std::string ptr_str
 

Additional Inherited Members

- Protected Member Functions inherited from joda::query::ISetProjector
unsigned long multiplicate (std::vector< std::unique_ptr< RJDocument >> &newDocs, int times)
 
void fillArrayRangeWithVal (std::vector< std::unique_ptr< RJDocument >> &newDocs, unsigned long origDocs, int i, RJValue &val)
 

Detailed Description

Transformation flattening an array of values to multiple documents, each containing one of the values

Constructor & Destructor Documentation

◆ FlattenProjector()

joda::query::FlattenProjector::FlattenProjector ( const std::string &  to,
std::unique_ptr< IValueProvider > &&  from 
)

Member Function Documentation

◆ getAttributes()

std::vector< std::string > joda::query::FlattenProjector::getAttributes ( ) const
overridevirtual

Returns a list of attributes used by this projection

Returns

Implements joda::query::ISetProjector.

◆ getType()

std::string joda::query::FlattenProjector::getType ( )
overridevirtual

Returns a string representing the transformation function

Returns

Implements joda::query::ISetProjector.

◆ project()

void joda::query::FlattenProjector::project ( const RapidJsonDocument json,
std::vector< std::unique_ptr< RJDocument >> &  newDocs,
bool  view = false 
)
overridevirtual

Projects a value from a source document into the destination document.

Parameters
jsonthe source document, used to retrieve values from
newDocsthe destination documents, used to store transformed values in

Implements joda::query::ISetProjector.

Here is the call graph for this function:

◆ toString()

std::string joda::query::FlattenProjector::toString ( )
overridevirtual

Returns a string representing the whole transformation as it would be specified in a query

Returns

Reimplemented from joda::query::ISetProjector.

Here is the call graph for this function:

Field Documentation

◆ from

std::unique_ptr<IValueProvider> joda::query::FlattenProjector::from
protected

◆ type

const std::string joda::query::FlattenProjector::type = "FlattenProjector"
static

The documentation for this class was generated from the following files: