30 using namespace opencog;
36 throw InvalidParamException(TRACE_INFO,
37 "Expecting name and definition, got size %d", oset.size());
46 throw InvalidParamException(TRACE_INFO,
49 "as it is already defined in %s",
52 def->toString().c_str());
57 :
Link(DEFINE_LINK, oset, tv, av)
66 init(getOutgoingSet());
77 throw InvalidParamException(TRACE_INFO,
78 "Expecting a DefineLink, got %s", tname.c_str());
92 if (def->get_alias() == alias)
93 return def->get_definition();
97 throw InvalidParamException(TRACE_INFO,
98 "Cannot find defined hypergraph for atom %s",
const HandleSeq & getOutgoingSet() const
static DefineLinkPtr DefineLinkCast(const Handle &h)
std::vector< Handle > HandleSeq
a list of handles
std::shared_ptr< DefineLink > DefineLinkPtr
std::shared_ptr< TruthValue > TruthValuePtr
std::shared_ptr< AttentionValue > AttentionValuePtr
DefineLink(const HandleSeq &, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
virtual std::string toString(std::string indent="")=0
std::shared_ptr< Link > LinkPtr
ClassServer & classserver(ClassServerFactory *=ClassServer::createInstance)
static const Handle UNDEFINED
const std::string & getTypeName(Type type)
std::vector< LinkPtr > IncomingSet
Handle get_definition(void)
void init(const HandleSeq &)
unsigned short Type
type of Atoms, represented as short integer (16 bits)
av init(getOutgoingSet())
OutputIterator getIncomingSetByType(OutputIterator result, Type type, bool subclass=false)