summaryrefslogtreecommitdiff
path: root/ACE/ace/CDR_Base.h
diff options
context:
space:
mode:
authorAdam Mitz <mitza@ociweb.com>2015-03-27 17:01:22 -0500
committerAdam Mitz <mitza@ociweb.com>2015-03-27 17:01:22 -0500
commit6b5c388813e1bbac774902e449d1a9f3c25fff96 (patch)
tree217b9ef9b9003ca757c59fca90d75ffb18534039 /ACE/ace/CDR_Base.h
parent308544833e69154ae835dd7d818f558d648e5148 (diff)
downloadATCD-6b5c388813e1bbac774902e449d1a9f3c25fff96.tar.gz
Work in progress on supporting the fixed type in ACE_CDR and TAO_IDL_FE.
Diffstat (limited to 'ACE/ace/CDR_Base.h')
-rw-r--r--ACE/ace/CDR_Base.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/ACE/ace/CDR_Base.h b/ACE/ace/CDR_Base.h
index cafc9cace14..ab243515c2a 100644
--- a/ACE/ace/CDR_Base.h
+++ b/ACE/ace/CDR_Base.h
@@ -36,6 +36,7 @@
#include "ace/Basic_Types.h"
#include "ace/Default_Constants.h"
#include "ace/Global_Macros.h"
+#include "ace/iosfwd.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -351,6 +352,41 @@ public:
};
# endif /* ACE_SIZEOF_LONG_DOUBLE != 16 */
+ class ACE_Export Fixed
+ {
+ public:
+ static const Octet POSITIVE = 0xc, NEGATIVE = 0xd;
+
+ static Fixed from_int (LongLong val = 0);
+ static Fixed from_int (ULongLong val);
+ static Fixed from_string (const char *str);
+
+ Octet& scale () { return scale_; }
+ Octet scale () const { return scale_; }
+
+ bool operator== (const Fixed &rhs) const;
+
+ friend ACE_Export
+ ACE_OSTREAM_TYPE &::operator<< (ACE_OSTREAM_TYPE &lhs,
+ const Fixed &rhs);
+
+ private:
+ static const Octet UNUSED = 0xff;
+
+ /// 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 (after least sig) which has one decimal digit in
+ /// the high nibble and the sign indicator in the low nibble.
+ /// Octets at the start of the array with the value UNUSED are not
+ /// marshalled.
+ Octet value_[16];
+
+ /// Scale is not marshaled, the receiver needs to know it
+ /// from the type information (for example, IDL).
+ Octet scale_;
+ };
+
//@}
#if !defined (ACE_CDR_GIOP_MAJOR_VERSION)