Web Analytics Made Easy - Statcounter
Skip to content

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.

SBCContainerFractionalKey const one;


variable zero#

The zero fractional key.

SBCContainerFractionalKey const zero;


Public Functions Documentation#

function SBCContainerFractionalKey [1/6]#

Constructs a fractional key from a char.

SBCContainerFractionalKey::SBCContainerFractionalKey (
    char c
) 


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.

SBCContainerFractionalKey::SBCContainerFractionalKey (
    const std::string & key
) 


function SBCContainerFractionalKey [4/6]#

Copy constructor.

SBCContainerFractionalKey::SBCContainerFractionalKey (
    const SBCContainerFractionalKey & other
) 


function SBCContainerFractionalKey [5/6]#

Move constructor.

SBCContainerFractionalKey::SBCContainerFractionalKey (
    SBCContainerFractionalKey && other
) 


function SBCContainerFractionalKey [6/6]#

Constructs an invalid fractional key.

SBCContainerFractionalKey::SBCContainerFractionalKey () 


function isValid#

Returns true if and only if the fractional key is valid.

bool SBCContainerFractionalKey::isValid () const


function operator!=#

Non-equality operator.

bool SBCContainerFractionalKey::operator!= (
    const SBCContainerFractionalKey & other
) const


function operator()#

Returns the fractional key in string format.

std::string SBCContainerFractionalKey::operator() () const


function operator<#

Lexicographic comparison with another fractional key.

bool SBCContainerFractionalKey::operator< (
    const SBCContainerFractionalKey & other
) const


function operator<=#

Lexicographic comparison with another fractional key.

bool SBCContainerFractionalKey::operator<= (
    const SBCContainerFractionalKey & other
) const


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.

bool SBCContainerFractionalKey::operator== (
    const SBCContainerFractionalKey & other
) const


function operator>#

Lexicographic comparison with another fractional key.

bool SBCContainerFractionalKey::operator> (
    const SBCContainerFractionalKey & other
) const


function operator>=#

Lexicographic comparison with another fractional key.

bool SBCContainerFractionalKey::operator>= (
    const SBCContainerFractionalKey & other
) const


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.

virtual SBCContainerFractionalKey::~SBCContainerFractionalKey ()