ACE
6.3.3
|
#include <CDR_Base.h>
Classes | |
class | ConstIterator |
class | Iterator |
class | IteratorBase |
class | Proxy |
Public Types | |
enum | { MAX_DIGITS = 31, MAX_STRING_SIZE = 4 + MAX_DIGITS, POSITIVE = 0xc, NEGATIVE = 0xd } |
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 Octet * | to_octets (int &n) const |
Fixed & | operator+= (const Fixed &rhs) |
Fixed & | operator-= (const Fixed &rhs) |
Fixed & | operator*= (const Fixed &rhs) |
Fixed & | operator/= (const Fixed &rhs) |
Fixed & | operator++ () |
Fixed | operator++ (int) |
Fixed & | operator-- () |
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) |
Private Member Functions | |
void | normalize (UShort min_scale=0) |
remove trailing zeros, shift down and reduce digits and scale More... | |
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_ |
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 middlware 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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
inline |
|
inline |
bool ACE_CDR::Fixed::equal | ( | const Fixed & | rhs | ) | const |
|
inline |
|
inline |
|
static |
|
static |
|
static |
|
static |
|
static |
|
private |
bool ACE_CDR::Fixed::less | ( | const Fixed & | rhs | ) | const |
|
private |
Add up to 'digits' of additional scale by shifting left without removing significant digits. Returns number of digits shifted.
|
inlineprivate |
|
private |
remove trailing zeros, shift down and reduce digits and scale
ACE_CDR::Fixed::operator LongDouble | ( | ) | const |
ACE_CDR::Fixed::operator LongLong | ( | ) | const |
bool ACE_CDR::Fixed::operator! | ( | ) | const |
ACE_CDR::Fixed & ACE_CDR::Fixed::operator*= | ( | const Fixed & | rhs | ) |
|
inline |
ACE_CDR::Fixed & ACE_CDR::Fixed::operator++ | ( | ) |
|
inline |
ACE_CDR::Fixed & ACE_CDR::Fixed::operator+= | ( | const Fixed & | rhs | ) |
|
inline |
ACE_CDR::Fixed & ACE_CDR::Fixed::operator-- | ( | ) |
|
inline |
ACE_CDR::Fixed & ACE_CDR::Fixed::operator-= | ( | const Fixed & | rhs | ) |
ACE_CDR::Fixed & ACE_CDR::Fixed::operator/= | ( | const Fixed & | rhs | ) |
|
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).
ACE_CDR::Fixed ACE_CDR::Fixed::round | ( | UShort | scale | ) | const |
|
inline |
const ACE_CDR::Octet * ACE_CDR::Fixed::to_octets | ( | int & | n | ) | const |
bool ACE_CDR::Fixed::to_string | ( | char * | buffer, |
size_t | buffer_size | ||
) | const |
ACE_CDR::Fixed ACE_CDR::Fixed::truncate | ( | UShort | scale | ) | const |
|
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.
|
private |
scale_ is not marshaled, the receiver needs to know it from the type information (for example, IDL).
|
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.