I have a class CNode that inherits boost list_base_hook so that I can use it in a boost intrusive list.
class CNode
//Base hook with default tag, raw pointers and safe_link mode
:public list_base_hook<>
{
// Suppose the linked pointers inherited from list_base_hook
// are "m_prev", "m_next".
};
When the node is popped out of the list, it will be pushed into another FIFO. That FIFO plans to reuse m_prev, m_next to link nodes together while implementing a single-reader-single-writer thread safe semantics.
In my FIFO:
class CFIFO
{
public:
void push_back(CNode *node)
{
// Is there any way to update the "m_next"/"m_prev" fields?
// SetNextLink is faked here..
m_tail->SetNextLink(node);
..
}
};
Is there any way to get the m_prev, m_next field of CNode?
Linked fields
prev_andnext_are inherited fromlist_base_hookand I can access them directly since they’re public in the base.