MQTTSuite
Loading...
Searching...
No Matches
anonymous_namespace{json-validator.cpp}::logical_not Class Reference
Inheritance diagram for anonymous_namespace{json-validator.cpp}::logical_not:
Collaboration diagram for anonymous_namespace{json-validator.cpp}::logical_not:

Public Member Functions

 logical_not (json &sch, root_schema *root, const std::vector< nlohmann::json_uri > &uris)
 logical_not (json &sch, root_schema *root, const std::vector< nlohmann::json_uri > &uris)
Public Member Functions inherited from anonymous_namespace{json-validator.cpp}::schema
virtual ~schema ()=default
 schema (root_schema *root)
void set_default_value (const json &v)
virtual ~schema ()=default
 schema (root_schema *root)
void set_default_value (const json &v)

Private Member Functions

void validate (const json::json_pointer &ptr, const json &instance, json_patch &patch, error_handler &e) const final
const jsondefault_value (const json::json_pointer &ptr, const json &instance, error_handler &e) const override
void validate (const json::json_pointer &ptr, const json &instance, json_patch &patch, error_handler &e) const final
const jsondefault_value (const json::json_pointer &ptr, const json &instance, error_handler &e) const override

Private Attributes

std::shared_ptr< schemasubschema_

Additional Inherited Members

Static Public Member Functions inherited from anonymous_namespace{json-validator.cpp}::schema
static std::shared_ptr< schemamake (json &schema, root_schema *root, const std::vector< std::string > &key, std::vector< nlohmann::json_uri > uris)
static std::shared_ptr< schemamake (json &schema, root_schema *root, const std::vector< std::string > &key, std::vector< nlohmann::json_uri > uris)
Protected Member Functions inherited from anonymous_namespace{json-validator.cpp}::schema
virtual std::shared_ptr< schemamake_for_default_ (std::shared_ptr<::schema > &, root_schema *, std::vector< nlohmann::json_uri > &, nlohmann::json &) const
virtual std::shared_ptr< schemamake_for_default_ (std::shared_ptr<::schema > &, root_schema *, std::vector< nlohmann::json_uri > &, nlohmann::json &) const
Protected Attributes inherited from anonymous_namespace{json-validator.cpp}::schema
root_schemaroot_
json default_value_ = nullptr

Detailed Description

Definition at line 395 of file json-validator.cpp.

Constructor & Destructor Documentation

◆ logical_not() [1/2]

anonymous_namespace{json-validator.cpp}::logical_not::logical_not ( json & sch,
root_schema * root,
const std::vector< nlohmann::json_uri > & uris )
inline

Definition at line 414 of file json-validator.cpp.

417 : schema(root)
418 {
419 subschema_ = schema::make(sch, root, {"not"}, uris);
420 }
static std::shared_ptr< schema > make(json &schema, root_schema *root, const std::vector< std::string > &key, std::vector< nlohmann::json_uri > uris)
auto schema
Definition id-ref.cpp:69

References anonymous_namespace{json-validator.cpp}::schema::make(), anonymous_namespace{json-validator.cpp}::schema::schema(), and subschema_.

Here is the call graph for this function:

◆ logical_not() [2/2]

anonymous_namespace{json-validator.cpp}::logical_not::logical_not ( json & sch,
root_schema * root,
const std::vector< nlohmann::json_uri > & uris )
inline

Definition at line 414 of file json-validator.cpp.

417 : schema(root)
418 {
419 subschema_ = schema::make(sch, root, {"not"}, uris);
420 }

Member Function Documentation

◆ default_value() [1/2]

const json & anonymous_namespace{json-validator.cpp}::logical_not::default_value ( const json::json_pointer & ptr,
const json & instance,
error_handler & e ) const
inlineoverrideprivatevirtual

Reimplemented from anonymous_namespace{json-validator.cpp}::schema.

Definition at line 408 of file json-validator.cpp.

409 {
410 return subschema_->default_value(ptr, instance, e);
411 }
static const auto instance
Definition issue-93.cpp:14

References anonymous_namespace{json-validator.cpp}::schema::default_value(), and subschema_.

Here is the call graph for this function:

◆ default_value() [2/2]

const json & anonymous_namespace{json-validator.cpp}::logical_not::default_value ( const json::json_pointer & ptr,
const json & instance,
error_handler & e ) const
inlineoverrideprivatevirtual

Reimplemented from anonymous_namespace{json-validator.cpp}::schema.

Definition at line 408 of file json-validator.cpp.

409 {
410 return subschema_->default_value(ptr, instance, e);
411 }

◆ validate() [1/2]

void anonymous_namespace{json-validator.cpp}::logical_not::validate ( const json::json_pointer & ptr,
const json & instance,
json_patch & patch,
error_handler & e ) const
inlinefinalprivatevirtual

Implements anonymous_namespace{json-validator.cpp}::schema.

Definition at line 399 of file json-validator.cpp.

400 {
401 first_error_handler esub;
402 subschema_->validate(ptr, instance, patch, esub);
403
404 if (!esub)
405 e.error(ptr, instance, "the subschema has succeeded, but it is required to not validate");
406 }
virtual void error(const json::json_pointer &, const json &, const std::string &)=0

References nlohmann::json_schema::error_handler::error(), subschema_, and anonymous_namespace{json-validator.cpp}::schema::validate().

Here is the call graph for this function:

◆ validate() [2/2]

void anonymous_namespace{json-validator.cpp}::logical_not::validate ( const json::json_pointer & ptr,
const json & instance,
json_patch & patch,
error_handler & e ) const
inlinefinalprivatevirtual

Implements anonymous_namespace{json-validator.cpp}::schema.

Definition at line 399 of file json-validator.cpp.

400 {
401 first_error_handler esub;
402 subschema_->validate(ptr, instance, patch, esub);
403
404 if (!esub)
405 e.error(ptr, instance, "the subschema has succeeded, but it is required to not validate");
406 }

Member Data Documentation

◆ subschema_

std::shared_ptr< schema > anonymous_namespace{json-validator.cpp}::logical_not::subschema_
private

Definition at line 397 of file json-validator.cpp.

Referenced by default_value(), logical_not(), and validate().


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