ACE 8.0.5
Loading...
Searching...
No Matches
ACE_CDR::Fixed Class Reference

#include <CDR_Base.h>

Classes

class  Proxy
class  IteratorBase
class  Iterator
class  ConstIterator

Public Types

enum  { MAX_DIGITS = 31 , MAX_STRING_SIZE = 4 + MAX_DIGITS }

Public Member Functions

 operator LongLong () const
 operator LongDouble () const
Fixed round (UShort scale) const
Fixed truncate (UShort scale) const
bool to_string (char *buffer, size_t buffer_size) const
const Octetto_octets (int &n) const
Fixedoperator+= (const Fixed &rhs)
Fixedoperator-= (const Fixed &rhs)
Fixedoperator*= (const Fixed &rhs)
Fixedoperator/= (const Fixed &rhs)
Fixedoperator++ ()
Fixed operator++ (int)
Fixedoperator-- ()
Fixed operator-- (int)
Fixed operator+ () const
Fixed operator- () const
bool operator! () const
UShort fixed_digits () const
UShort fixed_scale () const
bool sign () const
Octet digit (int n) const
void digit (int n, int value)
bool less (const Fixed &rhs) const
bool equal (const Fixed &rhs) const
Iterator begin ()
ConstIterator begin () const
ConstIterator cbegin () const
Iterator end ()
ConstIterator end () const
ConstIterator cend () const

Static Public Member Functions

static Fixed from_integer (LongLong val=0)
static Fixed from_integer (ULongLong val)
static Fixed from_floating (LongDouble val)
static Fixed from_string (const char *str)
static Fixed from_octets (const Octet *array, int len, unsigned int scale=0)

Static Public Attributes

static const Octet POSITIVE = 0xc
static const Octet NEGATIVE = 0xd

Private Member Functions

void normalize (UShort min_scale=0)
 remove trailing zeros, shift down and reduce digits and scale
int lshift (int digits)
ConstIterator pre_add (const Fixed &f)
Fixed div_helper2 (const Fixed &rhs, Fixed &r) const
Fixed div_helper1 (const Fixed &rhs, Fixed &r) const
Fixed join (int digits, const Fixed &bottom) const
void ltrim ()

Private Attributes

Octet value_ [16]
Octet digits_
Octet scale_

Detailed Description

Fixed-point data type: up to 31 decimal digits and a sign bit

See OMG 2011-11-01 CORBA Interfaces v3.2 sections 7.10, 7.11.3.4 See OMG 2011-11-02 CORBA Interoperability v3.2 section 9.3.2.8 See OMG 2012-07-02 IDL-to-C++ Mapping v1.3 section 5.13 This class doesn't exactly match the IDL-to-C++ mapping because it is meant for use inside a union in the IDL compiler and therefore has no constructors. Standards-based middleware libraries such as ORBs and DDSs can wrap this class in a class of their own to provide the exact interface described by the mapping specification.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_DIGITS 
MAX_STRING_SIZE 

Member Function Documentation

◆ begin() [1/2]

ACE_CDR::Fixed::Iterator ACE_CDR::Fixed::begin ( )
inline

◆ begin() [2/2]

ACE_CDR::Fixed::ConstIterator ACE_CDR::Fixed::begin ( ) const
inline

◆ cbegin()

ACE_CDR::Fixed::ConstIterator ACE_CDR::Fixed::cbegin ( ) const
inline

◆ cend()

ACE_CDR::Fixed::ConstIterator ACE_CDR::Fixed::cend ( ) const
inline

◆ digit() [1/2]

ACE_CDR::Octet ACE_CDR::Fixed::digit ( int n) const
inline

◆ digit() [2/2]

void ACE_CDR::Fixed::digit ( int n,
int value )
inline

◆ div_helper1()

ACE_CDR::Fixed ACE_CDR::Fixed::div_helper1 ( const Fixed & rhs,
Fixed & r ) const
private

◆ div_helper2()

ACE_CDR::Fixed ACE_CDR::Fixed::div_helper2 ( const Fixed & rhs,
Fixed & r ) const
private

◆ end() [1/2]

ACE_CDR::Fixed::Iterator ACE_CDR::Fixed::end ( )
inline

◆ end() [2/2]

ACE_CDR::Fixed::ConstIterator ACE_CDR::Fixed::end ( ) const
inline

◆ equal()

bool ACE_CDR::Fixed::equal ( const Fixed & rhs) const

◆ fixed_digits()

ACE_CDR::UShort ACE_CDR::Fixed::fixed_digits ( ) const
inline

◆ fixed_scale()

ACE_CDR::UShort ACE_CDR::Fixed::fixed_scale ( ) const
inline

◆ from_floating()

ACE_CDR::Fixed ACE_CDR::Fixed::from_floating ( LongDouble val)
static

◆ from_integer() [1/2]

ACE_CDR::Fixed ACE_CDR::Fixed::from_integer ( ACE_CDR::LongLong val = 0)
static

◆ from_integer() [2/2]

ACE_CDR::Fixed ACE_CDR::Fixed::from_integer ( ACE_CDR::ULongLong val)
static

◆ from_octets()

ACE_CDR::Fixed ACE_CDR::Fixed::from_octets ( const Octet * array,
int len,
unsigned int scale = 0 )
static

◆ from_string()

ACE_CDR::Fixed ACE_CDR::Fixed::from_string ( const char * str)
static

◆ join()

ACE_CDR::Fixed ACE_CDR::Fixed::join ( int digits,
const Fixed & bottom ) const
private

◆ less()

bool ACE_CDR::Fixed::less ( const Fixed & rhs) const

◆ lshift()

int ACE_CDR::Fixed::lshift ( int digits)
private

Add up to 'digits' of additional scale by shifting left without removing significant digits. Returns number of digits shifted.

◆ ltrim()

void ACE_CDR::Fixed::ltrim ( )
inlineprivate

◆ normalize()

void ACE_CDR::Fixed::normalize ( UShort min_scale = 0)
private

remove trailing zeros, shift down and reduce digits and scale

◆ operator LongDouble()

ACE_CDR::Fixed::operator LongDouble ( ) const

◆ operator LongLong()

ACE_CDR::Fixed::operator LongLong ( ) const

◆ operator!()

bool ACE_CDR::Fixed::operator! ( ) const

◆ operator*=()

ACE_CDR::Fixed & ACE_CDR::Fixed::operator*= ( const Fixed & rhs)

◆ operator+()

ACE_CDR::Fixed ACE_CDR::Fixed::operator+ ( ) const
inline

◆ operator++() [1/2]

ACE_CDR::Fixed & ACE_CDR::Fixed::operator++ ( )

◆ operator++() [2/2]

ACE_CDR::Fixed ACE_CDR::Fixed::operator++ ( int )
inline

◆ operator+=()

ACE_CDR::Fixed & ACE_CDR::Fixed::operator+= ( const Fixed & rhs)

◆ operator-()

ACE_CDR::Fixed ACE_CDR::Fixed::operator- ( ) const
inline

◆ operator--() [1/2]

ACE_CDR::Fixed & ACE_CDR::Fixed::operator-- ( )

◆ operator--() [2/2]

ACE_CDR::Fixed ACE_CDR::Fixed::operator-- ( int )
inline

◆ operator-=()

ACE_CDR::Fixed & ACE_CDR::Fixed::operator-= ( const Fixed & rhs)

◆ operator/=()

ACE_CDR::Fixed & ACE_CDR::Fixed::operator/= ( const Fixed & rhs)

◆ pre_add()

ACE_CDR::Fixed::ConstIterator ACE_CDR::Fixed::pre_add ( const Fixed & f)
private

Prepare to add (or subtract) f by changing the digits and scale of *this, returnins an iterator to the least significant digit of f that will influence the sum (or difference).

◆ round()

ACE_CDR::Fixed ACE_CDR::Fixed::round ( UShort scale) const

◆ sign()

bool ACE_CDR::Fixed::sign ( ) const
inline

◆ to_octets()

const ACE_CDR::Octet * ACE_CDR::Fixed::to_octets ( int & n) const

◆ to_string()

bool ACE_CDR::Fixed::to_string ( char * buffer,
size_t buffer_size ) const

◆ truncate()

ACE_CDR::Fixed ACE_CDR::Fixed::truncate ( UShort scale) const

Member Data Documentation

◆ digits_

Octet ACE_CDR::Fixed::digits_
private

digits_ is not marshaled, the receiver needs to know it from the type information (for example, IDL). The value of digits_ determines how many octets of value_ are masharled.

◆ NEGATIVE

const Octet ACE_CDR::Fixed::NEGATIVE = 0xd
static

◆ POSITIVE

const Octet ACE_CDR::Fixed::POSITIVE = 0xc
static

◆ scale_

Octet ACE_CDR::Fixed::scale_
private

scale_ is not marshaled, the receiver needs to know it from the type information (for example, IDL).

◆ value_

Octet ACE_CDR::Fixed::value_[16]
private

CDR wire format for Fixed: marshaled as an octet array with index 0 as the most significant octet and index n the least significant. Each octet contains two decimal digits except for the last octet (least sig) which has one decimal digit in the high nibble and the sign indicator in the low nibble.


The documentation for this class was generated from the following files: