polymorph.h
No OneTemporary

File Metadata

Created
Mon, Aug 24, 12:11 PM

polymorph.h

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* File: polymorph.h
* Author: pgess <v.melnychenko@xreate.org>
*
* Created on November 9, 2017, 12:14 PM
*/
/**
* \file query/polymorph.h
* \brief Transcend solution on [Polymorphism](/d/concepts/polymorphism/) implementation details
*/
#ifndef POLYMORPHQUERY_H
#define POLYMORPHQUERY_H
#include "transcendlayer.h"
#include "aux/latereasoning.h"
#include <unordered_map>
namespace xreate { namespace polymorph {
/** \brief Queries Transcend solution on [Polymorphism](/d/concepts/polymorphism/) implementation details */
class PolymorphQuery: public IQuery {
public:
latereasoning::LateAnnotation get(const Expression& e) const;
Expression getValue(const Gringo::Symbol& s) const;
virtual void init(TranscendLayer* transcend) override;
private:
std::unordered_map<SymbolGeneralized, Gringo::Symbol> __cacheEarlyReasoning;
std::unordered_map<SymbolGeneralized, latereasoning::LateAnnotation> __cacheLateReasoning;
TranscendLayer* __transcend = nullptr;
};
}}//end of xreate::polymorph
#endif /* POLYMORPHQUERY_H */

Event Timeline