CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
OdBlob.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24// OdBlob.h: interface for the OdBlob class.
25//
27
28#ifndef _ODBLOB_H_INCLUDED_
29#define _ODBLOB_H_INCLUDED_
30
31#include "MemoryStreamImpl.h"
32#include "StaticRxObject.h"
33
34#include "Ge/GePoint2d.h"
35#include "Ge/GePoint3d.h"
36#include "Ge/GeVector3d.h"
37
38class OdDbStub;
39
44class FIRSTDLL_EXPORT OdBlob : public OdStaticRxObject<OdMemoryStreamImpl<OdMemoryStream> > //FELIX_CHANGE
45{
46public:
47 inline OdBlob(OdUInt32 nPageSize = 0x1000);
48
49 inline bool rdBool();
50 inline void wrBool(bool);
51 inline OdInt8 rdInt8();
52 inline void wrInt8(OdInt8);
53 inline OdInt16 rdInt16();
54 inline void wrInt16(OdInt16);
55 inline OdInt32 rdInt32();
56 inline void wrInt32(OdInt32);
57 inline OdInt64 rdInt64();
58 inline void wrInt64(OdInt64);
59 inline double rdDouble();
60 inline void wrDouble(double);
61 inline OdGePoint3d rdPoint3d();
62 inline void wrPoint3d(const OdGePoint3d&);
63 inline OdGeVector3d rdVector3d();
64 inline void wrVector3d(const OdGeVector3d&);
65 inline void* rdAddress();
66 inline void wrAddress(const void*);
67
68 inline void rdBytes(void* buf, OdUInt32 len);
69 inline void wrBytes(const void* buf, OdUInt32 len);
70
71 inline void rdPoints2d(OdGePoint2d* points, OdUInt32 num);
72 inline void wrPoints2d(const OdGePoint2d* points, OdUInt32 num);
73
74 inline void rdPoints3d(OdGePoint3d* points, OdUInt32 num);
75 inline void wrPoints3d(const OdGePoint3d* points, OdUInt32 num);
76
77 inline void wrDoubles(const double* doubles, OdUInt32 num);
78 inline void rdDoubles(double* doubles, OdUInt32 num);
79
80 inline void rdObjectIds(OdDbStub** pRes, OdUInt32 num);
81 inline OdDbStub* rdObjectId();
82 inline void wrObjectId(const OdDbStub* id);
83};
84
85inline OdBlob::OdBlob(OdUInt32 nPageSize)
86{
87 setPageDataSize(nPageSize);
88}
89
90#define BLOB_DATA(type, name) \
91inline type OdBlob::rd##name() \
92{\
93 type val;\
94 getBytes(&val, sizeof(type));\
95 return val;\
96}\
97inline void OdBlob::wr##name(type val)\
98{ putBytes(&val, sizeof(type));}
99
100BLOB_DATA(bool, Bool)
101BLOB_DATA(OdInt8, Int8)
102BLOB_DATA(OdInt16, Int16)
103BLOB_DATA(OdInt32, Int32)
104BLOB_DATA(OdInt64, Int64)
105BLOB_DATA(double, Double)
106
107inline OdGePoint3d OdBlob::rdPoint3d()
108{
109 OdGePoint3d val;
110 getBytes(&val, sizeof(val));
111 return val;
112}
113
114inline void OdBlob::wrPoint3d(const OdGePoint3d& val)
115{ putBytes(&val, sizeof(OdGePoint3d));}
116
118{
119 OdGeVector3d val;
120 getBytes(&val, sizeof(val));
121 return val;
122}
123
124inline void OdBlob::wrVector3d(const OdGeVector3d& val)
125{ putBytes(&val, sizeof(OdGeVector3d));}
126
127
128inline void* OdBlob::rdAddress()
129{
130 void* val;
131 getBytes(&val, sizeof(void*));
132 return val;
133}
134
135inline void OdBlob::wrAddress(const void* val)
136{ putBytes(&val, sizeof(void*));}
137
138
139
140inline void OdBlob::rdBytes(void* buf, OdUInt32 len)
141{
142 getBytes(buf, len);
143}
144
145inline void OdBlob::wrBytes(const void* buf, OdUInt32 len)
146{
147 putBytes(buf, len);
148}
149
150inline void OdBlob::rdPoints3d(OdGePoint3d* points, OdUInt32 num)
151{
152 getBytes(points, num * sizeof(OdGePoint3d));
153}
154
155inline void OdBlob::wrPoints3d(const OdGePoint3d* points, OdUInt32 num)
156{
157 putBytes(points, num * sizeof(OdGePoint3d));
158}
159
160inline void OdBlob::rdPoints2d(OdGePoint2d* points, OdUInt32 num)
161{
162 getBytes(points, num * sizeof(OdGePoint2d));
163}
164
165inline void OdBlob::wrPoints2d(const OdGePoint2d* points, OdUInt32 num)
166{
167 putBytes(points, num * sizeof(OdGePoint2d));
168}
169
170inline void OdBlob::wrDoubles(const double* doubles, OdUInt32 num)
171{
172 putBytes(doubles, num * sizeof(double));
173}
174
175inline void OdBlob::rdDoubles(double* doubles, OdUInt32 num)
176{
177 getBytes(doubles, num * sizeof(double));
178}
179
180inline void OdBlob::rdObjectIds(OdDbStub** pRes, OdUInt32 num)
181{
182 getBytes(pRes, num * sizeof(OdDbStub*));
183}
184
185inline OdDbStub* OdBlob::rdObjectId()
186{
187 OdDbStub* id;
188 getBytes(&id, sizeof(id));
189 return id;
190}
191
192inline void OdBlob::wrObjectId(const OdDbStub* id)
193{
194 putBytes(&id, sizeof(OdDbStub*));
195}
196
197#endif // #ifndef _ODBLOB_H_INCLUDED_
#define BLOB_DATA(type, name)
Definition: OdBlob.h:90
unsigned int OdUInt32
short OdInt16
signed char OdInt8
int OdInt32
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
Definition: OdBlob.h:45
void wrDoubles(const double *doubles, OdUInt32 num)
Definition: OdBlob.h:170
void wrInt64(OdInt64)
void wrPoints3d(const OdGePoint3d *points, OdUInt32 num)
Definition: OdBlob.h:155
void wrInt16(OdInt16)
void wrObjectId(const OdDbStub *id)
Definition: OdBlob.h:192
void rdDoubles(double *doubles, OdUInt32 num)
Definition: OdBlob.h:175
OdInt16 rdInt16()
OdGeVector3d rdVector3d()
Definition: OdBlob.h:117
OdInt8 rdInt8()
void wrInt8(OdInt8)
void wrBool(bool)
void wrAddress(const void *)
Definition: OdBlob.h:135
void wrPoint3d(const OdGePoint3d &)
Definition: OdBlob.h:114
OdInt64 rdInt64()
void rdPoints2d(OdGePoint2d *points, OdUInt32 num)
Definition: OdBlob.h:160
OdDbStub * rdObjectId()
Definition: OdBlob.h:185
void * rdAddress()
Definition: OdBlob.h:128
void rdObjectIds(OdDbStub **pRes, OdUInt32 num)
Definition: OdBlob.h:180
double rdDouble()
void wrPoints2d(const OdGePoint2d *points, OdUInt32 num)
Definition: OdBlob.h:165
void wrDouble(double)
OdBlob(OdUInt32 nPageSize=0x1000)
Definition: OdBlob.h:85
void wrInt32(OdInt32)
OdInt32 rdInt32()
void wrVector3d(const OdGeVector3d &)
Definition: OdBlob.h:124
bool rdBool()
void wrBytes(const void *buf, OdUInt32 len)
Definition: OdBlob.h:145
void rdBytes(void *buf, OdUInt32 len)
Definition: OdBlob.h:140
void rdPoints3d(OdGePoint3d *points, OdUInt32 num)
Definition: OdBlob.h:150
Definition: Int64.h:43
void putBytes(const void *buffer, OdUInt32 nLen)
void getBytes(void *buffer, OdUInt32 nLen)
void setPageDataSize(OdUInt32 nPageSize)