Commit a0f1ea81 authored by Quentin Khan's avatar Quentin Khan

Add missing '\brief' in FNode.hpp

parent 2153ef53
......@@ -175,7 +175,6 @@ struct NodeEmptyData {};
/**
* \brief Tree node implementation
*
*/
template<class _Tree, class _ParticleContainer, class NodeData>
class FNode {
......@@ -282,7 +281,10 @@ public:
/// Mid-field leaf interaction list
interaction_list_t X;
/** Constructor called from parent
/**
* \brief Constructor called from parent
*
* This constructor is meant to be called from a parent node.
*
* \param parent The parent node
* \param child_index The index of this node in the parent children array
......@@ -304,7 +306,11 @@ public:
this->common_init();
}
/** Root constructor called from tree */
/**
* \brief Root constructor called from tree
*
* This constructor must be called when building the tree root.
*/
FNode(tree_t* tree) :
_box(tree->box()),
_tree(tree),
......@@ -317,22 +323,34 @@ public:
this->common_init();
}
/** Default constructor */
/**
* \brief Deleted default constructor
*/
FNode() = delete;
/** Copy constructor */
/**
* \brief Deleted copy constructor
*/
FNode(const FNode& other) = delete;
/** Copy operator */
/**
* \brief Deleted copy operator
*/
FNode& operator=(const FNode& other) = delete;
/** Move constructor */
/**
* \brief Deleted move constructor
*/
FNode(FNode&& other) = delete;
/** Move operator */
/**
* \brief Deleted move operator
*/
FNode& operator=(FNode&& other) = delete;
/** Destructor */
/**
* \brief Deleted destructor
*/
~FNode() {
this->delete_children();
}
......@@ -366,14 +384,16 @@ public:
return _children;
}
/** Child container accessor
/**
* \brief Child container accessor
*
* \param index Child index
*/
FNode* getChild(const std::size_t& index) noexcept {
return getChildren()[index];
}
/** Child container const accessor
/**
* \brief Child container const accessor
*
* \param index Child index
*/
......@@ -440,7 +460,8 @@ public:
return 0;
}
/** Returns true if this node and the 'other' node are adjacent
/**
* \brief Find out whether this node and the 'other' node are adjacent
*
* The nodes are assumed to belong to the same tree.
*
......@@ -452,7 +473,7 @@ public:
*
* \param other The node to test adjacency with.
*
* \return true if this FNode and the 'other' FNode are adjacent.
* \return true if this FNode and the 'other' FNode are adjacent.
*/
bool is_adjacent(const FNode& other) const noexcept {
// Sum of the half side lengh of the two nodes boxes.
......@@ -477,7 +498,8 @@ public:
return one_axis_is_at_exact_distance;
}
/** Tests whether this node and the 'other' node are adjacent
/**
* \brief Tests whether this node and the 'other' node are adjacent
*
* \return true if the nodes are adjacent.
*/
......@@ -491,7 +513,8 @@ public:
return is_adjacent(*other);
}
/** Tests whether this node is a leaf
/**
* \brief Tests whether this node is a leaf
*
* \return true if this node is a leaf.
*/
......@@ -535,7 +558,8 @@ private:
}
public:
/** Inserts a particle in the tree rooted at node
/**
* \brief Inserts a particle in the tree rooted at node
*
* Pushes a particle in the node particle container if it is a leaf. If it
* isn't, the particle is forwarded to the relevant child.
......@@ -555,7 +579,8 @@ public:
}
}
/** Inserts a particle in the tree rooted at node
/**
* \brief Inserts a particle in the tree rooted at node
*
* Emplaces a particle in the node particle container if it is a leaf. If it
* isn't, the particle is forwarded to the relevant child.
......@@ -578,7 +603,8 @@ public:
}
/** Extracts a particle from a leaf
/**
* \brief Extracts a particle from a leaf
*
* If the nodes is not a leaf, does nothing.
*
......@@ -594,7 +620,8 @@ public:
return particle_t();
}
/** Splits or fuses nodes after tree modifications
/**
* \brief Splits or fuses nodes after tree modifications
*
* Iterates over all the sub-tree particles and splits the leafs that
* hold too many particles or fuses those that hold too few.
......@@ -637,7 +664,9 @@ public:
}
}
/** Applies a function to the node and it descendants in order */
/**
* \brief Applies a function to the node and it descendants in order
*/
void for_each_in_order(std::function<void(FNode*)> lambda) {
std::size_t idx = 0;
if(! is_leaf()) {
......@@ -653,7 +682,9 @@ public:
}
}
/** Applies a function to the node and it descendants post order (children first) */
/**
* \brief Applies a function to the node and it descendants post order (children first)
*/
void for_each_post_order(std::function<void(FNode*)> lambda) {
if(! is_leaf()) {
for(std::size_t idx = 0; idx < getChildren().size(); ++idx) {
......@@ -663,7 +694,9 @@ public:
lambda(this);
}
/** Applies a function to the node and it descendants pre order (parent first) */
/**
* \brief Applies a function to the node and it descendants pre order (parent first)
*/
void for_each_pre_order(std::function<void(FNode*)> lambda) {
lambda(this);
if(! is_leaf()) {
......@@ -673,7 +706,9 @@ public:
}
}
/** Equality test operator */
/**
* \brief Equality test operator
*/
bool operator==(const FNode& other) const {
return other.getParent() == getParent()
&& other.getDepth() == getDepth()
......@@ -706,18 +741,22 @@ private:
}
/**
* \brief Catch-all initializer, no-op */
* \brief Catch-all initializer, no-op
*/
static void init(...) {}
};
/**
* \brief Common initialization done by constructors */
* \brief Common initialization done by constructors
*/
void common_init() {
cell_data_initializer::init(this->getData(), this);
}
/** Tree setter */
/**
* \brief Tree setter
*/
void setTree(tree_t* t) {
_tree = t;
if(! is_leaf()) {
......@@ -727,7 +766,9 @@ private:
}
}
/** Updates the tree height when called from a leaf
/**
* \brief Updates the tree height when called from a leaf
*
* \warning Must be called from a leaf
*/
void update_tree_height() {
......@@ -736,18 +777,24 @@ private:
getTree().set_height(getDepth() + 1);
}
/** Creates or allocates the particle container */
/**
* \brief Creates or allocates the particle container
*/
void create_particle_container() {
_p_container.clear();
_p_container.reserve(this->getTree().leaf_max_particle_count());
}
/** Deletes the particle container to save space when it is not needed */
/**
* \brief Deletes the particle container to save space when it is not needed
*/
void delete_particle_container() {
_p_container.clear();
}
/** Allocates this node's children */
/**
* \brief Allocates this node's children
*/
void create_children() {
std::size_t idx = 0;
// Remove this node from tree leaf list
......@@ -765,7 +812,9 @@ private:
_is_leaf = false;
}
/* Deletes this node's children */
/*
* \brief Deletes this node's children
*/
void delete_children() {
// Remove children from tree leaf list, free them
for(FNode*& child : getChildren()) {
......@@ -781,7 +830,8 @@ private:
_is_leaf = true;
}
/** Adds children to a leaf node
/**
* \brief Adds children to a leaf node
*
* Adds children to a leaf node and redistributes its particles among
* the newly created leaves.
......@@ -875,7 +925,9 @@ private:
}
/** Fuses the children nodes until this node becomes a leaf */
/**
* \brief Fuses the children nodes until this node becomes a leaf
*/
void fuse() {
if(is_leaf()) {
return; // In a leaf, there's nothing to do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment