MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / createStreamObject

Method createStreamObject

Engine/source/core/util/zip/zipObject.cpp:72–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70//-----------------------------------------------------------------------------
71
72StreamObject *ZipObject::createStreamObject(Stream *stream)
73{
74 for(S32 i = 0;i < mStreamPool.size();++i)
75 {
76 StreamObject *so = mStreamPool[i];
77
78 if(so == NULL)
79 {
80 // Reuse any free locations in the pool
81 so = new StreamObject(stream);
82 so->registerObject();
83 mStreamPool[i] = so;
84 return so;
85 }
86
87 if(so->getStream() == NULL)
88 {
89 // Existing unused stream, update it and return it
90 so->setStream(stream);
91 return so;
92 }
93 }
94
95 // No free object found, create a new one
96 StreamObject *so = new StreamObject(stream);
97 so->registerObject();
98 mStreamPool.push_back(so);
99
100 return so;
101}
102
103//-----------------------------------------------------------------------------
104// Public Methods

Callers

nothing calls this directly

Calls 5

sizeMethod · 0.45
registerObjectMethod · 0.45
getStreamMethod · 0.45
setStreamMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected