Go to the documentation of this file.
2 #define _OME_FIXED_H "$Id: OMEfixed.h 312 2020-03-21 21:25:35Z geoff $"
19 # ifndef MAPM_LIB_VERSION
20 typedef struct M_APM_struct *
M_APM;
70 explicit operator char *()
const;
72 char *
asStringText(
char *bfr, uint_fast16_t bfrLen)
const;
74 template <
typename STREAMTYPE> STREAMTYPE &
outputOnStream(STREAMTYPE &outputStream, int_fast16_t indent = 0)
const
78 outputStream <<
asStringText(outString,
sizeof(outString));
79 return (outputStream);
145 if (this->data == arg.
data) {
146 std::cerr <<
"OMEfixed assignment to self, ref=" <<
totalReferences() <<
"\n";
179 if (data == arg.
data) {
182 return (*data == *arg.
data);
187 if (data == arg.
data) {
190 return (*data != *arg.
data);
195 return (*data < *arg.
data);
200 return (*data > *arg.
data);
205 return (*data <= *arg.
data);
210 return (*data >= *arg.
data);
241 explicit operator double()
const;
243 explicit operator float()
const;
245 explicit operator int32_t()
const;
247 explicit operator int64_t()
const;
249 explicit operator uint64_t()
const;
251 explicit operator uint32_t()
const;
253 explicit operator uint16_t()
const;
255 explicit operator uint8_t()
const;
260 template <
typename STREAMTYPE> STREAMTYPE &
outputOnStream(STREAMTYPE &outputStream, int_fast16_t indent = 0)
const
262 data->outputOnStream(outputStream, indent);
263 return (outputStream);
267 template <
typename STREAMTYPE>
271 return (outputStream);
OME reference count implementation.
#define ALT_DIR_SEP
Definition: OMEfindFile.cpp:25
virtual OMEreferenceCount * deepCopy() const override
Definition: OMEfixed.cpp:48
OMEfixed(const double d)
Definition: OMEfixed.h:125
OMEfixed(const char *numberText)
Definition: OMEfixed.h:135
OMEfixed & operator=(const uint32_t ui)
Definition: OMEfixed.h:162
OMEfixed & operator-=(const OMEfixed &arg)
Definition: OMEfixed.cpp:168
const char s[]
Definition: t.cpp:4
bool operator!=(const OMEfixed &arg) const
Definition: OMEfixed.h:185
OMEtype operator/(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:40694
bool operator<=(const OMEfixed &arg) const
Definition: OMEfixed.h:203
OMEfixed * deepCopy() const
Definition: OMEfixed.h:213
OMEfixed & operator/=(const OMEfixed &arg)
Definition: OMEfixed.cpp:218
#define NATIVE_DIR_SEP
Definition: OMEfindFile.cpp:24
void addReadOnlyReference() OME_ALWAYS_INLINE
Definition: OMErefCount.h:84
Implements text and binary string storage.
Definition: OMEstring.h:305
bool operator>=(const OMEfixed &arg) const
Definition: OMEfixed.h:208
OMEfixed & operator=(const OMEfixed &arg)
Definition: OMEfixed.h:143
OMEfixed()
Definition: OMEfixed.h:94
OMEfixedStorage * data
Definition: OMErefCount.h:82
bool indexExists(const uint32_t i) const
Definition: OMEarray.h:202
OMEtype & operator/=(OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:30582
Fundamental ANY type for FARGOS/VISTA Object Management Environment.
Definition: OMEbaseType.h:250
OMEfixed(M_APM newVal)
Definition: OMEfixed.h:130
STREAMTYPE & outputOnStream(STREAMTYPE &outputStream, int_fast16_t indent=0) const
Definition: OMEfixed.h:74
void determineCharacterSet()
Definition: OMEstring.h:391
OMEarray * OMElistDirectory(const OMEstring &dirName, int *errRet)
List all files within a filesystem directory.
Definition: OMEfindFile.cpp:112
class OMEstring * s
Definition: OMEbaseType.h:299
#define INVALID_HANDLE_VALUE
Definition: poll_monitor.hpp:19
OME fixed point number implementation.
bool operator>=(const OMEfixedStorage &arg) const
Definition: OMEfixed.cpp:91
Templated type-specific reference to a reference-counted object.
Definition: OMErefCount.h:79
Reference-counted storage for OMEfixedStorage type.
Definition: OMEfixed.h:34
OMEtype & operator-=(OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:24618
Base class for reference-counted data.
Definition: OMErefCount.h:31
OMEfixed(OMEfixedStorage *f)
Definition: OMEfixed.h:88
OMEfixed & operator*=(const OMEfixed &arg)
Definition: OMEfixed.cpp:193
OMEfixed(const OMEfixed &org)
Definition: OMEfixed.h:99
int_fast32_t totalReferences() const OME_ALWAYS_INLINE
Get current reference total.
Definition: OMErefCount.h:141
const char srcID[]
Definition: catSym.c:17
bool operator>(const OMEfixedStorage &arg) const
Definition: OMEfixed.cpp:115
@ OME_STRING
Definition: OMEmanifests.h:85
char * asStringText(char *bfr, uint_fast16_t bfrLen) const
Definition: OMEfixed.cpp:127
bool operator<=(const OMEfixedStorage &arg) const
Definition: OMEfixed.cpp:79
STREAMTYPE & outputOnStream(STREAMTYPE &outputStream, int_fast16_t indent=0) const
Definition: OMEfixed.h:260
bool operator<(const OMEfixedStorage &arg) const
Definition: OMEfixed.cpp:103
OMEtype & operator*=(OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:29166
bool operator!=(const OMEfixedStorage &arg) const
Definition: OMEfixed.cpp:67
OME fundamental type implementation.
OMEfixed operator-(const OMEfixed &arg) const
Definition: OMEfixed.cpp:250
size_t length() const
Definition: OMEstring.h:401
OMEfixed & operator=(const double d)
Definition: OMEfixed.h:169
const char srcID[] OME_USED
Definition: tick_time.cpp:24
OMEstring * OMEfindFileInDirectory(const OMEstring &fileName, const OMEarray &dirNames)
Search for a file located within a list of directories specified as elements of an OMEarray.
Definition: OMEfindFile.cpp:292
OMEtype operator+(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:33691
OMEtype operator-(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:36699
STREAMTYPE & operator<<(STREAMTYPE &outputStream, const OMEfixed &data)
Definition: OMEfixed.h:268
OMEfixed(const int64_t i64)
Definition: OMEfixed.h:115
OMEstring * OMEfindFileInPathSpec(const OMEstring &fileName, const OMEstring &path)
Search for a file located within a set of directories specified by a string path.
Definition: OMEfindFile.cpp:344
void addReadOnlyReference()
Definition: OMErefCount.cpp:139
M_APM numberData
Definition: OMEfixed.h:39
int errno
Definition: ethers.c:41
OMEfixed & operator+=(const OMEfixed &arg)
Definition: OMEfixed.cpp:143
#define OME_EXPECT_FALSE(expr)
Annotation macro for conditional expression expected to be false.
Definition: compiler_hints.h:540
bool operator>(const OMEfixed &arg) const
Definition: OMEfixed.h:198
Public interface to OME fixed-point type.
Definition: OMEfixed.h:85
class OMEtype * OMEbaseTypeP
Definition: OMEfixed.h:17
void dropReference(OMEfixedStorage *newData=nullptr) OME_ALWAYS_INLINE
Definition: OMErefCount.h:91
OMEfixed(const uint32_t ui)
Definition: OMEfixed.h:110
OMEfixed(const uint64_t ui64)
Definition: OMEfixed.h:120
#define _OME_FIXED_H
Definition: tmp.o.cpp:967
OMEtype & operator+=(OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:21683
OMEfixed operator*(const OMEfixed &arg) const
Definition: OMEfixed.cpp:257
~OMEfixedStorage()
Definition: OMEfixed.cpp:43
#define OME_DLL_EXPORT
Definition: compiler_hints.h:464
Implements sparse array of OMEtype elements.
Definition: OMEarray.h:75
bool operator<(const OMEfixed &arg) const
Definition: OMEfixed.h:193
bool operator==(const OMEfixedStorage &arg) const
Definition: OMEfixed.cpp:55
OMEtype operator*(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:39283
uint32_t type
Definition: OMEbaseType.h:304
struct M_APM_struct * M_APM
Definition: OMEfixed.h:20
OMEfixed & operator=(const int32_t i)
Definition: OMEfixed.h:155
OMEfixed(const int32_t i)
Definition: OMEfixed.h:105
OMEarrayStorage::ARRAY_SUBSCRIPT_t ARRAY_SUBSCRIPT_t
Definition: OMEarray.h:90
Internal data type to generate fixed-point constant from floating-point value.
Definition: OMEfixed.h:26
double d
Definition: OMEfixed.h:27
OMEfixedStorage()
Definition: OMEfixed.cpp:9
~OMEfixed()
Definition: OMEfixed.h:140
OMEarray * OMEparsePathSpecification(const OMEstring &spec)
Parse a list of directories specified by a string path into an sequence of OMEarray elements.
Definition: OMEfindFile.cpp:236
OMEfixed operator+(const OMEfixed &arg) const
Definition: OMEfixed.cpp:243
OMEfixed operator/(const OMEfixed &arg) const
Definition: OMEfixed.cpp:264
bool operator==(const OMEfixed &arg) const
Definition: OMEfixed.h:177