BytesValue Class Reference Size

#include <bytesvalue.h>

Inheritance diagram for BytesValue:

详细描述

The BytesValue class encapsulates the byte size.

公共成员函数

  BytesValue ()
  BytesValue (const BytesValue & src )
BytesValue operator= (const BytesValue & src )
Bool   operator== (const BytesValue b) const
Bool   operator< (const BytesValue b) const
BytesValue   operator+ (const BytesValue b) const
BytesValue operator+= (const BytesValue b)
BytesValue   operator- (const BytesValue b) const
const BytesValue operator-= (const BytesValue b)
Bool   operator>= (const BytesValue b)
Bool   operator<= (const BytesValue b)
Bool   operator> (const BytesValue b)
Bool   operator< (const BytesValue b)
Bool   operator>= (const Int64 b)
Bool   operator<= (const Int64 b)
Bool   operator> (const Int64 b)
Bool   operator< (const Int64 b)
  operator Int64 () const
BytesValue operator*= (const Int64 b)
Int64   GetBits () const
Int64   GetBytes () const
void  SetBytes ( Int64 bytes)
Float32   GetKilobytes () const
Float32   GetKibibytes () const
Float32   GetMegabytes () const
Float32   GetMebibytes () const
Float32   GetGigabytes () const
Float32   GetGibibytes () const
Float32   GetTerabytes () const
Float32   GetTebibytes () const
String   ToString (const FormatStatement *formatStatement=nullptr) const
HashInt   GetHashCode () const

静态公共成员函数

static Result < void >  DescribeIO (const DataSerializeInterface &stream)

Protected Member Functions

  BytesValue ( Int64 bytes)

Private Attributes

Int64   _value

Friends

BytesValue   operator* (const BytesValue a, const Int64 b)
Int64   operator/ (const BytesValue a, const BytesValue b)
BytesValue   operator/ (const BytesValue a, const Int64 b)

构造函数 & 析构函数文档编制

◆  BytesValue() [1/3]

BytesValue ( )

Default constructor.

◆  BytesValue() [2/3]

BytesValue ( const BytesValue src )

Default constructor.

◆  BytesValue() [3/3]

BytesValue ( Int64   bytes )
explicit protected

成员函数文档编制

◆  operator=()

BytesValue & operator= ( const BytesValue src )

Assignment operator.

◆  operator==()

Bool operator== ( const BytesValue   b ) const

Compares two BytesValue .

◆  operator<() [1/3]

Bool operator< ( const BytesValue   b ) const

Compares two BytesValue .

◆  operator+()

BytesValue operator+ ( const BytesValue   b ) const

Adds two BytesValue .

◆  operator+=()

BytesValue & operator+= ( const BytesValue   b )

Adds two BytesValue .

◆  operator-()

BytesValue operator- ( const BytesValue   b ) const

Subtracts two BytesValue .

◆  operator-=()

const BytesValue & operator-= ( const BytesValue   b )

Subtracts two BytesValue .

◆  operator>=() [1/2]

Bool operator>= ( const BytesValue   b )

Compares two BytesValue .

◆  operator<=() [1/2]

Bool operator<= ( const BytesValue   b )

Compares two BytesValue .

◆  operator>() [1/2]

Bool operator> ( const BytesValue   b )

Compares two BytesValue .

◆  operator<() [2/3]

Bool operator< ( const BytesValue   b )

Compares two BytesValue .

◆  operator>=() [2/2]

Bool operator>= ( const Int64   b )

Compares the BytesValue with an Int64.

◆  operator<=() [2/2]

Bool operator<= ( const Int64   b )

Compares the BytesValue with an Int64.

◆  operator>() [2/2]

Bool operator> ( const Int64   b )

Compares the BytesValue with an Int64.

◆  operator<() [3/3]

Bool operator< ( const Int64   b )

Compares the BytesValue with an Int64.

◆  operator Int64()

operator Int64 ( ) const

◆  operator*=()

BytesValue & operator*= ( const Int64   b )

Multiplies a BytesValue with a factor.

参数
[in] b The second factor.
返回
The result of this * b.

◆  GetBits()

Int64 GetBits ( ) const

Return the number of bits.

返回
value in bits

◆  GetBytes()

Int64 GetBytes ( ) const

Get the BytesValue

返回
value in bytes

◆  SetBytes()

void SetBytes ( Int64   bytes )

Set the BytesValue

参数
[in] bytes byte value

◆  GetKilobytes()

Float32 GetKilobytes ( ) const

Get the BytesValue

返回
value in kilobytes (KB)

◆  GetKibibytes()

Float32 GetKibibytes ( ) const

Get the BytesValue

返回
value in kibibytes (KiB)

◆  GetMegabytes()

Float32 GetMegabytes ( ) const

Get the BytesValue

返回
value in megabytes (MB)

◆  GetMebibytes()

Float32 GetMebibytes ( ) const

Get the BytesValue

返回
value in mebibytes (MiB)

◆  GetGigabytes()

Float32 GetGigabytes ( ) const

Get the BytesValue

返回
value in gigabytes (GB)

◆  GetGibibytes()

Float32 GetGibibytes ( ) const

Get the BytesValue

返回
value in gibibytes (GiB)

◆  GetTerabytes()

Float32 GetTerabytes ( ) const

Get the BytesValue

返回
value in terrabytes (TB)

◆  GetTebibytes()

Float32 GetTebibytes ( ) const

Get the BytesValue

返回
value in tebibytes (TiB)

◆  ToString()

String ToString ( const FormatStatement formatStatement = nullptr ) const

Converts the value into a string.

参数
[in] formatStatement Nullptr or an additional formatting instruction. See also Formatting Timer values .
返回
The converted result.

◆  GetHashCode()

HashInt GetHashCode ( ) const

◆  DescribeIO()

static Result <void> DescribeIO ( const DataSerializeInterface stream )
static

Describe all elements of this class for I/O operations.

参数
[in] stream The stream that is used to register the class members.
返回
OK on success.

Friends And Related Function Documentation

◆  operator*

BytesValue operator* ( const BytesValue   a ,
const Int64   b  
)
friend

Multiplies a BytesValue with a factor.

参数
[in] a The first factor.
[in] b The second factor.
返回
The result of a * b.

◆  operator/ [1/2]

Int64 operator/ ( const BytesValue   a ,
const BytesValue   b  
)
friend

Divides two BytesValue and returns the quotient.

参数
[in] a The dividend.
[in] b The divisor. If the divisor is 0, the result will be undefined (floating point exception).
返回
The result of a / b, the quotient has unit therefore it is returned as Int64.

◆  operator/ [2/2]

BytesValue operator/ ( const BytesValue   a ,
const Int64   b  
)
friend

Divides a BytesValue by a scalar and returns the quotient.

参数
[in] a The dividend.
[in] b The divisor. If the divisor is 0, the result will be undefined (floating point exception).
返回
The result of a / b.

Member Data Documentation

◆  _value

Int64 _value
private