Bifrost SDK
Bifrost SDK documentation
DebugDump.h
Go to the documentation of this file.
1//-
2//*****************************************************************************
3// Copyright (c) 2024 Autodesk, Inc.
4// All rights reserved.
5//
6// Use of this software is subject to the terms of the Autodesk license
7// agreement provided at the time of installation or download, or which
8// otherwise accompanies this software in either electronic or hard copy form.
9// =============================================================================
10//+
11
12//
17
18#ifndef BIFROST_GEOMETRY_DEBUG_DUMP_H
19#define BIFROST_GEOMETRY_DEBUG_DUMP_H
20
22
24
25namespace Bifrost {
26namespace Geometry {
27namespace Internal {
28struct BIFROST_GEOMETRY_DECL DebugDumpInterface {
29 virtual ~DebugDumpInterface();
30 virtual void write(const char* data, size_t size) = 0;
31};
32BIFROST_GEOMETRY_DECL void debugDumpToStream(DebugDumpInterface& io, const Bifrost::Object& object, size_t sampleSize);
33} // namespace Internal
34
35
43template <typename OStream>
44inline void debugDump(OStream& os, Bifrost::Object const& object, size_t sampleSize = 10) {
45 struct DebugDumpStream : public Internal::DebugDumpInterface {
46 explicit DebugDumpStream(OStream& os_) : m_os(os_) {}
47 void write(const char* data, size_t size) override { m_os.write(data, size); }
48 OStream& m_os;
49 };
50 DebugDumpStream vos{os};
51 Internal::debugDumpToStream(vos, object, sampleSize);
52}
54
55} // namespace Geometry
56} // namespace Bifrost
57
58#endif // BIFROST_DEBUG_DUMP_H
Definition of macros for symbol visibility.
#define BIFROST_GEOMETRY_DECL
Bifrost object interface declaration.
void debugDump(OStream &os, Bifrost::Object const &object, size_t sampleSize=10)
Definition: DebugDump.h:44
Definition: FCurve.h:35
An interface for dictionary-like objects.
Definition: Object.h:59