VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fixedPointAngle.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 
12 template <typename T_Storage>
14 {
15 public:
17  DtFixedPointAngle(double v);
20  operator double() const;
21 
23  void setValue(double v);
24 
26  double value() const;
27 
29  double precision() const;
30 
33  int netRepSize() const;
34 
37  bool setFromNet(const char* contentBuffer,
38  unsigned contentSize = 0);
39 
43  bool setToNet(char* contentBuffer) const;
44 
45 private:
46  T_Storage myValue;
47 };
48 
49 namespace DtBufferSerialize
50 {
51  template <typename T_Storage>
52  const int getSize(const DtFixedPointAngle<T_Storage>& val);
53  template <typename T_Storage>
54  char* encode(const DtFixedPointAngle<T_Storage>& val, char* buffer);
55  template <typename T_Storage>
56  const char* decode(DtFixedPointAngle<T_Storage>& val, const char* buffer);
57 }
58 
63 
64 #include "vrfutil/fixedPointAngle.inl"
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
DtFixedPointAngle & operator=(const DtFixedPointAngle &rhs)
bool setToNet(char *contentBuffer) const
Fills in the network buffer with the task contents. Buffer must be allocated by the caller...
Hold a value in the range of [0, 2PI) in the number of bits specified used by T_Storage. This has the precision of 2PI / 2^16 Note: If set to any values outside the range, the value will be converted into the range [-PI, PI). For example, 2PI+1 will become 1. Template class allows for instantiation of angles with different precisions using different storage classes. T_Storage should be something like a DtU16, DtU32, etc.
Definition: fixedPointAngle.h:13
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer. buffer must have at least the number of bytes returned...
int netRepSize() const
Returns the size of the full network representation padded to an 8-byte boundary. ...
void setValue(double v)
Set the value of the angle in radians.
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
double value() const
The value of the angle in radians.
bool setFromNet(const char *contentBuffer, unsigned contentSize=0)
Fills in the task from the network buffer. Content size is not used.
double precision() const
T_Storage myValue
Definition: fixedPointAngle.h:46

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)