MCPcopy Create free account
hub / github.com/ImageEngine/cortex / writeSimpleAttr

Function writeSimpleAttr

src/IECoreScene/PDCParticleWriter.cpp:93–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92template<class T, class E, unsigned int n>
93static void writeSimpleAttr( ofstream &oStream, const T *attr )
94{
95 if( bigEndian() )
96 {
97 oStream.write( (const char *)&attr->readable(), sizeof( E ) * n );
98 }
99 else
100 {
101 typename T::ValueType v = attr->readable();
102 E *data = (E *)&v;
103 for( size_t i=0; i<n; i++ )
104 {
105 *data = reverseBytes( *data );
106 data++;
107 }
108 oStream.write( (const char *)&v, sizeof( E ) * n );
109 }
110}
111
112void PDCParticleWriter::doWrite( const CompoundObject *operands )
113{

Callers

nothing calls this directly

Calls 4

bigEndianFunction · 0.85
reverseBytesFunction · 0.85
readableMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected