mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +01:00
6a5387ec21
* add visitor pattern implementation for Poco::Dynamic::Var * add changes to Makefile and vcxproj for VarVisitor * resolve review comments Poco::Dynamic::Var --------- Co-authored-by: Alexander B <bas524@ya.ru>
33 lines
537 B
C++
33 lines
537 B
C++
//
|
|
// VarVisitor.cpp
|
|
//
|
|
// Library: Foundation
|
|
// Package: Dynamic
|
|
// Module: VarVisitor
|
|
//
|
|
//
|
|
// Copyright (c) 2023, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
#include "Poco/Dynamic/VarVisitor.h"
|
|
|
|
namespace Poco {
|
|
namespace Dynamic {
|
|
|
|
bool Visitor::visit(const Var &x) const
|
|
{
|
|
bool wasHandled = false;
|
|
auto it = _handlers.find(x.type());
|
|
if (it != _handlers.end())
|
|
{
|
|
it->second(x);
|
|
wasHandled = true;
|
|
}
|
|
return wasHandled;
|
|
}
|
|
|
|
} } // namespace Poco::Dynamic
|