19 virtual void WriteBytes(
const void *inData,
size_t inNumBytes) = 0;
25 template <
class T, std::enable_if_t<std::is_trivially_copyable_v<T>,
bool> = true>
28 WriteBytes(&inT,
sizeof(inT));
32 template <
class T,
class A, std::enable_if_t<std::is_trivially_copyable_v<T>,
bool> = true>
39 if constexpr (std::is_same_v<T, Vec3> || std::is_same_v<T, DVec3> || std::is_same_v<T, DMat44>)
48 WriteBytes(inT.
data(), len *
sizeof(T));
54 template <
class Type,
class Traits,
class Allocator>
55 void Write(
const std::basic_string<Type, Traits, Allocator> &inString)
60 WriteBytes(inString.data(), len *
sizeof(Type));
64 template <
class T,
class A,
typename F>
71 inWriteElement(inT[i], *
this);
77 WriteBytes(&inVec, 3 *
sizeof(
float));
83 WriteBytes(&inVec, 3 *
sizeof(
double));
#define JPH_EXPORT
Definition: Core.h:236
#define JPH_NAMESPACE_END
Definition: Core.h:378
std::uint32_t uint32
Definition: Core.h:455
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:372
size_t size_type
Definition: Array.h:39
const T * data() const
Definition: Array.h:442
size_type size() const
Returns amount of elements in the array.
Definition: Array.h:318
Holds a 4x4 matrix of floats with the last column consisting of doubles.
Definition: DMat44.h:13
JPH_INLINE Vec4 GetColumn4(uint inCol) const
Definition: DMat44.h:115
JPH_INLINE DVec3 GetTranslation() const
Definition: DMat44.h:111
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition: NonCopyable.h:11
Simple binary output stream.
Definition: StreamOut.h:13
void Write(const Vec3 &inVec)
Write a Vec3 (don't write W)
Definition: StreamOut.h:75
void Write(const DMat44 &inVec)
Write a DMat44 (don't write W component of translation)
Definition: StreamOut.h:87
void Write(const Array< T, A > &inT, const F &inWriteElement)
Write a vector of primitives to the binary stream using a custom write function.
Definition: StreamOut.h:65
virtual bool IsFailed() const =0
Returns true if there was an IO failure.
void Write(const DVec3 &inVec)
Write a DVec3 (don't write W)
Definition: StreamOut.h:81
void Write(const T &inT)
Write a primitive (e.g. float, int, etc.) to the binary stream.
Definition: StreamOut.h:26
void Write(const Array< T, A > &inT)
Write a vector of primitives to the binary stream.
Definition: StreamOut.h:33
virtual void WriteBytes(const void *inData, size_t inNumBytes)=0
Write a string of bytes to the binary stream.
void Write(const std::basic_string< Type, Traits, Allocator > &inString)
Write a string to the binary stream (writes the number of characters and then the characters)
Definition: StreamOut.h:55
virtual ~StreamOut()=default
Virtual destructor.