jmespath.cpp
C++ implementation of JMESPath, a query language for JSON http://jmespath.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Public Attributes | List of all members
jmespath::interpreter::ContextValueVisitorAdaptor< VisitorT, ForceMove > Class Template Reference

The ContextValueVisitorAdaptor class adapts a visitor object, which is callable with const lvalue reference of Json and with rvalue reference of Json objects, to ContextValue objects. More...

#include <contextvaluevisitoradaptor.h>

Inheritance diagram for jmespath::interpreter::ContextValueVisitorAdaptor< VisitorT, ForceMove >:

Public Member Functions

 ContextValueVisitorAdaptor (VisitorT &&visitor)
 Constructs a ContextValueVisitorAdaptor object, adapting the visitor object to be able to consume ContextValue objects. More...
 

Public Attributes

 m_visitor
 

Detailed Description

template<typename VisitorT, bool ForceMove = false>
class jmespath::interpreter::ContextValueVisitorAdaptor< VisitorT, ForceMove >

The ContextValueVisitorAdaptor class adapts a visitor object, which is callable with const lvalue reference of Json and with rvalue reference of Json objects, to ContextValue objects.

Constructor & Destructor Documentation

template<typename VisitorT , bool ForceMove = false>
jmespath::interpreter::ContextValueVisitorAdaptor< VisitorT, ForceMove >::ContextValueVisitorAdaptor ( VisitorT &&  visitor)
inline

Constructs a ContextValueVisitorAdaptor object, adapting the visitor object to be able to consume ContextValue objects.

Parameters
[in]visitorA visitor which is callable with const lvalue reference of Json and with rvalue reference of Json objects.

Member Data Documentation

template<typename VisitorT , bool ForceMove = false>
jmespath::interpreter::ContextValueVisitorAdaptor< VisitorT, ForceMove >::m_visitor
Initial value:
{std::move(visitor)}
{
}
template <typename T>
std::enable_if_t<std::is_same<T, JsonRef>::value && ForceMove, void>
operator()(const T& value)
{
m_visitor(Json(value.get()));
}
template <typename T>
std::enable_if_t<std::is_same<T, JsonRef>::value && !ForceMove, void>
operator()(const T& value)
{
m_visitor(value.get());
}
void operator()(Json& value)
{
m_visitor(std::move(value));
}
private:
VisitorT m_visitor

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