Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
ObjectStreamBinaryOut.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8
10
13{
14public:
16
18 explicit ObjectStreamBinaryOut(ostream &inStream);
19
21 virtual void WriteDataType(EOSDataType inType) override;
22 virtual void WriteName(const char *inName) override;
23 virtual void WriteIdentifier(Identifier inIdentifier) override;
24 virtual void WriteCount(uint32 inCount) override;
25
26 virtual void WritePrimitiveData(const uint8 &inPrimitive) override;
27 virtual void WritePrimitiveData(const uint16 &inPrimitive) override;
28 virtual void WritePrimitiveData(const int &inPrimitive) override;
29 virtual void WritePrimitiveData(const uint32 &inPrimitive) override;
30 virtual void WritePrimitiveData(const uint64 &inPrimitive) override;
31 virtual void WritePrimitiveData(const float &inPrimitive) override;
32 virtual void WritePrimitiveData(const double &inPrimitive) override;
33 virtual void WritePrimitiveData(const bool &inPrimitive) override;
34 virtual void WritePrimitiveData(const String &inPrimitive) override;
35 virtual void WritePrimitiveData(const Float3 &inPrimitive) override;
36 virtual void WritePrimitiveData(const Double3 &inPrimitive) override;
37 virtual void WritePrimitiveData(const Vec3 &inPrimitive) override;
38 virtual void WritePrimitiveData(const DVec3 &inPrimitive) override;
39 virtual void WritePrimitiveData(const Vec4 &inPrimitive) override;
40 virtual void WritePrimitiveData(const Quat &inPrimitive) override;
41 virtual void WritePrimitiveData(const Mat44 &inPrimitive) override;
42 virtual void WritePrimitiveData(const DMat44 &inPrimitive) override;
43
44private:
45 using StringTable = UnorderedMap<String, uint32>;
46
47 StringTable mStringTable;
48 uint32 mNextStringID = 0x80000000;
49};
50
uint32_t uint32
Definition Core.h:312
#define JPH_NAMESPACE_END
Definition Core.h:240
uint8_t uint8
Definition Core.h:310
uint16_t uint16
Definition Core.h:311
uint64_t uint64
Definition Core.h:313
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:29
std::basic_string< char, std::char_traits< char >, STLAllocator< char > > String
Definition STLAllocator.h:82
EOSDataType
Data type.
Definition SerializableAttribute.h:15
std::unordered_map< Key, T, Hash, KeyEqual, STLAllocator< pair< const Key, T > > > UnorderedMap
Definition UnorderedMap.h:13
Holds a 4x4 matrix of floats with the last column consisting of doubles.
Definition DMat44.h:13
Definition DVec3.h:14
Class that holds 3 doubles. Used as a storage class. Convert to DVec3 for calculations.
Definition Double3.h:13
Class that holds 3 floats. Used as a storage class. Convert to Vec3 for calculations.
Definition Float3.h:13
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
Implementation of ObjectStream binary output stream.
Definition ObjectStreamBinaryOut.h:13
virtual void WriteDataType(EOSDataType inType) override
Definition ObjectStreamBinaryOut.cpp:20
virtual void WritePrimitiveData(const uint8 &inPrimitive) override
Definition ObjectStreamBinaryOut.cpp:40
virtual void WriteName(const char *inName) override
Definition ObjectStreamBinaryOut.cpp:25
JPH_OVERRIDE_NEW_DELETE ObjectStreamBinaryOut(ostream &inStream)
Constructor and destructor.
Definition ObjectStreamBinaryOut.cpp:12
virtual void WriteCount(uint32 inCount) override
Definition ObjectStreamBinaryOut.cpp:35
virtual void WriteIdentifier(Identifier inIdentifier) override
Definition ObjectStreamBinaryOut.cpp:30
uint32 Identifier
Identifier for objects.
Definition ObjectStream.h:30
Definition ObjectStreamOut.h:24
Definition Quat.h:33
Definition Vec3.h:16
Definition Vec4.h:14