MCPcopy Create free account
hub / github.com/carbonengine/trinity / Get

Method Get

trinityal/Tr2ObjectFactory.h:14–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12{
13public:
14 ALResult Get( std::shared_ptr<ObjectType>& object, const CreateArgument& argument, Tr2PrimaryRenderContextAL& renderContext )
15 {
16 auto found = m_objects.find( argument );
17 if( found != m_objects.end() )
18 {
19 if( !found->second->IsValid() )
20 {
21 m_objects.erase( found );
22 }
23 else
24 {
25 object = found->second;
26 return S_OK;
27 }
28 }
29 auto newObject = std::make_shared<ObjectType>();
30 CR_RETURN_HR( newObject->Create( argument, renderContext ) );
31 m_objects[argument] = newObject;
32 object = newObject;
33 return S_OK;
34 }
35
36 void Clear()
37 {

Callers 5

RenderVolumetricsMethod · 0.45
ExecuteMethod · 0.45
CreateMethod · 0.45

Calls 3

endMethod · 0.45
IsValidMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected