Class SBCContainerFractionalKey#
ClassList > SBCContainerFractionalKey
This class describes a fractional key used for assigning a unique index to nodes and sort them in a context of collaborative editing. More...
#include <SBCContainerFractionalKey.hpp>
Public Static Attributes#
Type | Name |
---|---|
const SBCContainerFractionalKey | one The one fractional key. |
const SBCContainerFractionalKey | zero The zero fractional key. |
Public Functions#
Type | Name |
---|---|
SBCContainerFractionalKey (char c) Constructs a fractional key from a char. |
|
SBCContainerFractionalKey (const SBCContainerVector< char > & charVector) Constructs a fractional key from a vector of chars. |
|
SBCContainerFractionalKey (const std::string & key) Constructs a fractional key from a std::string. |
|
SBCContainerFractionalKey (const SBCContainerFractionalKey & other) Copy constructor. |
|
SBCContainerFractionalKey (SBCContainerFractionalKey && other) Move constructor. |
|
SBCContainerFractionalKey () Constructs an invalid fractional key. |
|
bool | isValid () const Returns true if and only if the fractional key is valid. |
bool | operator!= (const SBCContainerFractionalKey & other) const Non-equality operator. |
std::string | operator() () const Returns the fractional key in string format. |
bool | operator< (const SBCContainerFractionalKey & other) const Lexicographic comparison with another fractional key. |
bool | operator<= (const SBCContainerFractionalKey & other) const Lexicographic comparison with another fractional key. |
SBCContainerFractionalKey & | operator= (const SBCContainerFractionalKey & other) Copy assignment operator. |
SBCContainerFractionalKey & | operator= (SBCContainerFractionalKey && other) Move assignment operator. |
bool | operator== (const SBCContainerFractionalKey & other) const Equality operator. |
bool | operator> (const SBCContainerFractionalKey & other) const Lexicographic comparison with another fractional key. |
bool | operator>= (const SBCContainerFractionalKey & other) const Lexicographic comparison with another fractional key. |
SBCContainerFractionalKey | operator| (const SBCContainerFractionalKey & other) const Generate a key between this fractional and another fractional key. |
virtual | ~SBCContainerFractionalKey () Destructs the fractional key. |
Detailed Description#
SBCContainerFractionalKey objects can hold fractional keys (also called fractional indices). Fractional keys are arbitrary-precision fractions between 0 and 1 (excluding 0 and 1). For compactness, fractional keys only store the decimal part of the fraction, and are stored as series of printable ASCII characters (ASCII codes 32-126 included), resulting in a base-95 representation.
The number 0 is represented by an empty key, while the number 1 is represented by a key containing the char 127 only. Both 0 and 1 are not considered valid fractional keys.
Short name: SBFractionalKey
Public Static Attributes Documentation#
variable one#
The one fractional key.
variable zero#
The zero fractional key.
Public Functions Documentation#
function SBCContainerFractionalKey [1/6]#
Constructs a fractional key from a char.
function SBCContainerFractionalKey [2/6]#
Constructs a fractional key from a vector of chars.
SBCContainerFractionalKey::SBCContainerFractionalKey (
const SBCContainerVector < char > & charVector
)
function SBCContainerFractionalKey [3/6]#
Constructs a fractional key from a std::string.
function SBCContainerFractionalKey [4/6]#
Copy constructor.
function SBCContainerFractionalKey [5/6]#
Move constructor.
function SBCContainerFractionalKey [6/6]#
Constructs an invalid fractional key.
function isValid#
Returns true if and only if the fractional key is valid.
function operator!=#
Non-equality operator.
function operator()#
Returns the fractional key in string format.
function operator<#
Lexicographic comparison with another fractional key.
function operator<=#
Lexicographic comparison with another fractional key.
function operator=#
Copy assignment operator.
SBCContainerFractionalKey & SBCContainerFractionalKey::operator= (
const SBCContainerFractionalKey & other
)
function operator=#
Move assignment operator.
SBCContainerFractionalKey & SBCContainerFractionalKey::operator= (
SBCContainerFractionalKey && other
)
function operator==#
Equality operator.
function operator>#
Lexicographic comparison with another fractional key.
function operator>=#
Lexicographic comparison with another fractional key.
function operator|#
Generate a key between this fractional and another fractional key.
SBCContainerFractionalKey SBCContainerFractionalKey::operator| (
const SBCContainerFractionalKey & other
) const
function ~SBCContainerFractionalKey#
Destructs the fractional key.