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

Function writeAttr

src/IECoreScene/PDCParticleWriter.cpp:71–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70template<class T, class E, unsigned int n>
71static void writeAttr( ofstream &oStream, const T *attr )
72{
73 if( bigEndian() )
74 {
75 const typename T::ValueType &v = attr->readable();
76 oStream.write( (const char *)&v[0], sizeof( E ) * n * v.size() );
77 }
78 else
79 {
80 typename T::Ptr attrCopy = attr->copy();
81 typename T::ValueType &v = attrCopy->writable();
82 E *data = (E *)&v[0];
83 for( size_t i=0; i<v.size() * n; i++ )
84 {
85 *data = reverseBytes( *data );
86 data++;
87 }
88 oStream.write( (const char *)&v[0], sizeof( E ) * n * v.size() );
89 }
90}
91
92template<class T, class E, unsigned int n>
93static void writeSimpleAttr( ofstream &oStream, const T *attr )

Callers

nothing calls this directly

Calls 7

bigEndianFunction · 0.85
reverseBytesFunction · 0.85
readableMethod · 0.80
writeMethod · 0.45
sizeMethod · 0.45
copyMethod · 0.45
writableMethod · 0.45

Tested by

no test coverage detected