23 #ifndef _OPENCOG_TYPE_NODE_H
24 #define _OPENCOG_TYPE_NODE_H
54 throw InvalidParamException(TRACE_INFO,
55 "Not a valid typename: '%s'", s.c_str());
69 OC_ASSERT(TYPE_NODE == n.
getType(),
"Bad TypeNode constructor!");
72 throw InvalidParamException(TRACE_INFO,
73 "Not a valid typename: '%s'", n.
getName().c_str());
80 throw InvalidParamException(TRACE_INFO,
81 "Not a valid typename: '%s'", str.c_str());
91 {
return std::dynamic_pointer_cast<
TypeNode>(
a); }
94 #define createTypeNode std::make_shared<TypeNode>
99 #endif // _OPENCOG_TYPE_NODE_H
static TypeNodePtr TypeNodeCast(const Handle &h)
std::shared_ptr< Atom > AtomPtr
std::shared_ptr< TruthValue > TruthValuePtr
std::shared_ptr< AttentionValue > AttentionValuePtr
ClassServer & classserver(ClassServerFactory *=ClassServer::createInstance)
static void validate(const std::string &str)
TypeNode(Type t, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
const std::string & getName() const
static TruthValuePtr DEFAULT_TV()
std::shared_ptr< TypeNode > TypeNodePtr
static AttentionValuePtr DEFAULT_AV()
to be used as default attention value
Type getType(const std::string &typeName)
unsigned short Type
type of Atoms, represented as short integer (16 bits)
TypeNode(const std::string &s, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())