17 INLINE Loader::Results::
24 INLINE Loader::Results::
33 INLINE
void Loader::Results::
41 INLINE Loader::Results::
56 INLINE
int Loader::Results::
57 get_num_files()
const {
66 nassertr(n >= 0 && n < (
int)_files.size(), _files[0]._path);
67 return _files[n]._path;
75 nassertr(n >= 0 && n < (
int)_files.size(),
nullptr);
76 return _files[n]._type;
96 _task_manager = task_manager;
104 return _task_manager;
113 _task_chain = task_chain;
129 PT(
AsyncTaskChain) chain = _task_manager->find_task_chain(_task_chain);
130 if (chain !=
nullptr) {
131 chain->stop_threads();
142 return _task_manager->remove(task);
153 if (!_file_types_loaded) {
156 return load_file(filename, options);
174 _task_manager->add(request);
183 if (!_file_types_loaded) {
186 return save_file(filename, options, node);
204 _task_manager->add(request);
213 if (_global_ptr ==
nullptr) {
A basic node of the scene graph or data graph.
A class to manage a loose queue of isolated tasks, which can be performed either synchronously (in th...
Specifies parameters that may be passed to the loader.
bool remove(AsyncTask *task)
Removes a pending asynchronous load request.
A convenient class for loading models from disk, in bam or egg format (or any of a number of other fo...
get_file
Returns the nth file on the result list.
void set_task_manager(AsyncTaskManager *task_manager)
Specifies the task manager that is used for asynchronous loads.
static Loader * get_global_ptr()
Returns a pointer to the global Loader.
The name of a file, such as a texture file or an Egg file.
set_task_chain
Specifies the AsyncTaskChain on which this task will be running.
The AsyncTaskChain is a subset of the AsyncTaskManager.
void save_async(AsyncTask *request)
Begins an asynchronous save request.
void clear()
Removes all the files from the list.
void add_file(const Filename &file, LoaderFileType *type)
Adds a new file to the result list.
get_file_type
Returns the file type of the nth file on the result list.
This class represents a concrete task performed by an AsyncManager.
void stop_threads()
Stop any threads used for asynchronous loads.
AsyncTaskManager * get_task_manager() const
Returns the task manager that is used for asynchronous loads.
This is the base class for a family of scene-graph file types that the Loader supports.
void set_task_chain(const std::string &task_chain)
Specifies the task chain that is used for asynchronous loads.
const std::string & get_task_chain() const
Returns the task chain that is used for asynchronous loads.
bool save_sync(const Filename &filename, const LoaderOptions &options, PandaNode *node) const
Saves the file immediately, waiting for it to complete.