CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
ComPackSignedExpFloat.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: ComPackSignedExpFloat.h,v 1.2 2009/12/23 02:59:56 zhangy Exp $
4//
5// Description:
6// class ComPackSignedExpFloat; Uses ComPackExpFloat to store the
7// magnitude of a signed quantity, then adds in the sign.
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Author List:
12// Dave Brown 10/12/00
13//
14// Copyright Information:
15// Copyright (C) 2000 LBNL
16//
17// History:
18// Migration for BESIII MDC
19//
20//
21//--------------------------------------------------------------------------
22
23#ifndef COMPACKSIGNEDEXPFLOAT_HH
24#define COMPACKSIGNEDEXPFLOAT_HH
25
27#include <iostream>
28
29class ComPackSignedExpFloat:public ComPackBase<double> {
30
31public:
32// See ComPackExpFloat for an explanation. Note that in this class, the number
33// of bits should include 1 for the sign. The invert flag specifies that the best
34// resolution should occur at the +-maxval end of the range instead of around 0.
35 ComPackSignedExpFloat(unsigned nbits,
36 unsigned maxexponent,
37 double maxval,
38 bool invert=false,
39 bool center=false );
40 virtual ~ComPackSignedExpFloat();
41// ComPackBase functions
42 virtual StatusCode pack (const double, d_ULong &) const;
43 virtual StatusCode unpack (const d_ULong, double &) const;
44 void print(std::ostream& s=std::cout) const;
45private:
46// This class uses ComPackExpFloat to do the dirty work
47 ComPackExpFloat _packer;
48 unsigned _signbit; // sign bits location
49 unsigned _signmask; // mask for positive
50};
51
52#endif
53
54
55
56
57
58
unsigned int d_ULong
XmlRpcServer s
virtual StatusCode unpack(const d_ULong, double &) const
ComPackSignedExpFloat(unsigned nbits, unsigned maxexponent, double maxval, bool invert=false, bool center=false)
void print(std::ostream &s=std::cout) const
virtual StatusCode pack(const double, d_ULong &) const