33 #include <opencog/util/Logger.h>
34 #include <opencog/util/exceptions.h>
35 #include <opencog/util/misc.h>
36 #include <opencog/util/platform.h>
47 #define MARKED_FOR_REMOVAL 2 //BIT1
58 using namespace opencog;
71 "Atom deletion failure; incoming set not empty for %s h=%d",
83 if (newTV->isNullTv())
return;
94 std::unique_lock<std::mutex> lck (
_mtx);
117 std::lock_guard<std::mutex> lck(
_mtx);
124 if (NULL == tvn or tvn->isDefaultTV() or tvn->isNullTv())
return;
135 if (currentTV->isDefaultTV() or currentTV->isNullTv()) {
158 std::lock_guard<std::mutex> lck(
_mtx);
168 if (av == local)
return;
169 if (*av == *local)
return;
172 std::unique_lock<std::mutex> lck (
_avmtx);
186 if (oldBin != newBin) {
202 old_av->getVLTI() + unit);
215 return (
_flags & flag) != 0;
248 OC_ASSERT (NULL ==
_atomTable or tb == NULL,
"Atom table is not null!");
282 std::lock_guard<std::mutex> lck (
_mtx);
292 std::lock_guard<std::mutex> lck (
_mtx);
294 #ifdef INCOMING_SET_SIGNALS
303 std::lock_guard<std::mutex> lck (
_mtx);
304 #ifdef INCOMING_SET_SIGNALS
313 std::lock_guard<std::mutex> lck (
_mtx);
327 std::lock_guard<std::mutex> lck (
_mtx);
332 if (l) iset.push_back(l);
341 for (
const Handle& h : inhs)
AttentionValuePtr getAttentionValue()
TVCHSigl & TVChangedSignal()
IncomingSet getIncomingSet()
std::vector< Handle > HandleSeq
a list of handles
std::shared_ptr< Atom > AtomPtr
boost::signals2::signal< void(const Handle &, const TruthValuePtr &, const TruthValuePtr &)> TVCHSigl
std::shared_ptr< TruthValue > TruthValuePtr
std::shared_ptr< AttentionValue > AttentionValuePtr
void markForRemoval()
Marks the atom for removal.
void unsetRemovalFlag()
Unsets removal flag.
std::shared_ptr< Link > LinkPtr
void setTruthValue(TruthValuePtr)
Sets the TruthValue object of the atom.
ClassServer & classserver(ClassServerFactory *=ClassServer::createInstance)
static unsigned int importanceBin(short)
bool isMarkedForRemoval() const
void setAttentionValue(AttentionValuePtr)
Sets the AttentionValue object of the atom.
void remove_atom(LinkPtr)
Remove an atom from the incoming set.
AVCHSigl & AVChangedSignal()
void updateImportanceIndex(AtomPtr a, int bin)
std::weak_ptr< Link > WinkPtr
static const Handle UNDEFINED
void merge(TruthValuePtr)
boost::signals2::signal< void(const Handle &, const AttentionValuePtr &, const AttentionValuePtr &)> AVCHSigl
static LinkPtr LinkCast(const Handle &h)
std::vector< LinkPtr > IncomingSet
TruthValuePtr _truthValue
TruthValuePtr getTruthValue()
void insert_atom(LinkPtr)
Add an atom to the incoming set.
void setAtomTable(AtomTable *)
Sets the AtomTable in which this Atom is inserted.
unsigned short Type
type of Atoms, represented as short integer (16 bits)
size_t getIncomingSetSize()
Get the size of the incoming set.
OutputIterator getIncomingSetByType(OutputIterator result, Type type, bool subclass=false)
AttentionValuePtr _attentionValue
#define MARKED_FOR_REMOVAL
Atom flag.