<commit_before>/*
 * opencog/atomspace/Atom.h
 *
 * Copyright (C) 2002-2007 Novamente LLC
 * All Rights Reserved
 *
 * Written by <NAME> <<EMAIL>>
 *            <NAME> <<EMAIL>>
 *            <NAME> <<EMAIL>>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License v3 as
 * published by the Free Software Foundation and including the exceptions
 * at http://opencog.org/wiki/Licenses
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program; if not, write to:
 * Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef _OPENCOG_ATOM_H
#define _OPENCOG_ATOM_H

#include <string>

#include <opencog/atomspace/TruthValue.h>
#include <opencog/atomspace/atom_types.h>
#include <opencog/atomspace/types.h>
#include <opencog/atomspace/HandleEntry.h>
#include <opencog/atomspace/ImportanceIndex.h>
#include <opencog/atomspace/AttentionValue.h>
#include <opencog/atomspace/AtomSpaceDefinitions.h>
#include <opencog/util/exceptions.h>

namespace opencog
{

class AtomTable;
class HandleEntry;

/**
 * Atoms are the basic implementational unit in the system that
 * represents nodes and links. In terms of inheritance, nodes and
 * links are specialization of atoms, that is, they inherit all
 * properties from atoms.
 */
class Atom : public AttentionValueHolder
{
    friend class SavingLoading;
    friend class AtomTable;
    friend class AtomSpace;
    friend class ImportanceIndex;
    friend class NMXmlParser;
    friend class TLB;
    friend class Node;
    friend class Link;

private:

    // Called by constructors to init this object
    void init(Type, const TruthValue&);

    /**
     * Sets the AtomTable in which this Atom is inserted.
     */
    void setAtomTable(AtomTable *);

    /**
     * Returns the AtomTable in which this Atom is inserted.
     */
    AtomTable *getAtomTable() const {
        return atomTable;
    }

protected:
    Handle handle;
    Type type;

    AtomTable *atomTable;

    // Linked-list that dynamically changes when new links
    // point to this atom.
    HandleEntry *incoming;

    char flags;
<commit_msg>reorder Atom variables for better efficiency<commit_after>/*
 * opencog/atomspace/Atom.h
 *
 * Copyright (C) 2002-2007 Novamente LLC
 * All Rights Reserved
 *
 * Written by <NAME> <<EMAIL>>
 *            <NAME> <<EMAIL>>
 *            <NAME> <<EMAIL>>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License v3 as
 * published by the Free Software Foundation and including the exceptions
 * at http://opencog.org/wiki/Licenses
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program; if not, write to:
 * Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef _OPENCOG_ATOM_H
#define _OPENCOG_ATOM_H

#include <string>

#include <opencog/atomspace/TruthValue.h>
#include <opencog/atomspace/atom_types.h>
#include <opencog/atomspace/types.h>
#include <opencog/atomspace/HandleEntry.h>
#include <opencog/atomspace/ImportanceIndex.h>
#include <opencog/atomspace/AttentionValue.h>
#include <opencog/atomspace/AtomSpaceDefinitions.h>
#include <opencog/util/exceptions.h>

namespace opencog
{

class AtomTable;
class HandleEntry;

/**
 * Atoms are the basic implementational unit in the system that
 * represents nodes and links. In terms of inheritance, nodes and
 * links are specialization of atoms, that is, they inherit all
 * properties from atoms.
 */
class Atom : public AttentionValueHolder
{
    friend class SavingLoading;
    friend class AtomTable;
    friend class AtomSpace;
    friend class ImportanceIndex;
    friend class NMXmlParser;
    friend class TLB;
    friend class Node;
    friend class Link;

private:

    // Called by constructors to init this object
    void init(Type, const TruthValue&);

    /**
     * Sets the AtomTable in which this Atom is inserted.
     */
    void setAtomTable(AtomTable *);

    /**
     * Returns the AtomTable in which this Atom is inserted.
     */
    AtomTable *getAtomTable() const {
        return atomTable;
    }

protected:
    Handle handle;
    AtomTable *atomTable;

    // Linked-list that dynamically changes when new links
    // point to this atom.
    HandleEntry *incoming;

    Type type;
    char flags;

{'fraction_non_alphanumeric': 0.08126501200960769, 'fraction_numerical': 0.008006405124099279, 'mean_word_length': 3.441777777777778, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '481892', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1445, 'n_words': 553}