47 enum { chunk = 0x800000 };
53 virtual QString FileName(
void )
const;
64 virtual bool IsValid(
void );
71 virtual bool IsOlderThan(
81 virtual bool IsNewerThan(
89 virtual int ClassVersion(
const class ClassDesc *pClass )
const;
102 template <
typename Type>
106 )
const {
return ClassVersion( Type::StaticClass() ) < iVersion; };
120 template <
typename Type>
124 )
const {
return ClassVersion( Type::StaticClass() ) > iVersion; };
128 virtual bool IsStoring(
void )
const;
132 virtual void SetError(
bool bError );
135 virtual int Version(
void )
const;
138 virtual uint64 CurrentPosition(
void )
const;
145 virtual void SetCurrentPosition(
153 virtual void ReportCorruption(
void );
160 bool bStoring =
false,
161 int iProjectedFileSize = 0,
162 bool bProgressBar =
true
167 bool bStoring =
false
174 virtual bool Close(
void );
177 virtual bool Eof(
void );
183 virtual bool ReadContents(
void );
198 virtual size_t Write(
208 virtual void ReadToFile(
213 virtual void WriteFromFile(
218 template <
typename type >
222 template <
typename type >
226 virtual Node *ReadPointer(
void );
227 virtual void WritePointer(
Node *pPointer );
232 template <
typename type >
239 template <
typename type >
243 template <
typename type >
247 template <
typename type >
248 inline Stream &operator <<( const Store<type> &
s );
257 template <
typename type >
260 int iSize = ReadInt();
262 Read( s.
data(), iSize*
sizeof(
type) );
269 template <
typename type >
270 inline Stream &operator <<( const QVector<type> &
s )
273 Write(
s.data(),
s.size()*
sizeof(
type) );
287 template <
typename type >
290 template <
typename type >
293 template <
typename type >
300 for (
unsigned int i = 0; i < m_iSize; i++ )
301 s ==
operator[]( i );
304 template <
typename type >
305 inline Stream &Stream::operator <<( const Store<type> &o ) { (*this) << o.ItemCount(); Write( &(o[0]),
sizeof(
type)*o.ItemCount() ); RegisterBlock( o.Name(), o.Size(),
sizeof(
type) );
return *
this; };
306 template <
typename type >
311 inline Stream &Stream::operator <<( const Store<unsigned int> &o ) { WriteIntArray(o);
return *
this; };
318 template <
typename type >
320 template <
typename type >
326 SetValue( dynamic_cast<type *>( s.
ReadPointer() ),
true );
330 template<
typename T >
333 s == m_iBlockItemCount;
336 s == m_iLogicalItemCount;
341 s << m_aBlocks.ItemCount();
342 for(
unsigned int i = 0; i < m_aBlocks.ItemCount(); ++i )
343 s.
Write( (
void*)m_aBlocks[i],
sizeof(T) * m_iBlockItemCount );
349 m_aBlocks.SetItemCount( iC );
350 for(
unsigned int i = 0; i < m_aBlocks.ItemCount(); ++i )
353 s.
Read( (
void*)m_aBlocks[i],
sizeof(T) * m_iBlockItemCount );
GLuint GLuint GLsizei GLenum type
virtual size_t Write(const void *pBuffer, size_t iSize)
Writes data to the stream from a buffer you provide.
virtual void WritePointer(Node *pPointer)
mudbox::Vector & operator<<(mudbox::Vector &v, const HWVector &r)
This is the base class for most classes in the Mudbox SDK.
unsigned long long uint64
void Serialize(class Stream &s)
Serializes the the array and its contents from/to a stream.
bool IsOlderThan(int iVersion, Type *) const
Checks if the file is older than a specified version for the given class.
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
virtual Node * ReadPointer(void)
Read/Writes node pointers.
#define MB_VERIFY_EQ(condition_, value_)
void Serialize(Stream &s)
const char * Name(void) const
Stream & operator>>(type &v)
Reads data from the stream to any data type.
virtual void ReadIntArray(Store< unsigned int > &s)
bool SetItemCount(unsigned int iSize, bool bKeepContent=false)
Sets the logical size of the array.
This is a generic attribute which can be used instead of the standard built in types.
This structure represents and describes a class.
void Serialize(Stream &s)
Serializes the pointer value to a stream.
int ReadInt(void)
Reads a single integer from the stream, and returns it.
long long Size(void) const
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QBitArray &)
virtual size_t Read(void *pBuffer, size_t iSize)
Reads data directly from the stream into a buffer you provide.
bool IsNewerThan(int iVersion, Type *) const
Checks if the file is newer than a specified version for the given class.
Class: ConvolutionKernel.
Streams are used to read information from a file, or to write it to a file.
#define DECLARE_CLASS
This macro should be used in declaration of classes which are inherited from the Node class (or any d...
void Serialize(Stream &s)
Serialize the value of the attribute into a stream.
virtual bool IsStoring(void) const
Returns true if the stream is in storing mode (i.e.
static void * AlignedAlloc(size_t iBytes, unsigned int iAlignment)