OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AtomSpace_CWrapper.h File Reference
+ Include dependency graph for AtomSpace_CWrapper.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

AtomSpaceAtomSpace_new (AtomSpace *parent_ptr)
 
void AtomSpace_delete (AtomSpace *this_ptr)
 
UUID AtomSpace_addNode (AtomSpace *this_ptr, const char *type, const char *name)
 
UUID AtomSpace_addLink (AtomSpace *this_ptr, const char *type, const UUID *outgoing, int size)
 
UUID AtomSpace_getNode (AtomSpace *this_ptr, const char *type, const char *name, int *found)
 
UUID AtomSpace_getLink (AtomSpace *this_ptr, const char *type, const UUID *outgoing, int size, int *found)
 
int AtomSpace_removeAtom (AtomSpace *this_ptr, UUID handle)
 
int AtomSpace_getAtomByHandle (AtomSpace *this_ptr, UUID handle, char **type, char **name, UUID **out, int *out_len)
 
void AtomSpace_debug (AtomSpace *this_ptr)
 
TruthValueType AtomSpace_getTruthValue (AtomSpace *this_ptr, UUID handle, double *parameters)
 
void AtomSpace_setTruthValue (AtomSpace *this_ptr, UUID handle, TruthValueType type, double *parameters)
 

Function Documentation

UUID AtomSpace_addLink ( AtomSpace this_ptr,
const char *  type,
const UUID outgoing,
int  size 
)

AtomSpace_addLink Inserts a new link to the atomspace, or updates it if exists.

Parameters
this_ptrPointer to AtomSpace instance.
typeString representation of a link type.
outgoingList of UUID of the outgoing set.
sizeSize of the outgoing list.
Returns
Handle id of the link inserted.

Definition at line 33 of file AtomSpace_CWrapper.cpp.

References opencog::AtomSpace::add_link(), opencog::classserver(), opencog::ClassServer::getType(), python.undocumented.blocksworld::t, and opencog::Handle::value().

UUID AtomSpace_addNode ( AtomSpace this_ptr,
const char *  type,
const char *  name 
)

AtomSpace_addNode Inserts a new node to the atomspace, or updates it if exists.

Parameters
this_ptrPointer to AtomSpace instance.
typeString representation of a node type.
nameNode name.
Returns
Handle id of the node inserted.

Definition at line 22 of file AtomSpace_CWrapper.cpp.

References opencog::AtomSpace::add_node(), opencog::classserver(), opencog::ClassServer::getType(), python.undocumented.blocksworld::t, and opencog::Handle::value().

void AtomSpace_debug ( AtomSpace this_ptr)

AtomSpace_debug Debug function to print the state of the atomspace on stderr.

Parameters
this_ptrPointer to AtomSpace instance.

Definition at line 127 of file AtomSpace_CWrapper.cpp.

void AtomSpace_delete ( AtomSpace this_ptr)

AtomSpace_delete Deletes an AtomSpace object.

Parameters
this_ptrPointer to object.

Definition at line 17 of file AtomSpace_CWrapper.cpp.

int AtomSpace_getAtomByHandle ( AtomSpace this_ptr,
UUID  handle,
char **  type,
char **  name,
UUID **  out,
int *  out_len 
)

AtomSpace_getAtomByHandle Gets an atom back from the atomspace.

Parameters
this_ptrPointer to AtomSpace instance.
handleUUID of the atom.
[out]typeString representation of atom type.
[out]nameString representation of atom name (if node).
[out]outList of UUID of the outgoing set (if link).
[out]out_lenSize of the outgoing list (if link).
Returns
flag =1 if node, =0 if link.

NOTE: Memory for output parameter is allocated with malloc. The caller should properly free memory in output parameters according to the return value: If node -> free type and name fields. If link -> free type and out field.

Definition at line 86 of file AtomSpace_CWrapper.cpp.

References opencog::classserver(), opencog::Atom::getType(), opencog::ClassServer::getTypeName(), opencog::LinkCast(), and opencog::NodeCast().

UUID AtomSpace_getLink ( AtomSpace this_ptr,
const char *  type,
const UUID outgoing,
int  size,
int *  found 
)

AtomSpace_getLink Gets a link back from the atomspace.

Parameters
this_ptrPointer to AtomSpace instance.
typeString representation of a link type.
outgoingList of UUID of the outgoing set.
sizeSize of the outgoing list.
[out]foundFlag to know if the link was found.
Returns
Handle id of the link.

Definition at line 62 of file AtomSpace_CWrapper.cpp.

References opencog::classserver(), opencog::AtomSpace::get_link(), opencog::ClassServer::getType(), python.undocumented.blocksworld::t, and opencog::Handle::value().

UUID AtomSpace_getNode ( AtomSpace this_ptr,
const char *  type,
const char *  name,
int *  found 
)

AtomSpace_getNode Gets a node back from the atomspace.

Parameters
this_ptrPointer to AtomSpace instance.
typeString representation of a node type.
nameNode name.
[out]foundFlag to know if the node was found.
Returns
Handle id of the node.

Definition at line 48 of file AtomSpace_CWrapper.cpp.

References opencog::classserver(), opencog::AtomSpace::get_node(), opencog::ClassServer::getType(), python.undocumented.blocksworld::t, and opencog::Handle::value().

TruthValueType AtomSpace_getTruthValue ( AtomSpace this_ptr,
UUID  handle,
double *  parameters 
)

AtomSpace_getTruthValue Gets the truthvalue of an atom on the atomspace.

Parameters
this_ptrPointer to AtomSpace instance.
handleHandle id of target atom.
[out]parametersList of parameters of TruthValue result instance.
Returns
TruthValue type.

Definition at line 132 of file AtomSpace_CWrapper.cpp.

References opencog::COUNT_TRUTH_VALUE, opencog::FUZZY_TRUTH_VALUE, opencog::IndefiniteTruthValue::getMean(), opencog::Atom::getTruthValue(), opencog::INDEFINITE_TRUTH_VALUE, opencog::PROBABILISTIC_TRUTH_VALUE, opencog::SIMPLE_TRUTH_VALUE, and tv.

AtomSpace* AtomSpace_new ( AtomSpace parent_ptr)

AtomSpace_new Creates a new instance of the AtomSpace class.

Parameters
parent_ptrPointer to the parent atomspace (null if we want a new independent atomspace).
Returns
Pointer to the AtomSpace instance created.

Definition at line 12 of file AtomSpace_CWrapper.cpp.

int AtomSpace_removeAtom ( AtomSpace this_ptr,
UUID  handle 
)

AtomSpace_removeAtom Removes an atom from the atomspace.

Parameters
this_ptrPointer to AtomSpace instance.
handleHandle id of the atom to be removed.
Returns
Flag to know if the atom has been removed.

Definition at line 80 of file AtomSpace_CWrapper.cpp.

References opencog::AtomSpace::remove_atom().

void AtomSpace_setTruthValue ( AtomSpace this_ptr,
UUID  handle,
TruthValueType  type,
double *  parameters 
)

AtomSpace_setTruthValue Sets the truthvalue of an atom on the atomspace.

Parameters
this_ptrPointer to AtomSpace instance.
handleHandle id of target atom.
typeTruthValue type to be set.
parametersList of parameters of TruthValue to be set.

Definition at line 178 of file AtomSpace_CWrapper.cpp.

References opencog::COUNT_TRUTH_VALUE, opencog::FUZZY_TRUTH_VALUE, opencog::INDEFINITE_TRUTH_VALUE, opencog::PROBABILISTIC_TRUTH_VALUE, opencog::Atom::setTruthValue(), and opencog::SIMPLE_TRUTH_VALUE.