Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
chainbase::offset_node_traits< Tag > Struct Template Reference

#include <undo_index.hpp>

Public Types

using node = offset_node_base<Tag>
 
using node_ptr = node*
 
using const_node_ptr = const node*
 
using color = int
 
using balance = int
 

Static Public Member Functions

static node_ptr get_parent (const_node_ptr n)
 
static void set_parent (node_ptr n, node_ptr parent)
 
static node_ptr get_left (const_node_ptr n)
 
static void set_left (node_ptr n, node_ptr left)
 
static node_ptr get_right (const_node_ptr n)
 
static void set_right (node_ptr n, node_ptr right)
 
static color get_color (node_ptr n)
 
static void set_color (node_ptr n, color c)
 
static color black ()
 
static color red ()
 
static balance get_balance (node_ptr n)
 
static void set_balance (node_ptr n, balance c)
 
static balance negative ()
 
static balance zero ()
 
static balance positive ()
 
static node_ptr get_next (const_node_ptr n)
 
static void set_next (node_ptr n, node_ptr next)
 
static node_ptr get_previous (const_node_ptr n)
 
static void set_previous (node_ptr n, node_ptr previous)
 

Detailed Description

template<class Tag>
struct chainbase::offset_node_traits< Tag >

Definition at line 62 of file undo_index.hpp.

Member Typedef Documentation

◆ balance

template<class Tag >
using chainbase::offset_node_traits< Tag >::balance = int

Definition at line 101 of file undo_index.hpp.

◆ color

template<class Tag >
using chainbase::offset_node_traits< Tag >::color = int

Definition at line 66 of file undo_index.hpp.

◆ const_node_ptr

template<class Tag >
using chainbase::offset_node_traits< Tag >::const_node_ptr = const node*

Definition at line 65 of file undo_index.hpp.

◆ node

template<class Tag >
using chainbase::offset_node_traits< Tag >::node = offset_node_base<Tag>

Definition at line 63 of file undo_index.hpp.

◆ node_ptr

template<class Tag >
using chainbase::offset_node_traits< Tag >::node_ptr = node*

Definition at line 64 of file undo_index.hpp.

Member Function Documentation

◆ black()

template<class Tag >
static color chainbase::offset_node_traits< Tag >::black ( )
inlinestatic

Definition at line 98 of file undo_index.hpp.

98{ return 0; }

◆ get_balance()

template<class Tag >
static balance chainbase::offset_node_traits< Tag >::get_balance ( node_ptr n)
inlinestatic

Definition at line 102 of file undo_index.hpp.

102 {
103 return n->_color;
104 }

◆ get_color()

template<class Tag >
static color chainbase::offset_node_traits< Tag >::get_color ( node_ptr n)
inlinestatic

Definition at line 92 of file undo_index.hpp.

92 {
93 return n->_color;
94 }

◆ get_left()

template<class Tag >
static node_ptr chainbase::offset_node_traits< Tag >::get_left ( const_node_ptr n)
inlinestatic

Definition at line 75 of file undo_index.hpp.

75 {
76 if(n->_left == 1) return nullptr;
77 return (node_ptr)((char*)n + n->_left);
78 }
Here is the caller graph for this function:

◆ get_next()

template<class Tag >
static node_ptr chainbase::offset_node_traits< Tag >::get_next ( const_node_ptr n)
inlinestatic

Definition at line 113 of file undo_index.hpp.

113{ return get_right(n); }
static node_ptr get_right(const_node_ptr n)
Here is the call graph for this function:

◆ get_parent()

template<class Tag >
static node_ptr chainbase::offset_node_traits< Tag >::get_parent ( const_node_ptr n)
inlinestatic

Definition at line 67 of file undo_index.hpp.

67 {
68 if(n->_parent == 1) return nullptr;
69 return (node_ptr)((char*)n + n->_parent);
70 }

◆ get_previous()

template<class Tag >
static node_ptr chainbase::offset_node_traits< Tag >::get_previous ( const_node_ptr n)
inlinestatic

Definition at line 115 of file undo_index.hpp.

115{ return get_left(n); }
static node_ptr get_left(const_node_ptr n)
Here is the call graph for this function:

◆ get_right()

template<class Tag >
static node_ptr chainbase::offset_node_traits< Tag >::get_right ( const_node_ptr n)
inlinestatic

Definition at line 83 of file undo_index.hpp.

83 {
84 if(n->_right == 1) return nullptr;
85 return (node_ptr)((char*)n + n->_right);
86 }
Here is the caller graph for this function:

◆ negative()

template<class Tag >
static balance chainbase::offset_node_traits< Tag >::negative ( )
inlinestatic

Definition at line 108 of file undo_index.hpp.

108{ return -1; }

◆ positive()

template<class Tag >
static balance chainbase::offset_node_traits< Tag >::positive ( )
inlinestatic

Definition at line 110 of file undo_index.hpp.

110{ return 1; }

◆ red()

template<class Tag >
static color chainbase::offset_node_traits< Tag >::red ( )
inlinestatic

Definition at line 99 of file undo_index.hpp.

99{ return 1; }

◆ set_balance()

template<class Tag >
static void chainbase::offset_node_traits< Tag >::set_balance ( node_ptr n,
balance c )
inlinestatic

Definition at line 105 of file undo_index.hpp.

105 {
106 n->_color = c;
107 }

◆ set_color()

template<class Tag >
static void chainbase::offset_node_traits< Tag >::set_color ( node_ptr n,
color c )
inlinestatic

Definition at line 95 of file undo_index.hpp.

95 {
96 n->_color = c;
97 }

◆ set_left()

template<class Tag >
static void chainbase::offset_node_traits< Tag >::set_left ( node_ptr n,
node_ptr left )
inlinestatic

Definition at line 79 of file undo_index.hpp.

79 {
80 if(left == nullptr) n->_left = 1;
81 else n->_left = (char*)left - (char*)n;
82 }
Here is the caller graph for this function:

◆ set_next()

template<class Tag >
static void chainbase::offset_node_traits< Tag >::set_next ( node_ptr n,
node_ptr next )
inlinestatic

Definition at line 114 of file undo_index.hpp.

114{ set_right(n, next); }
static void set_right(node_ptr n, node_ptr right)
Here is the call graph for this function:

◆ set_parent()

template<class Tag >
static void chainbase::offset_node_traits< Tag >::set_parent ( node_ptr n,
node_ptr parent )
inlinestatic

Definition at line 71 of file undo_index.hpp.

71 {
72 if(parent == nullptr) n->_parent = 1;
73 else n->_parent = (char*)parent - (char*)n;
74 }

◆ set_previous()

template<class Tag >
static void chainbase::offset_node_traits< Tag >::set_previous ( node_ptr n,
node_ptr previous )
inlinestatic

Definition at line 116 of file undo_index.hpp.

116{ set_left(n, previous); }
static void set_left(node_ptr n, node_ptr left)
Here is the call graph for this function:

◆ set_right()

template<class Tag >
static void chainbase::offset_node_traits< Tag >::set_right ( node_ptr n,
node_ptr right )
inlinestatic

Definition at line 87 of file undo_index.hpp.

87 {
88 if(right == nullptr) n->_right = 1;
89 else n->_right = (char*)right - (char*)n;
90 }
Here is the caller graph for this function:

◆ zero()

template<class Tag >
static balance chainbase::offset_node_traits< Tag >::zero ( )
inlinestatic

Definition at line 109 of file undo_index.hpp.

109{ return 0; }

The documentation for this struct was generated from the following file: