2 * Copyright 2017, Andrew Lindesay <apl@lindesay.co.nz>.
3 * All rights reserved. Distributed under the terms of the MIT License.
5 #include "BulkLoadContext.h"
8 BulkLoadContext::BulkLoadContext()
10 fState(BULK_LOAD_INITIAL
),
12 fRepositoryProcess(NULL
),
13 fPkgProcesses(new List
<AbstractServerProcess
*, true>()),
19 BulkLoadContext::~BulkLoadContext()
23 if (fIconProcess
!= NULL
)
26 if (fRepositoryProcess
!= NULL
)
27 delete fRepositoryProcess
;
29 int32 count
= fPkgProcesses
->CountItems();
32 for (i
= 0; i
< count
; i
++)
33 delete fPkgProcesses
->ItemAt(i
);
40 BulkLoadContext::State()
47 BulkLoadContext::SetState(bulk_load_state value
)
54 BulkLoadContext::StopAllProcesses()
56 if (fIconProcess
!= NULL
)
59 if (fRepositoryProcess
!= NULL
)
60 fRepositoryProcess
->Stop();
62 int32 count
= fPkgProcesses
->CountItems();
65 for (i
= 0; i
< count
; i
++)
66 fPkgProcesses
->ItemAt(i
)->Stop();
70 AbstractServerProcess
*
71 BulkLoadContext::IconProcess()
78 BulkLoadContext::SetIconProcess(AbstractServerProcess
* value
)
84 AbstractServerProcess
*
85 BulkLoadContext::RepositoryProcess()
87 return fRepositoryProcess
;
92 BulkLoadContext::SetRepositoryProcess(
93 AbstractServerProcess
* value
)
95 fRepositoryProcess
= value
;
100 BulkLoadContext::CountPkgProcesses()
102 return fPkgProcesses
->CountItems();
106 AbstractServerProcess
*
107 BulkLoadContext::PkgProcessAt(int32 index
)
109 return fPkgProcesses
->ItemAt(index
);
114 BulkLoadContext::AddPkgProcess(AbstractServerProcess
*value
)
116 fPkgProcesses
->Add(value
);
121 BulkLoadContext::AddProcessOption(uint32 flag
)
123 fProcessOptions
= fProcessOptions
| flag
;
128 BulkLoadContext::ProcessOptions()
130 return fProcessOptions
;