Poco::Dynamic

class Visitor

Library: Foundation
Package: Dynamic
Header: Poco/Dynamic/VarVisitor.h

Description

VarVisitor class.

Member Summary

Member Functions: addHandler, visit

Member Functions

addHandler inline

template < typename T > bool addHandler(
    const Details::Handler < T > & f
);

Add handler for specific type T which holds in Var. This method is more safe, because it saves copy of handler : lambda or std::function. Returns true if handler was added.

addHandler inline

template < typename T > bool addHandler(
    Details::HandlerPointer < T > f
);

Add handler for specific type T which holds in Var. This method is less safe, because it saves only copy of function pointer. Returns true if handler was added.

visit

bool visit(
    const Poco::Dynamic::Var & x
) const;

Find handler for held type and if it exists call handler. Returns true if hanlder was found othrewise returns false.