33 #include <boost/bind.hpp>
35 #include <opencog/atomspace/atom_types.h>
37 #include <opencog/util/Logger.h>
39 #include "opencog/atomspace/atom_types.definitions"
44 using namespace opencog;
48 logger().info(
"Initializing ClassServer");
52 #include "opencog/atomspace/atom_types.inheritance"
69 DPRINTF(
"Type \"%s\" has already been added (%d)\n", name.c_str(), type);
84 boost::bind(&std::vector<bool>::resize, _1,
nTypes,
false));
87 boost::bind(&std::vector<bool>::resize, _1,
nTypes,
false));
90 inheritanceMap[parent][type] =
true;
128 if ((type >=
nTypes) || (parent >=
nTypes))
return false;
141 std::unordered_map<std::string, Type>::iterator it =
name2CodeMap.find(typeName);
150 static std::string nullString =
"*** Unknown Type! ***";
153 std::unordered_map<Type, const std::string*>::iterator it;
155 return *(it->second);
161 static std::unique_ptr<ClassServer> instance((*factory)());
std::unordered_map< std::string, Type > name2CodeMap
std::vector< std::vector< bool > > recursiveMap
Type addType(const Type parent, const std::string &name)
ClassServer & classserver(ClassServerFactory *=ClassServer::createInstance)
static ClassServer * createInstance(void)
bool isDefined(const std::string &typeName)
Type getNumberOfClasses()
ClassServer * ClassServerFactory(void)
TypeSignal & addTypeSignal()
const std::string & getTypeName(Type type)
void setParentRecursively(Type parent, Type type)
std::unordered_map< Type, const std::string * > code2NameMap
bool isA_non_recursive(Type sub, Type super)
Type getType(const std::string &typeName)
unsigned short Type
type of Atoms, represented as short integer (16 bits)
std::vector< std::vector< bool > > inheritanceMap
av init(getOutgoingSet())
static __attribute__((constructor)) void init(void)
TypeSignal _addTypeSignal