AGX Dynamics
2.38.0.2
XMLOutputArchive.h
Go to the documentation of this file.
1
/*
2
Copyright 2007-2024. Algoryx Simulation AB.
3
4
All AGX source code, intellectual property, documentation, sample code,
5
tutorials, scene files and technical white papers, are copyrighted, proprietary
6
and confidential material of Algoryx Simulation AB. You may not download, read,
7
store, distribute, publish, copy or otherwise disseminate, use or expose this
8
material unless having a written signed agreement with Algoryx Simulation AB, or having been
9
advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10
valid commercial license from Algoryx Simulation AB.
11
12
Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13
from using this software, unless otherwise stated in written agreements with
14
Algoryx Simulation AB.
15
*/
16
17
#pragma once
18
19
20
#ifdef _MSC_VER
21
# pragma warning( push )
22
# pragma warning( disable : 4290 )
23
#endif
24
25
#include <
agx/agxPhysics_export.h
>
26
27
28
#include <string>
29
#include <sstream>
30
31
#include <
agx/byteswap.h
>
32
#include <
agxStream/OutputArchive.h
>
33
34
namespace
agx
35
{
36
class
TiXmlNode;
37
class
TiXmlElement;
38
class
TiXmlDocument;
39
class
Uuid;
40
}
41
42
43
namespace
agxStream
44
{
45
51
class
AGXCORE_EXPORT
XMLOutputArchive
:
public
OutputArchive
52
{
53
public
:
54
61
XMLOutputArchive
( std::ostream& outputStream ) ;
62
XMLOutputArchive
( std::ostream& outputStream,
ObjectToIdMapContext
& mapCache );
63
64
65
virtual
void
write
(
char
val ) ;
66
virtual
void
write
(
bool
val ) ;
67
virtual
void
write
(
agx::UInt8
val ) ;
68
virtual
void
write
(
agx::Int8
val ) ;
69
virtual
void
write
(
agx::Int16
val ) ;
70
virtual
void
write
(
agx::UInt16
val ) ;
71
72
virtual
void
write
(
agx::UInt32
val ) ;
73
virtual
void
write
(
agx::Int32
val ) ;
74
75
virtual
void
write
(
agx::UInt64
val ) ;
76
virtual
void
write
(
agx::Int64
val ) ;
77
virtual
void
write
(
float
val ) ;
78
virtual
void
write
(
double
val ) ;
79
80
virtual
void
write
(
const
char
* val ) ;
81
virtual
void
write
(
const
std::string& val ) ;
82
83
virtual
void
write
(
const
agx::Vec3f
& val ) ;
84
virtual
void
write
(
const
agx::Vec3d
& val ) ;
85
virtual
void
write
(
const
agx::Uuid
& val ) ;
86
97
virtual
void
write
(
const
void
* buf,
size_t
len ) ;
98
99
using
OutputArchive::write
;
100
101
virtual
void
beginSection(
const
char
* title );
102
virtual
void
endSection(
const
char
* title );
103
104
105
virtual
void
addAttribute(
const
char
*name,
bool
value);
106
virtual
void
addAttribute(
const
char
*name,
const
char
* value);
107
virtual
void
addAttribute(
const
char
*name,
char
value);
108
virtual
void
addAttribute(
const
char
*name,
agx::UInt8
value);
109
virtual
void
addAttribute(
const
char
*name,
agx::Int8
value);
110
virtual
void
addAttribute(
const
char
*name,
agx::UInt16
value);
111
virtual
void
addAttribute(
const
char
*name,
agx::UInt32
value);
112
virtual
void
addAttribute(
const
char
*name,
agx::Int32
value);
113
virtual
void
addAttribute(
const
char
*name,
agx::UInt64
value);
114
virtual
void
addAttribute(
const
char
*name,
float
value);
115
virtual
void
addAttribute(
const
char
*name,
double
value);
116
virtual
void
addAttribute(
const
char
*name,
const
agx::Uuid
& value);
117
119
void
close
() {
OutputArchive::close
(); flush(); }
120
protected
:
122
virtual
~
XMLOutputArchive
();
123
124
void
addString(
const
char
*str);
125
126
bool
flush();
127
128
// copy constructor and assignment operator prohibited
129
XMLOutputArchive
(
const
XMLOutputArchive
& );
130
XMLOutputArchive
& operator=(
const
XMLOutputArchive
& );
131
//void createXMLNode( const char *value );
132
133
private
:
134
135
agx::TiXmlDocument *m_document;
136
agx::TiXmlElement *m_element;
137
agx::TiXmlElement *m_parent;
138
agx::Int32
m_precision;
139
140
std::stringstream m_stringBuf;
141
142
};
143
typedef
agx::ref_ptr<XMLOutputArchive>
XMLOutputArchiveRef
;
144
145
}
146
147
#ifdef _MSC_VER
148
# pragma warning( pop )
149
#endif
agxPhysics_export.h
agx::UInt64
uint64_t UInt64
Definition:
Integer.h:33
AGXCORE_EXPORT
#define AGXCORE_EXPORT
agx::Int16
int16_t Int16
Definition:
Integer.h:36
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition:
AddedMassInteraction.h:22
agxStream::OutputArchive::ObjectToIdMapContext
This struct is used to handle id-collisions when using incremental journal.
Definition:
OutputArchive.h:76
agx::UInt16
uint16_t UInt16
Definition:
Integer.h:31
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition:
ref_ptr.h:29
agx::UInt8
uint8_t UInt8
Definition:
Integer.h:30
agxStream::OutputArchive::write
virtual void write(char val)
agxStream::XMLOutputArchive
XML version of an OutputArchive (for storing serialized objects).
Definition:
XMLOutputArchive.h:51
agxStream::XMLOutputArchive::close
void close()
Method for closing the archive, important to call this as it will flush the data to the outputstream.
Definition:
XMLOutputArchive.h:119
byteswap.h
agx::Int8
int8_t Int8
Definition:
Integer.h:35
agxStream::write
bool AGXPHYSICS_EXPORT write(const std::string &filename, const agxStream::Serializable *data)
Write a Serializable object to a file.
agxStream::OutputArchive
Class for writing serialized data in binary format to a stream.
Definition:
OutputArchive.h:56
agxStream::XMLOutputArchiveRef
agx::ref_ptr< XMLOutputArchive > XMLOutputArchiveRef
Definition:
XMLOutputArchive.h:143
agxStream
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
Definition:
ElementaryConstraint.h:31
agx::Int64
int64_t Int64
Definition:
Integer.h:38
OutputArchive.h
agx::Vec3T< Real32 >
agx::Uuid
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Definition:
Uuid.h:41
agx::Int32
int32_t Int32
Definition:
Integer.h:37
agx::UInt32
uint32_t UInt32
Definition:
Integer.h:32
agxStream::OutputArchive::close
void close() override
Call flush.
include
agxStream
XMLOutputArchive.h
Generated on Sun Sep 1 2024 11:19:06 for AGX Dynamics by
1.8.17