blob: 934aac98f9ec262d5486b2da8daa92c80778764e [file] [log] [blame]
Václav Kubernát96344a12018-05-28 16:33:39 +02001/*
2 * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/
3 * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/
4 *
5 * Written by Václav Kubernát <kubervac@fit.cvut.cz>
6 *
7*/
8
Václav Kubernátb61336d2018-05-28 17:35:03 +02009#include <iostream>
Václav Kubernát96344a12018-05-28 16:33:39 +020010#include "interpreter.hpp"
11
Václav Kubernát07204242018-06-04 18:12:09 +020012void Interpreter::operator()(const set_& set) const
13{
Václav Kubernátc3b37df2018-06-06 15:40:20 +020014 std::cout << "Setting " << pathToDataString(set.m_path) << " to " << set.m_data << std::endl;
Václav Kubernát07204242018-06-04 18:12:09 +020015}
16
Václav Kubernát96344a12018-05-28 16:33:39 +020017void Interpreter::operator()(const cd_& cd) const
18{
19 m_parser.changeNode(cd.m_path);
20}
21
Václav Kubernátb61336d2018-05-28 17:35:03 +020022void Interpreter::operator()(const create_& create) const
23{
24 std::cout << "Presence container " << boost::get<container_>(create.m_path.m_nodes.back()).m_name << " created." << std::endl;
25}
26
27void Interpreter::operator()(const delete_& delet) const
28{
29 std::cout << "Presence container " << boost::get<container_>(delet.m_path.m_nodes.back()).m_name << " deleted." << std::endl;
30}
31
32Interpreter::Interpreter(Parser& parser, Schema&)
Václav Kubernát96344a12018-05-28 16:33:39 +020033 : m_parser(parser)
34{
35}