VR-Link API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
numberDatatypeRep.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1992-2025 MAK Technologies, Inc
3 ** All rights reserved.
4 *******************************************************************************/
7 #pragma once
8 
9 
10 
11 #include "datatypeRep.h"
12 #include "vlutil/vlUtil.h"
13 
14 #ifdef DtUSE_UTILITIES_NAMESPACE
15 namespace DtUSE_UTILITIES_NAMESPACE
16 {
17 #endif
22 {
23 public:
24 
25  DtNumberDatatypeRep(bool useImplicitPadding);
27 
28  virtual double numberRep(const void* ptr, int* size = 0) const = 0;
29 
31  virtual int sizeNeeded(const void* ptr) const = 0;
32 
33 protected:
34 
37  int adjustedSizeNeeded(const void* ptr, int repSize) const;
38 
39 };
40 
41 inline DtNumberDatatypeRep::DtNumberDatatypeRep(bool useImplicitPadding)
42  : DtDatatypeRep(useImplicitPadding)
43 {
44 }
45 
47  : DtDatatypeRep(orig)
48 {
49 }
50 
51 inline int DtNumberDatatypeRep::adjustedSizeNeeded(const void* ptr, int repSize) const
52 {
53  int neededSize = repSize;
55  {
56  const char* alignedPtr = reinterpret_cast<const char*>(alignPtr(ptr, repSize));
57  neededSize += (alignedPtr - (const char*)ptr);
58  }
59 
60  return neededSize;
61 }
62 
63 
64 #ifdef DtUSE_UTILITIES_NAMESPACE
65 } // end of namespace DtUSE_UTILITIES_NAMESPACE
66 #endif
A type of datatype that can turn itself into a number (double) representation.
Definition: numberDatatypeRep.h:21
DtNumberDatatypeRep(bool useImplicitPadding)
Definition: numberDatatypeRep.h:41
#define DT_DLL_OMTREADER
Definition: omtReader.h:27
A Datatype Representation is a class that can take a group of bytes and display them in a certain typ...
Definition: datatypeRep.h:24
const void * alignPtr(const void *ptr, DtMachineSize alignment)
Adjust the given pointer to the given byte alignment (in bytes)
Definition: vlUtil.h:382
provides basic Operating Independent Methods useful to a federate
int adjustedSizeNeeded(const void *ptr, int repSize) const
Definition: numberDatatypeRep.h:51
bool myUseImplicitPadding
Definition: datatypeRep.h:58

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)