Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TextureReloadRequest Class Reference

This loader request will call Texture::get_ram_image() in a sub-thread, to force the texture's image to be re-read from disk. More...

`#include "textureReloadRequest.h"`

Inheritance diagram for TextureReloadRequest:

## Public Member Functions
| TextureReloadRequest (const std::string &name, PreparedGraphicsObjects *pgo, Texture *texture, bool allow_compressed)
| Create a new TextureReloadRequest, and add it to the loader via load_async(), to begin an asynchronous load.
virtual TypeHandle | force_init_type ()
bool | get_allow_compressed () const
| Returns the "allow compressed" flag associated with this asynchronous TextureReloadRequest.
PreparedGraphicsObjects * | get_prepared_graphics_objects () const
| Returns the PreparedGraphicsObjects object associated with this asynchronous TextureReloadRequest.
Texture * | get_texture () const
virtual TypeHandle | get_type () const
bool | is_ready () const
| Returns true if this request has completed, false if it is still pending.
Public Member Functions inherited from AsyncTask
| AsyncTask (const std::string &name=std::string())
void | clear_delay ()
| Removes any delay specified for the task.
void | clear_name ()
| Resets the task's name to empty.
double | get_average_dt () const
double | get_delay () const
| Returns the delay value that has been set via set_delay, if any.
double | get_dt () const
int | get_elapsed_frames () const
| Returns the number of frames that have elapsed since the task was started, according to the task manager's clock.
double | get_elapsed_time () const
| Returns the amount of time that has elapsed since the task was started, according to the task manager's clock.
AsyncTaskManager * | get_manager () const
double | get_max_dt () const
std::string | get_name_prefix () const
| Returns the initial part of the name, up to but not including any trailing digits following a hyphen or underscore.
int | get_priority () const
int | get_sort () const
int | get_start_frame () const
| Returns the frame number at which the task was started, according to the task manager's clock.
double | get_start_time () const
| Returns the time at which the task was started, according to the task manager's clock.
State | get_state () const
const std::string & | get_task_chain () const
AtomicAdjust::Integer | get_task_id () const
double | get_wake_time () const
| If this task has been added to an AsyncTaskManager with a delay in effect, this returns the time at which the task is expected to awaken.
bool | has_delay () const
| Returns true if a delay has been set for this task via set_delay(), or false otherwise.
bool | is_alive () const
virtual void | output (std::ostream &out) const
void | recalc_wake_time ()
| If the task is currently sleeping on a task chain, this resets its wake time to the current time + get_delay().
bool | remove ()
| Removes the task from its active manager, if any, and makes the state S_inactive (or possible S_servicing_removed).
void | set_delay (double delay)
| Specifies the amount of time, in seconds, by which this task will be delayed after it has been added to the AsyncTaskManager.
void | set_done_event (const std::string &done_event)
void | set_name (const std::string &name)
void | set_priority (int priority)
void | set_sort (int sort)
void | set_task_chain (const std::string &chain_name)
Public Member Functions inherited from AsyncFuture
| AsyncFuture ()
| Initializes the future in the pending state.
virtual | ~AsyncFuture ()
| Destroys the future.
bool | add_waiting_task (AsyncTask *task)
| Indicates that the given task is waiting for this future to complete.
bool | cancelled () const
| Returns true if the future was cancelled.
bool | done () const
| Returns true if the future is done or has been cancelled.
const std::string & | get_done_event () const
TypedObject * | get_result () const
| Returns this future's result.
void | get_result (TypedObject *&ptr, ReferenceCount *&ref_ptr) const
| Returns this future's result as a pair of TypedObject, ReferenceCount pointers.
void | notify_done (bool clean_exit)
| Schedules the done callbacks.
void | set_done_event (const std::string &done_event)
void | set_result (const EventParameter &result)
void | set_result (std::nullptr_t)
| Sets this future's result.
void | set_result (TypedObject *ptr, ReferenceCount *ref_ptr)
| Sets this future's result.
void | set_result (TypedObject *result)
void | set_result (TypedReferenceCount *result)
void | set_result (TypedWritableReferenceCount *result)
void | wait ()
| Waits until the future is done.
void | wait (double timeout)
| Waits until the future is done, or until the timeout is reached.
Public Member Functions inherited from TypedReferenceCount
| TypedReferenceCount (const TypedReferenceCount &copy)
void | operator= (const TypedReferenceCount &copy)
Public Member Functions inherited from TypedObject
| TypedObject (const TypedObject &copy)=default
TypedObject * | as_typed_object ()
| Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObject * | as_typed_object () const
| Returns the object, upcast (if necessary) to a TypedObject pointer.
int | get_best_parent_from_Set (const std::set< int > &) const
int | get_type_index () const
| Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
bool | is_exact_type (TypeHandle handle) const
| Returns true if the current object is the indicated type exactly.
bool | is_of_type (TypeHandle handle) const
| Returns true if the current object is or derives from the indicated type.
TypedObject & | operator= (const TypedObject &copy)=default
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)
Public Member Functions inherited from ReferenceCount
int | get_ref_count () const
WeakReferenceList * | get_weak_list () const
| Returns the WeakReferenceList associated with this ReferenceCount object.
bool | has_weak_list () const
| Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
void | local_object ()
| This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
void | ref () const
| Explicitly increments the reference count.
bool | ref_if_nonzero () const
| Atomically increases the reference count of this object if it is not zero.
bool | test_ref_count_integrity () const
| Does some easy checks to make sure that the reference count isn't completely bogus.
bool | test_ref_count_nonzero () const
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
virtual bool | unref () const
| Explicitly decrements the reference count.
bool | unref_if_one () const
| Atomically decreases the reference count of this object if it is one.
WeakReferenceList * | weak_ref ()
| Adds the indicated PointerToVoid as a weak reference to this object.
void | weak_unref ()
| Removes the indicated PointerToVoid as a weak reference to this object.
Public Member Functions inherited from Namable
| Namable (const std::string &initial_name="")
void | clear_name ()
| Resets the Namable's name to empty.
const std::string & | get_name () const
bool | has_name () const
| Returns true if the Namable has a nonempty name set, false if the name is empty.
void | output (std::ostream &out) const
| Outputs the Namable.
void | set_name (const std::string &name)

## Static Public Member Functions
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from AsyncTask
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from AsyncFuture
static AsyncFuture * | gather (Futures futures)
| Creates a new future that returns `done()` when all of the contained futures are done.
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from TypedObject
static TypeHandle | get_class_type ()
static void | init_type ()
| This function is declared non-inline to work around a compiler bug in g++ 2.96.
Static Public Member Functions inherited from ReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from Namable
static TypeHandle | get_class_type ()
static void | init_type ()

## Public Attributes
| get_texture
| Returns the Texture object associated with this asynchronous TextureReloadRequest.
Public Attributes inherited from AsyncTask
| get_average_dt
| Returns the average amount of time elapsed during each of the task's previous run cycles, in seconds.
| get_done_event
| get_dt
| Returns the amount of time elapsed during the task's previous run cycle, in seconds.
| get_manager
| Returns the AsyncTaskManager that this task is active on.
| get_max_dt
| Returns the maximum amount of time elapsed during any one of the task's previous run cycles, in seconds.
| get_name
| get_priority
| Returns the task's current priority value.
| get_sort
| Returns the task's current sort value.
| get_state
| Returns the current state of the task.
| get_task_chain
| Returns the AsyncTaskChain on which this task will be running.
| get_task_id
| Returns a number guaranteed to be unique for each different AsyncTask object in the universe.
| is_alive
| Returns true if the task is currently active or sleeping on some task chain, meaning that it will be executed in its turn, or false if it is not active.
| set_done_event
| Sets the event name that will be triggered when the task finishes.
| set_name
| set_priority
| Specifies a priority value for this task.
| set_sort
| Specifies a sort value for this task.
| set_task_chain
| Specifies the AsyncTaskChain on which this task will be running.
Public Attributes inherited from AsyncFuture
| get_done_event
| Returns the event name that will be triggered when the future finishes.
| set_done_event
| Sets the event name that will be triggered when the future finishes.
Public Attributes inherited from TypedObject
| get_type
Public Attributes inherited from ReferenceCount
| get_ref_count
| Returns the current reference count.
Public Attributes inherited from Namable
| get_name
| set_name

## Additional Inherited Members
Public Types inherited from AsyncTask
enum | DoneStatus { DS_done , DS_cont , DS_again , DS_pickup , DS_exit , DS_pause , DS_interrupt , DS_await }
enum | State { S_inactive , S_active , S_servicing , S_servicing_removed , S_sleeping , S_active_nested , S_awaiting }
Public Types inherited from AsyncFuture
typedef pvector< PointerTo< AsyncFuture > > | Futures

## Detailed Description

This loader request will call Texture::get_ram_image() in a sub-thread, to force the texture's image to be re-read from disk.

It is used by GraphicsStateGuardian::async_reload_texture(), when get_incomplete_render() is true.

Definition at line 31 of file textureReloadRequest.h.

## Constructor & Destructor Documentation

## ◆ TextureReloadRequest()

TextureReloadRequest::TextureReloadRequest | ( | const std::string & | name,
|  | PreparedGraphicsObjects * | pgo,
|  | Texture * | texture,
|  | bool | allow_compressed )
| inline explicit

Create a new TextureReloadRequest, and add it to the loader via load_async(), to begin an asynchronous load.

Definition at line 18 of file textureReloadRequest.I.

## Member Function Documentation

## ◆ force_init_type()

virtual TypeHandle TextureReloadRequest::force_init_type | ( |  | ) |
| inline virtual

Reimplemented from AsyncTask.

Definition at line 68 of file textureReloadRequest.h.

## ◆ get_allow_compressed()

bool TextureReloadRequest::get_allow_compressed | ( |  | ) | const
| inline

Returns the "allow compressed" flag associated with this asynchronous TextureReloadRequest.

Definition at line 53 of file textureReloadRequest.I.

## ◆ get_class_type()

static TypeHandle TextureReloadRequest::get_class_type | ( |  | ) |
| inline static

Definition at line 57 of file textureReloadRequest.h.

## ◆ get_prepared_graphics_objects()

PreparedGraphicsObjects * TextureReloadRequest::get_prepared_graphics_objects | ( |  | ) | const
| inline

Returns the PreparedGraphicsObjects object associated with this asynchronous TextureReloadRequest.

Definition at line 35 of file textureReloadRequest.I.

## ◆ get_type()

virtual TypeHandle TextureReloadRequest::get_type | ( |  | ) | const
| inline virtual

Reimplemented from AsyncTask.

Definition at line 65 of file textureReloadRequest.h.

## ◆ init_type()

static void TextureReloadRequest::init_type | ( |  | ) |
| inline static

Definition at line 60 of file textureReloadRequest.h.

## ◆ is_ready()

bool TextureReloadRequest::is_ready | ( |  | ) | const
| inline

Returns true if this request has completed, false if it is still pending.

Equivalent to `req.done() and not req.cancelled()`.

See also
  done()

Definition at line 63 of file textureReloadRequest.I.

References AtomicAdjustDummyImpl::get().

## Member Data Documentation

## ◆ get_texture

Texture * TextureReloadRequest::get_texture
| inline

Returns the Texture object associated with this asynchronous TextureReloadRequest.

Definition at line 46 of file textureReloadRequest.h.

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

- panda/src/gobj/textureReloadRequest.h
- panda/src/gobj/textureReloadRequest.cxx
- panda/src/gobj/textureReloadRequest.I