|
OpenCog Framework
Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
|
#include <ClassServer.h>
Public Member Functions | |
| Type | addType (const Type parent, const std::string &name) |
| TypeSignal & | addTypeSignal () |
| template<typename OutputIterator > | |
| unsigned long | getChildren (Type type, OutputIterator result) |
| template<typename OutputIterator > | |
| unsigned long | getChildrenRecursive (Type type, OutputIterator result) |
| template<typename Function > | |
| void | foreachRecursive (Function func, Type type) |
| Type | getNumberOfClasses () |
| bool | isA (Type sub, Type super) |
| bool | isA_non_recursive (Type sub, Type super) |
| bool | isValid (Type t) |
| bool | isLink (Type t) |
| bool | isNode (Type t) |
| bool | isDefined (const std::string &typeName) |
| Type | getType (const std::string &typeName) |
| const std::string & | getTypeName (Type type) |
Static Public Member Functions | |
| static ClassServer * | createInstance (void) |
Private Member Functions | |
| ClassServer () | |
| void | setParentRecursively (Type parent, Type type) |
Private Attributes | |
| std::mutex | type_mutex |
| Type | nTypes |
| std::vector< std::vector< bool > > | inheritanceMap |
| std::vector< std::vector< bool > > | recursiveMap |
| std::unordered_map < std::string, Type > | name2CodeMap |
| std::unordered_map< Type, const std::string * > | code2NameMap |
| TypeSignal | _addTypeSignal |
Definition at line 51 of file ClassServer.h.
|
private |
Private default constructor for this class to make it a singleton.
Definition at line 46 of file ClassServer.cc.
References nTypes.
Here is the caller graph for this function:Adds a new atom type with the given name and parent type
Definition at line 60 of file ClassServer.cc.
References _addTypeSignal, code2NameMap, DPRINTF, getType(), inheritanceMap, name2CodeMap, nTypes, recursiveMap, setParentRecursively(), and type_mutex.
| boost::signals2::signal< void(Type)> & ClassServer::addTypeSignal | ( | ) |
Provides ability to get type-added signals.
Definition at line 115 of file ClassServer.cc.
References _addTypeSignal.
Here is the caller graph for this function:
|
static |
Returns a new ClassServer instance
Definition at line 55 of file ClassServer.cc.
References ClassServer().
|
inline |
Definition at line 122 of file ClassServer.h.
References nTypes, and recursiveMap.
Here is the caller graph for this function:
|
inline |
Stores the children types on the OutputIterator 'result'. Returns the number of children types.
Definition at line 96 of file ClassServer.h.
References inheritanceMap, and nTypes.
Here is the caller graph for this function:
|
inline |
Definition at line 109 of file ClassServer.h.
References nTypes, and recursiveMap.
Here is the caller graph for this function:| Type ClassServer::getNumberOfClasses | ( | ) |
Returns the total number of classes in the system.
Definition at line 120 of file ClassServer.cc.
References nTypes.
Here is the caller graph for this function:| Type ClassServer::getType | ( | const std::string & | typeName | ) |
Returns the type of a given class.
| typeName | Class type name. |
Definition at line 138 of file ClassServer.cc.
References name2CodeMap, and type_mutex.
Here is the caller graph for this function:| const std::string & ClassServer::getTypeName | ( | Type | type | ) |
Returns the string representation of a given atom type.
| type | Atom type code. |
Definition at line 148 of file ClassServer.cc.
References code2NameMap, and type_mutex.
Here is the caller graph for this function:Returns whether a given class is assignable from another. This is the single-most commonly called method in this class.
| super | Super class. |
| sub | Subclass. |
Definition at line 144 of file ClassServer.h.
References nTypes, recursiveMap, and type_mutex.
Here is the caller graph for this function:Definition at line 125 of file ClassServer.cc.
References inheritanceMap, nTypes, and type_mutex.
| bool ClassServer::isDefined | ( | const std::string & | typeName | ) |
Returns whether a class with name 'typeName' is defined.
Definition at line 132 of file ClassServer.cc.
References name2CodeMap, and type_mutex.
|
inline |
Returns true if given class is a Link.
| t | class. |
Definition at line 174 of file ClassServer.h.
References isA().
|
inline |
Returns true if given class is a Node.
| t | class. |
Definition at line 182 of file ClassServer.h.
References isA().
Here is the caller graph for this function:
|
inline |
Returns true if given class is a valid atom type.
| t | class. |
Definition at line 166 of file ClassServer.h.
References isA().
Definition at line 105 of file ClassServer.cc.
References nTypes, and recursiveMap.
Here is the caller graph for this function:
|
private |
Definition at line 74 of file ClassServer.h.
|
private |
Definition at line 73 of file ClassServer.h.
|
private |
Definition at line 70 of file ClassServer.h.
|
private |
Definition at line 72 of file ClassServer.h.
|
private |
Definition at line 68 of file ClassServer.h.
|
private |
Definition at line 71 of file ClassServer.h.
|
mutableprivate |
Definition at line 66 of file ClassServer.h.