MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
numberDatatypeRep.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1992-2024 MAK Technologies, Inc
3 ** All rights reserved.
4 *******************************************************************************/
7 #pragma once
8 
9 
10 
11 #include "datatypeRep.h"
12 
13 #include <vlutil/vlUtil.h>
14 
18 {
19 public:
20 
21  DtNumberDatatypeRep(bool useImplicitPadding);
23 
26  virtual double numberRep(const void* ptr, int* size = nullptr) const = 0;
27 
29  virtual int sizeNeeded(const void* ptr) const = 0;
30 
31 protected:
32 
35  int adjustedSizeNeeded(const void* ptr, int repSize) const;
36 
37 };
38 
39 inline DtNumberDatatypeRep::DtNumberDatatypeRep(bool useImplicitPadding)
40  : DtDatatypeRep(useImplicitPadding)
41 {
42 }
43 
45  : DtDatatypeRep(orig)
46 {
47 }
48 
49 inline int DtNumberDatatypeRep::adjustedSizeNeeded(const void* ptr, int repSize) const
50 {
51  int neededSize = repSize;
53  {
54  const char* alignedPtr = reinterpret_cast<const char*>(alignPtr(ptr, repSize));
55  neededSize += (alignedPtr - (const char*)ptr);
56  }
57 
58  return neededSize;
59 }
60 
61 
62 
63 
64 
A type of datatype that can turn itself into a number (double) representation.
Definition: numberDatatypeRep.h:17
DtNumberDatatypeRep(bool useImplicitPadding)
Definition: numberDatatypeRep.h:39
#define DT_DLL_OMTREADER
Definition: omtReader.h:23
A Datatype Representation is a class that can take a group of bytes and display them in a certain typ...
Definition: datatypeRep.h:20
int adjustedSizeNeeded(const void *ptr, int repSize) const
Definition: numberDatatypeRep.h:49
bool myUseImplicitPadding
Definition: datatypeRep.h:54

Document ID: Generated on Fri May 31 15:45:35 EDT 2024 from SVN revision 266500
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)