patrick
/
plasp
Archived
1
0
Fork 0
This repository has been archived on 2023-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
plasp/include/plasp/pddl/Type.h

64 lines
1.2 KiB
C++

#ifndef __PLASP__PDDL__TYPE_H
#define __PLASP__PDDL__TYPE_H
#include <functional>
#include <string>
#include <unordered_map>
#include <vector>
#include <plasp/utils/Parser.h>
namespace plasp
{
namespace pddl
{
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Type
//
////////////////////////////////////////////////////////////////////////////////////////////////////
class Context;
class Type;
using TypeHashMap = std::unordered_map<std::string, Type>;
////////////////////////////////////////////////////////////////////////////////////////////////////
class Type
{
public:
static void parsePDDL(utils::Parser &parser, Context &context);
public:
const std::string &name() const;
const std::vector<const Type *> &parentTypes() const;
bool isDeclared() const;
private:
Type(std::string name);
void setDirty(bool isDirty = true);
bool isDirty() const;
void setDeclared();
void addParentType(const Type &parentType);
bool m_isDirty;
bool m_isDeclared;
std::string m_name;
std::vector<const Type *> m_parentTypes;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
}
}
#endif