OpenBarnyard
 
Loading...
Searching...
No Matches
AAssetStreaming Class Reference

#include <AAssetStreaming.h>

Inheritance diagram for AAssetStreaming:

Public Member Functions

 AAssetStreaming ()
 
 ~AAssetStreaming ()
 
void Update ()
 
void CancelAllJobs ()
 
TBOOL HasActiveJobs () const
 
void AddMainThreadJob (AMainThreadJob *a_pJob)
 
Toshi::TFileStream & GetFileStream ()
 
void SetFlag (TBOOL a_bFlag)
 

Detailed Description

Definition at line 6 of file AAssetStreaming.h.

Constructor & Destructor Documentation

◆ AAssetStreaming()

AAssetStreaming::AAssetStreaming ( )

Definition at line 12 of file AAssetStreaming.cpp.

13{
14 m_pCurrentJob = TNULL;
15 m_Unk = TNULL;
16 m_bFlag = TTRUE;
17 m_FileStream.Create( 0, Toshi::TThread::THREAD_PRIORITY_NORMAL, 0 );
18}
#define TNULL
Definition Typedefs.h:23
#define TTRUE
Definition Typedefs.h:25

◆ ~AAssetStreaming()

AAssetStreaming::~AAssetStreaming ( )

Definition at line 20 of file AAssetStreaming.cpp.

21{
22}

Member Function Documentation

◆ AddMainThreadJob()

void AAssetStreaming::AddMainThreadJob ( AMainThreadJob * a_pJob)

Definition at line 66 of file AAssetStreaming.cpp.

67{
68 TASSERT( m_pCurrentJob != a_pJob );
69 a_pJob->m_bIsFinished = TFALSE;
70 m_Jobs.PushBack( a_pJob );
71}
#define TASSERT(X,...)
Definition Defines.h:138
#define TFALSE
Definition Typedefs.h:24

◆ CancelAllJobs()

void AAssetStreaming::CancelAllJobs ( )

Definition at line 43 of file AAssetStreaming.cpp.

44{
45 for ( auto it = m_Jobs.Begin(); it != m_Jobs.End(); )
46 {
47 auto next = it->Next();
48
49 if ( it->CancelJob() )
50 {
51 it->m_bIsFinished = TTRUE;
52 it->Remove();
53 }
54
55 it = next;
56 }
57}

◆ GetFileStream()

Toshi::TFileStream & AAssetStreaming::GetFileStream ( )
inline

Definition at line 19 of file AAssetStreaming.h.

20 {
21 return m_FileStream;
22 }

◆ HasActiveJobs()

TBOOL AAssetStreaming::HasActiveJobs ( ) const

Definition at line 60 of file AAssetStreaming.cpp.

61{
62 return !m_Jobs.IsEmpty() || m_pCurrentJob != TNULL;
63}

◆ SetFlag()

void AAssetStreaming::SetFlag ( TBOOL a_bFlag)
inline

Definition at line 24 of file AAssetStreaming.h.

25 {
26 m_bFlag = a_bFlag;
27 }

◆ Update()

void AAssetStreaming::Update ( )

Definition at line 25 of file AAssetStreaming.cpp.

26{
27 if ( m_pCurrentJob == TNULL )
28 {
29 if ( !m_Jobs.IsEmpty() )
30 {
31 m_pCurrentJob = m_Jobs.PopFront();
32 m_pCurrentJob->BeginJob();
33 }
34 }
35 else if ( m_pCurrentJob->RunJob() )
36 {
37 m_pCurrentJob->m_bIsFinished = TTRUE;
38 m_pCurrentJob = TNULL;
39 }
40}

The documentation for this class was generated from the following files: